[Git][ghc/ghc][master] hadrian: remove the horrible i386 speedHack
Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC Commits: 41432d25 by Cheng Shao at 2026-01-18T10:05:13-05:00 hadrian: remove the horrible i386 speedHack When hadrian builds certain rts objects for i386, there's a horrible speedHack that forces -fno-PIC even for dynamic ways of those objects. This is not compatible with newer versions of gcc/binutils as well as clang/lld, and this patch removes it. Fixes #26792. - - - - - 1 changed file: - hadrian/src/Settings/Packages.hs Changes: ===================================== hadrian/src/Settings/Packages.hs ===================================== @@ -370,21 +370,6 @@ rtsPackageArgs = package rts ? do , inputs ["**/Evac.c", "**/Evac_thr.c"] ? arg "-funroll-loops" - , speedHack ? - inputs [ "**/Evac.c", "**/Evac_thr.c" - , "**/Scav.c", "**/Scav_thr.c" - , "**/Compact.c", "**/GC.c" ] ? arg "-fno-PIC" - -- @-static@ is necessary for these bits, as otherwise the NCG - -- generates dynamic references. - , speedHack ? - inputs [ "**/Updates.c", "**/StgMiscClosures.c" - , "**/Jumps_D.c", "**/Jumps_V16.c", "**/Jumps_V32.c", "**/Jumps_V64.c" - , "**/PrimOps.c", "**/Apply.c" - , "**/AutoApply.c" - , "**/AutoApply_V16.c" - , "**/AutoApply_V32.c" - , "**/AutoApply_V64.c" ] ? pure ["-fno-PIC", "-static"] - -- See Note [AutoApply.cmm for vectors] in genapply/Main.hs , inputs ["**/AutoApply_V32.c"] ? pure [ "-mavx2" | x86 ] , inputs ["**/AutoApply_V64.c"] ? pure [ "-mavx512f" | x86 ] @@ -452,42 +437,6 @@ rtsPackageArgs = package rts ? do , builder HsCpp ? useLibdw ? arg "-DUSE_LIBDW" ] --- Compile various performance-critical pieces *without* -fPIC -dynamic --- even when building a shared library. If we don't do this, then the --- GC runs about 50% slower on x86 due to the overheads of PIC. The --- cost of doing this is a little runtime linking and less sharing, but --- not much. --- --- On x86_64 this doesn't work, because all objects in a shared library --- must be compiled with -fPIC (since the 32-bit relocations generated --- by the default small memory can't be resolved at runtime). So we --- only do this on i386. --- --- This apparently doesn't work on OS X (Darwin) nor on Solaris. --- On Darwin we get errors of the form --- --- ld: absolute addressing (perhaps -mdynamic-no-pic) used in _stg_ap_0_fast --- from rts/dist-install/build/Apply.dyn_o not allowed in slidable image --- --- and lots of these warnings: --- --- ld: warning codegen in _stg_ap_pppv_fast (offset 0x0000005E) prevents image --- from loading in dyld shared cache --- --- On Solaris we get errors like: --- --- Text relocation remains referenced --- against symbol offset in file --- .rodata (section) 0x11 rts/dist-install/build/Apply.dyn_o --- ... --- ld: fatal: relocations remain against allocatable but non-writable sections --- collect2: ld returned 1 exit status -speedHack :: Action Bool -speedHack = do - i386 <- anyTargetArch [ArchX86] - goodOS <- not <$> anyTargetOs [OSSolaris2] - return $ i386 && goodOS - -- See @rts/ghc.mk@. rtsWarnings :: Args rtsWarnings = mconcat View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/41432d25b7a66fa36a0e3def429fd98d... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/41432d25b7a66fa36a0e3def429fd98d... You're receiving this email because of your account on gitlab.haskell.org.
participants (1)
-
Marge Bot (@marge-bot)