GHC Head fails to build on AArch64 with profiling (relocation truncated to fit: R_AARCH64_JUMP26 against symbol)
## Summary
We fail to build profiled-dynamic GHC on AArch64. The error I see is:
```
_build/stage1/compiler/build/GHC.p_dyn_o: in function `ghczm9zi15zminplace_GHC_getRichTokenStream1_info':
(.text+0x2bb0): relocation truncated to fit: R_AARCH64_JUMP26 against symbol `ghczm9zi15zminplace_GHCziUtilsziPpr_fullRender_info' defined in .text section in _build/stage1/compiler/build/GHC/Utils/Ppr.p_dyn_o
(.text+0x2f90): relocation truncated to fit: R_AARCH64_JUMP26 against symbol `ghczm9zi15zminplace_GHCziUtilsziPpr_fullRender_info' defined in .text section in _build/stage1/compiler/build/GHC/Utils/Ppr.p_dyn_o
(.text+0x31a0): relocation truncated to fit: R_AARCH64_JUMP26 against symbol `ghczm9zi15zminplace_GHCziUtilsziPpr_fullRender_info' defined in .text section in _build/stage1/compiler/build/GHC/Utils/Ppr.p_dyn_o
_build/stage1/compiler/build/GHC.p_dyn_o: in function `ghczm9zi15zminplace_GHC_runGhc9_info':
(.text+0x4670): relocation truncated to fit: R_AARCH64_JUMP26 against symbol `ghczm9zi15zminplace_GHCziUtilsziPanicziPlain_zdwpanic_info' defined in .text section in _build/stage1/compiler/build/GHC/Utils/Panic/Plain.p_dyn_o
_build/stage1/compiler/build/GHC.p_dyn_o: in function `ghczm9zi15zminplace_GHC_runGhcT2_info':
(.text+0x4770): relocation truncated to fit: R_AARCH64_JUMP26 against symbol `ghczm9zi15zminplace_GHCziUtilsziPanicziPlain_zdwpanic_info' defined in .text section in _build/stage1/compiler/build/GHC/Utils/Panic/Plain.p_dyn_o
_build/stage1/compiler/build/GHC.p_dyn_o: in function `ghczm9zi15zminplace_GHC_initGhcMonad_info':
(.text+0x5718): relocation truncated to fit: R_AARCH64_JUMP26 against symbol `ghczm9zi15zminplace_GHCziUtilsziPanicziPlain_zdwpanic_info' defined in .text section in _build/stage1/compiler/build/GHC/Utils/Panic/Plain.p_dyn_o
_build/stage1/compiler/build/GHC.p_dyn_o: in function `ghczm9zi15zminplace_GHC_typecheckModule_info':
(.text+0x9bac): relocation truncated to fit: R_AARCH64_JUMP26 against symbol `ghczm9zi15zminplace_GHCziUtilsziLogger_logDumpFilezugo1_info' defined in .text section in _build/stage1/compiler/build/GHC/Utils/Logger.p_dyn_o
(.text+0xa0d8): relocation truncated to fit: R_AARCH64_JUMP26 against symbol `ghczm9zi15zminplace_GHCziUnitziHomeziGraph_zdwpolyzugo13_info' defined in .text section in _build/stage1/compiler/build/GHC/Unit/Home/Graph.p_dyn_o
(.text+0xa1b0): relocation truncated to fit: R_AARCH64_JUMP26 against symbol `ghczm9zi15zminplace_GHCziUtilsziLogger_zdwlogzudopt_info' defined in .text section in _build/stage1/compiler/build/GHC/Utils/Logger.p_dyn_o
_build/stage1/compiler/build/GHC.p_dyn_o: in function `ghczm9zi15zminplace_GHC_lookupLoadedHomeModuleByModuleName4_info':
(.text+0xae68): relocation truncated to fit: R_AARCH64_JUMP26 against symbol `ghczm9zi15zminplace_GHCziUtilsziLogger_logDumpFilezugo1_info' defined in .text section in _build/stage1/compiler/build/GHC/Utils/Logger.p_dyn_o
(.text+0xb0f0): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status
`gcc' failed in phase `Linker'. (Exit code: 1)
```
This seems like a classic jump offset overflow. https://gitlab.haskell.org/ghc/ghc/-/issues/26284 has a similar issue being reported.
Usually what happens is that we have:
```
Module1:
foo:
jmp Module2.bar # Uses max 128Mbit offset
<code>
<moreModule1Code>
--------
Module2:
bar:
```
And what the linker should do is check if those two functions are close enough. And if not
translate this into:
```
Module1:
foo:
jmp tramp1_Module2.bar
<code>
<moreModule1Code>
--linker insert
tramp1_Module2.bar:
<load absolute address of tramp1_Module2.bar>
<jmp_absolute to address>
```
As I understand it last time I looked into this the linker *should* know how to deal with this, but sometimes fails to do so. I've added `-finter-module-far-jumps` which means we generate the (slower) absolute jumps inline in the NCG directly when generating jumps across modules. Which according to #26284 will rectify this. (Currently rebuilding to confirm).
The system this ran on was using binutils 2.44 and gcc 14.2
It's possible, but not given that using a different linker would have fixed this. I might try to see if using clang works. If so this is likely a linker bug.
If not we should look at enabling `-finter-module-far-jumps` by default, or other solutions.
## Environment
* GHC version used: GHC HEAD (stage 2 error)
Optional:
* Operating System: debian
* System Architecture: AArch64
issue