Rodrigo Mesquita pushed to branch wip/T26166 at Glasgow Haskell Compiler / GHC
Commits:
847404cf by Ben Gamari at 2025-10-13T16:37:54+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
- - - - -
3 changed files:
- libraries/ghc-internal/include/RtsIfaceSymbols.h
- rts/include/Stg.h
- rts/include/rts/RtsToHsIface.h
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
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/847404cfcfaa2e866f6b9ce97c83035b...
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/847404cfcfaa2e866f6b9ce97c83035b...
You're receiving this email because of your account on gitlab.haskell.org.