[Git][ghc/ghc][master] hadrian: build in-tree gmp with -fvisibility=hidden

Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC Commits: 77deaa7a by Cheng Shao at 2025-09-14T21:29:45-04:00 hadrian: build in-tree gmp with -fvisibility=hidden When hadrian builds in-tree gmp, it should build the shared objects with -fvisibility=hidden. The gmp symbols are only used by bignum logic in ghc-internal and shouldn't be exported by the ghc-internal shared library. We should always strive to keep shared library symbol table lean, which benefits platforms with slow dynamic linker or even hard limits about how many symbols can be exported (e.g. macos dyld, win32 dll and wasm dyld). - - - - - 1 changed file: - hadrian/src/Rules/Gmp.hs Changes: ===================================== hadrian/src/Rules/Gmp.hs ===================================== @@ -12,7 +12,6 @@ import Utilities import Hadrian.BuildPath import Hadrian.Expression import Settings.Builders.Common (cArgs, getStagedCCFlags) -import GHC.Platform.ArchOS -- | Build in-tree GMP library objects (if GmpInTree flag is set) and return -- their paths. @@ -128,7 +127,10 @@ gmpRules = do mconcat [ cArgs , getStagedCCFlags - , anyTargetArch [ArchWasm32] ? arg "-fvisibility=default" + -- gmp symbols are only used by bignum logic in + -- ghc-internal and shouldn't be exported by the + -- ghc-internal shared library. + , arg "-fvisibility=hidden" ] env <- sequence [ builderEnvironment "CC" $ Cc CompileC (stage ctx) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/77deaa7ad9c880410b7d0a967b037398... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/77deaa7ad9c880410b7d0a967b037398... You're receiving this email because of your account on gitlab.haskell.org.
participants (1)
-
Marge Bot (@marge-bot)