Magnus pushed to branch wip/mangoiv/aarch64-longjump at Glasgow Haskell Compiler / GHC

Commits:

3 changed files:

Changes:

  • changelog.d/inter-module-far-jumps-aarch64-default
    1
    +section: driver
    
    2
    +synopsis: enable -finter-module-far-jumps by default on aarch64-linux
    
    3
    +issues: #26994
    
    4
    +mrs: !16016
    
    5
    +description: Some binutils and gcc versions lead to jump offset erros on aarch64-linux 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,13 @@ defaultFlags settings
    1233 1233
           Opt_SpecialiseIncoherents,
    
    1234 1234
           Opt_WriteSelfRecompInfo
    
    1235 1235
         ]
    
    1236
    +    {- note(mangoiv):
    
    1237
    +     - on aarch64 profiled-dynamic, we are seeing jump offset overflow
    
    1238
    +     - errors on certain binutils versions. This can probably be deactivated
    
    1239
    +     - if we stop supporting binutils 2.44 / GCC 14.2
    
    1240
    +     - https://gitlab.haskell.org/ghc/ghc/-/issues/26994 -}
    
    1241
    +    ++ [ Opt_InterModuleFarJumps | platformArch platform == ArchAArch64
    
    1242
    +                                 , platformOS platform == OSLinux ]
    
    1236 1243
     
    
    1237 1244
         ++ [f | (ns,f) <- optLevelFlags, 0 `elem` ns]
    
    1238 1245
                  -- The default -O0 options
    

  • docs/users_guide/using-optimisation.rst
    ... ... @@ -732,7 +732,7 @@ as such you shouldn't need to set any of them explicitly. A flag
    732 732
         :reverse: -fno-inter-module-far-jumps
    
    733 733
         :category:
    
    734 734
     
    
    735
    -    :default: Off
    
    735
    +    :default: on if the target is AArch64-Linux, off on all others
    
    736 736
     
    
    737 737
         This flag forces GHC to use far jumps instead of near jumps for all jumps
    
    738 738
         which cross module boundries. This removes the need for jump islands/linker