Magnus pushed to branch wip/mangoiv/aarch64-longjump at Glasgow Haskell Compiler / GHC Commits: ffa245f1 by mangoiv at 2026-06-30T15:29:11+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 - - - - - 4 changed files: - + changelog.d/inter-module-far-jumps-aarch64-default - compiler/GHC/Driver/DynFlags.hs - compiler/GHC/Platform/Ways.hs - docs/users_guide/using-optimisation.rst Changes: ===================================== changelog.d/inter-module-far-jumps-aarch64-default ===================================== @@ -0,0 +1,5 @@ +section: compiler +synopsis: enable -finter-module-far-jumps by default on profiled aarch64-linux +issues: #26994 +mrs: !16016 +description: Some binutils and gcc versions lead to jump offset erros on aarch64-linux profiled ways. To mitigate this bug, we enable inter-module-far-jumps by default on this platform/way. ===================================== compiler/GHC/Driver/DynFlags.hs ===================================== @@ -1241,7 +1241,6 @@ defaultFlags settings Opt_SpecialiseIncoherents, Opt_WriteSelfRecompInfo ] - ++ [f | (ns,f) <- optLevelFlags, 0 `elem` ns] -- The default -O0 options ===================================== compiler/GHC/Platform/Ways.hs ===================================== @@ -154,6 +154,14 @@ wayGeneralFlags _ WayDyn = [Opt_PIC, Opt_ExternalDynamicRefs] -- .so before loading the .so using the system linker. Since only -- PIC objects can be linked into a .so, we have to compile even -- modules of the main program with -fPIC when using -dynamic. +wayGeneralFlags platform WayProf + | ArchAArch64 <- platformArch platform + , OSLinux <- platformOS platform = [Opt_InterModuleFarJumps] + {- 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 + - https://gitlab.haskell.org/ghc/ghc/-/issues/26994 -} wayGeneralFlags _ WayProf = [] -- | Turn these flags off when enabling this way ===================================== 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 is AArch64-Linux and this is a profiling way, 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/ffa245f11984d6088590c76b75227d3f... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/ffa245f11984d6088590c76b75227d3f... You're receiving this email because of your account on gitlab.haskell.org.
participants (1)
-
Magnus (@MangoIV)