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
    
    3
    +issues: #26994
    
    4
    +mrs: !16016
    
    5
    +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
    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
    +    ++ [ Opt_InterModuleFarJumps | platformArch platform == ArchAArch64 ]
    
    1236 1241
     
    
    1237 1242
         ++ [f | (ns,f) <- optLevelFlags, 0 `elem` ns]
    
    1238 1243
                  -- The default -O0 options
    
    ... ... @@ -1245,6 +1250,7 @@ defaultFlags settings
    1245 1250
         ++ validHoleFitDefaults
    
    1246 1251
     
    
    1247 1252
         where platform = sTargetPlatform settings
    
    1253
    +          defaultWays = ways $ defaultDynFlags settings
    
    1248 1254
     
    
    1249 1255
     -- | These are the default settings for the display and sorting of valid hole
    
    1250 1256
     --  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
    732 732
         :reverse: -fno-inter-module-far-jumps
    
    733 733
         :category:
    
    734 734
     
    
    735
    -    :default: Off
    
    735
    +    :default: on if the target platform is AArch64, 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