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

Commits:

2 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
    +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 ...]