Magnus pushed to branch wip/mangoiv/aarch64-longjump at Glasgow Haskell Compiler / GHC Commits: e3df0947 by mangoiv at 2026-05-11T14:22:39+02:00 driver: enable -finter-module-far-jumps by default this fixes a compatibility bug with certain binutils/gcc versions where we were seeing jump offset overflow errors. This commit can probably reverted if we stop supporting the problematic binutils/gcc verions (2.44 and 14.2, respectively) Reolves #26994 - - - - - 3 changed files: - + changelog.d/inter-module-far-jumps-aarch64-default - compiler/GHC/Driver/DynFlags.hs - docs/users_guide/using-optimisation.rst Changes: ===================================== changelog.d/inter-module-far-jumps-aarch64-default ===================================== @@ -0,0 +1,5 @@ +section: driver +synopsis: enable -finter-module-far-jumps by default on aarch64 +issues: #26994 +mrs: !16016 +description: Some binutils and gcc versions lead to jump offset erros on aarch64 profiled/dynamic ways. To mitigate this bug, we enable inter-module-far-jumps by default on this platform. ===================================== compiler/GHC/Driver/DynFlags.hs ===================================== @@ -1233,6 +1233,11 @@ defaultFlags settings Opt_SpecialiseIncoherents, Opt_WriteSelfRecompInfo ] + {- note(mangoiv): + - on aarch64 profiled-dynamic, we are seeing jump offset overflow + - errors on certain binutils versions. This can probably be deactivated + - if we stop supporting binutils 2.44 / GCC 14.2 -} + ++ [ Opt_InterModuleFarJumps | platformArch platform == ArchAArch64 ] ++ [f | (ns,f) <- optLevelFlags, 0 `elem` ns] -- The default -O0 options @@ -1245,6 +1250,7 @@ defaultFlags settings ++ validHoleFitDefaults where platform = sTargetPlatform settings + defaultWays = ways $ defaultDynFlags settings -- | These are the default settings for the display and sorting of valid hole -- fits in typed-hole error messages. See Note [Valid hole fits include ...] ===================================== docs/users_guide/using-optimisation.rst ===================================== @@ -732,7 +732,7 @@ as such you shouldn't need to set any of them explicitly. A flag :reverse: -fno-inter-module-far-jumps :category: - :default: Off + :default: on if the target platform is AArch64, off on all others This flag forces GHC to use far jumps instead of near jumps for all jumps which cross module boundries. This removes the need for jump islands/linker View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/e3df0947028baeaaf14c419763c5570c... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/e3df0947028baeaaf14c419763c5570c... You're receiving this email because of your account on gitlab.haskell.org.
participants (1)
-
Magnus (@MangoIV)