[Git][ghc/ghc][wip/T26166] rts: Avoid static symbol references to ghc-internal
Rodrigo Mesquita pushed to branch wip/T26166 at Glasgow Haskell Compiler / GHC Commits: fa15c2a3 by Ben Gamari at 2025-10-13T16:46:14+01:00 rts: Avoid static symbol references to ghc-internal This resolves #26166, a bug due to new constraints placed by Apple's linker on undefined references. One source of such references in the RTS is the many symbols referenced in ghc-internal. To mitigate #26166, we make these references dynamic, as described in Note [RTS/ghc-internal interface]. Fixes #26166 Co-authored-by: Rodrigo Mesquita <rodrigo.m.mesquita@gmail.com> - - - - - 4 changed files: - libraries/ghc-internal/include/RtsIfaceSymbols.h - rts/include/Stg.h - rts/include/rts/RtsToHsIface.h - rts/win32/libHSghc-internal.def Changes: ===================================== libraries/ghc-internal/include/RtsIfaceSymbols.h ===================================== @@ -23,7 +23,11 @@ CLOSURE(GHCziInternalziIOziException, cannotCompactMutable_closure) CLOSURE(GHCziInternalziControlziExceptionziBase, nonTermination_closure) CLOSURE(GHCziInternalziControlziExceptionziBase, nestedAtomically_closure) CLOSURE(GHCziInternalziControlziExceptionziBase, noMatchingContinuationPrompt_closure) +#if defined(mingw32_HOST_OS) +UNDEF_CLOSURE(GHCziInternalziEventziThread, blockedOnBadFD_closure) +#else CLOSURE(GHCziInternalziEventziThread, blockedOnBadFD_closure) +#endif CLOSURE(GHCziInternalziConcziSync, runSparks_closure) CLOSURE(GHCziInternalziConcziIO, ensureIOManagerIsRunning_closure) CLOSURE(GHCziInternalziConcziIO, interruptIOManager_closure) ===================================== rts/include/Stg.h ===================================== @@ -343,9 +343,12 @@ external prototype return neither of these types to workaround #11395. * StgInfoTable, StgClosure and so on. */ #include "stg/MiscClosures.h" +/* And this is included for references to ghc_hs_iface */ +#include "rts/Types.h" +#include "rts/RtsToHsIface.h" #endif -#include "stg/Prim.h" /* ghc-internal fallbacks */ +#include "stg/Prim.h" #include "stg/SMP.h" /* ----------------------------------------------------------------------------- ===================================== rts/include/rts/RtsToHsIface.h ===================================== @@ -6,6 +6,8 @@ * See Note [RTS/ghc-internal interface]. */ +#pragma once + typedef struct { StgClosure *processRemoteCompletion_closure; // GHC.Internal.Event.Windows.processRemoteCompletion_closure StgClosure *runIO_closure; // GHC.Internal.TopHandler.runIO_closure ===================================== rts/win32/libHSghc-internal.def ===================================== @@ -44,7 +44,6 @@ EXPORTS ghczminternal_GHCziInternalziIOziException_cannotCompactMutable_closure ghczminternal_GHCziInternalziControlziExceptionziBase_nonTermination_closure ghczminternal_GHCziInternalziControlziExceptionziBase_nestedAtomically_closure - ghczminternal_GHCziInternalziEventziThread_blockedOnBadFD_closure ghczminternal_GHCziInternalziExceptionziType_divZZeroException_closure ghczminternal_GHCziInternalziExceptionziType_underflowException_closure ghczminternal_GHCziInternalziExceptionziType_overflowException_closure View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/fa15c2a3648a51a2b40c689d1dcd9c1c... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/fa15c2a3648a51a2b40c689d1dcd9c1c... You're receiving this email because of your account on gitlab.haskell.org.
participants (1)
-
Rodrigo Mesquita (@alt-romes)