[Git][ghc/ghc][master] rts: Clarify rationale for undefined atomic wrappers

Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC Commits: a5e4b7d9 by Ben Gamari at 2025-08-13T21:02:18-04:00 rts: Clarify rationale for undefined atomic wrappers Since c06e3f46d24ef69f3a3d794f5f604cb8c2a40cbc the RTS has declared various atomic operation wrappers defined by ghc-internal as undefined. While the rationale for this isn't clear from the commit message, I believe that this is necessary due to the unregisterised backend. Specifically, the code generator will reference these symbols when compiling RTS Cmm sources. - - - - - 2 changed files: - rts/external-symbols.list.in - rts/rts.cabal Changes: ===================================== rts/external-symbols.list.in ===================================== @@ -54,6 +54,12 @@ ghczminternal_GHCziInternalziWord_W16zh_con_info ghczminternal_GHCziInternalziWord_W32zh_con_info ghczminternal_GHCziInternalziWord_W64zh_con_info ghczminternal_GHCziInternalziStable_StablePtr_con_info +ghczminternal_GHCziInternalziStackziCloneStack_StackSnapshot_closure + +#if 0 +N.B. These symbols are defined in ghc-internal and may be referenced by the +unregisterised code-generator when compiling RTS Cmm sources. +#endif hs_atomic_add8 hs_atomic_add16 hs_atomic_add32 @@ -94,4 +100,3 @@ hs_atomicwrite8 hs_atomicwrite16 hs_atomicwrite32 hs_atomicwrite64 -ghczminternal_GHCziInternalziStackziCloneStack_StackSnapshot_closure ===================================== rts/rts.cabal ===================================== @@ -596,8 +596,7 @@ library -- GHC already does `-undefined dynamic_lookup`, so we just do that for now, but -- we might try to get more precise with `-U` in the future. -- --- Note that the RTS also `-u`s some atomics symbols that *are* defined --- and --- defined within the RTS! It is not immediately clear why this is needed. This --- dates back to c06e3f46d24ef69f3a3d794f5f604cb8c2a40cbc which mentions a build --- failure that it was suggested that this fix, but the precise reasoning is not --- explained. +-- Note that the RTS also `-u`s some symbols for atomic operations that *are* defined +-- by `ghc-internal`. This is needed when the RTS is compiled when the RTS is +-- compiled with, e.g., the unregisterised backend since the code-generator will +-- reference these symbols when compiling atomic primops in Cmm sources. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/a5e4b7d9fa56e8357f0b26c5c1a29c11... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/a5e4b7d9fa56e8357f0b26c5c1a29c11... You're receiving this email because of your account on gitlab.haskell.org.
participants (1)
-
Marge Bot (@marge-bot)