`gcc' failed in phase `Linker'. (Exit code: 1)

Hey folks. Trying to build my project and things are not going well on an M3 macOS machine:

ld: B/BL out of range 223448292 (max +/-128MB) from 0x10000A42C ('<anon>'+76 from '/Users/stevenleiva/Repos/megarepo/backend/fancy-api/.stack-work/dist/aarch64-osx/ghc-9.2.7/build/spec/spec-tmp/Freckle/Api/Events/Answer/MathAdaptiveMetadataContentSpec.o') to 0x10D523110 ('_stg_ap_n_fast' from '/Users/stevenleiva/.stack/programs/aarch64-osx/ghc-9.2.7/lib/ghc-9.2.7/lib/aarch64-osx-ghc-9.2.7/rts-1.0.2/libHSrts-1.0.2_thr.a[133](AutoApply.thr_o)')
final section layout:
    __PAGEZERO           addr=0x00000000, size=0x100000000, fileOffset=0x00000000
    __TEXT               addr=0x100000000, size=0x0dbd8000, fileOffset=0x00000000
        __text           addr=0x10000a3e0, size=0x0d51a18c, fileOffset=0x0000a3e0
        __stubs          addr=0x10d52456c, size=0x000018fc, fileOffset=0x0d52456c
        __init_offsets   addr=0x10d525e68, size=0x00000240, fileOffset=0x0d525e68
        __cstring        addr=0x10d5260a8, size=0x00642aeb, fileOffset=0x0d5260a8
        __const          addr=0x10db68ba0, size=0x00065a30, fileOffset=0x0db68ba0
        __eh_frame       addr=0x10dbce5d0, size=0x000068d4, fileOffset=0x0dbce5d0
    __DATA_CONST         addr=0x10dbd8000, size=0x00020000, fileOffset=0x0dbd8000
        __got            addr=0x10dbd8000, size=0x00001168, fileOffset=0x0dbd8000
        __const          addr=0x10dbd9170, size=0x0001b708, fileOffset=0x0dbd9170
    __DATA               addr=0x10dbf8000, size=0x01fc4000, fileOffset=0x0dbf8000
        __data           addr=0x10dbf8000, size=0x01fbda58, fileOffset=0x0dbf8000
        __thread_vars    addr=0x10fbb5a58, size=0x00000018, fileOffset=0x0fbb5a58
        __thread_bss     addr=0x10fbb5a70, size=0x00000008, fileOffset=0x0fbb5a70
        __bss            addr=0x10fbb5a78, size=0x00002270, fileOffset=0x00000000
        __common         addr=0x10fbb7d00, size=0x00001108, fileOffset=0x00000000
    __LINKEDIT           addr=0x10fbbc000, size=0x09a2c000, fileOffset=0x0fbb8000
clang: error: linker command failed with exit code 1 (use -v to see invocation)
`gcc' failed in phase `Linker'. (Exit code: 1)

I took a look at this thread Ghc-9.2.2 fails in Linker phase but that’s for a different version of ghc.

I’d be happy to help but I need a way of reproducing. Any chance you could open a ticket in the GHC issue tracker ?

I’ve created an issue here: #24648: `gcc' failed in phase `Linker' on GHC 9.2.7 · Issues · Glasgow Haskell Compiler / GHC · GitLab