Andreas Klebinger pushed to branch wip/andreask/9.10.4-batch1 at Glasgow Haskell Compiler / GHC
Commits:
580bc78d by Ben Gamari at 2026-05-25T16:17:47+02:00
rts: Dynamically initialize built-in closures
To resolve #26166 we need to eliminate references to undefined symbols
in the runtime system. One such source of these is the runtime's
static references to `I#` and `C#` due the `stg_INTLIKE` and
`stg_CHARLIKE` arrays.
To avoid this we make these dynamic, initializing them during RTS
start-up.
(cherry picked from commit 39eaaaba5356e3fc9218d8e27375d6de24778cbc)
- - - - -
d9e27e4d by Rodrigo Mesquita at 2026-05-25T16:17:54+02:00
Move code-gen aux symbols from ghc-internal to rts
These symbols were all previously defined in ghc-internal and made the
dependency structure awkward, where the rts may refer to some of these
symbols and had to work around that circular dependency the way
described in #26166.
Moreover, the code generator will produce code that uses these symbols!
Therefore, they should be available in the rts:
PRINCIPLE: If the code generator may produce code which uses this
symbol, then it should be defined in the rts rather than, say,
ghc-internal.
That said, the main motivation is towards fixing #26166.
Towards #26166. Pre-requisite of !14892
(cherry picked from commit ba3e5bddb222008591edb6c3d433d93084170571)
(cherry picked from commit f687ce93a4ef71aebac5d5eb891e72a090092ec0)
- - - - -
a703db4f by Ben Gamari at 2026-05-25T16:17:54+02: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
Co-authored-by: Cheng Shao
(cherry picked from commit f31de2a9c2405d6645998460e4b501f9279606b3)
- - - - -
aaa71bb7 by Ben Gamari at 2026-05-25T16:17:54+02:00
compiler: Rename isMathFun -> isLibcFun
This set includes more than just math functions.
(cherry picked from commit 43fdfddc25c36ef4811941231d5755bad065796d)
(cherry picked from commit 99291e88f0498f11317e0f45c4968583c8c6ef0f)
- - - - -
b73a40a2 by Ben Gamari at 2026-05-25T16:17:54+02:00
compiler: Add libc allocator functions to libc_funs
Prototypes for these are now visible from `Prim.h`, resulting in
multiple-declaration warnings in the unregisterised job.
(cherry picked from commit 4ed5138f7af532731f88380f98103487a9f15c5a)
(cherry picked from commit d5d081e38f6abf445ad50b355585d2edddfc8173)
- - - - -
6556933a by Ben Gamari at 2026-05-25T16:17:55+02:00
rts: Minimize header dependencies of Prim.h
Otherwise we will end up with redundant and incompatible declarations
resulting in warnings during the unregisterised build.
(cherry picked from commit 9a0a076b80d6fb68d7722d2bb72c17c90ba22cd1)
(cherry picked from commit ef442bd152400dc550fba2ba5fd90fb0f5454614)
- - - - -
695dc2f5 by sheaf at 2026-05-25T16:17:55+02:00
Use x86_64-unknown-windows-gnu target for LLVM on Windows
(cherry picked from commit 21aaa34b703a77f68d3f94e0e9e39ea25499faa2)
- - - - -
47464fdf by sheaf at 2026-05-25T16:17:55+02:00
LLVM: use -relocation-model=pic on Windows
This is necessary to avoid the segfaults reported in #22487.
Fixes #22487
(cherry picked from commit 992a7624817cdab4b566387f2e877f420f7b27d4)
- - - - -
62 changed files:
- compiler/GHC/Cmm/CLabel.hs
- compiler/GHC/CmmToAsm/Wasm/FromCmm.hs
- compiler/GHC/CmmToC.hs
- compiler/GHC/Driver/Pipeline/Execute.hs
- compiler/GHC/HsToCore/Foreign/C.hs
- compiler/GHC/Linker/Dynamic.hs
- compiler/GHC/Linker/Static.hs
- hadrian/src/Settings/Packages.hs
- + libraries/ghc-internal/cbits/RtsIface.c
- libraries/ghc-internal/ghc-internal.cabal.in
- + libraries/ghc-internal/include/RtsIfaceSymbols.h
- libraries/ghc-prim/ghc-prim.cabal
- llvm-targets
- m4/ghc_llvm_target.m4
- + rts/BuiltinClosures.c
- + rts/BuiltinClosures.h
- rts/CloneStack.h
- rts/Compact.cmm
- rts/ContinuationOps.cmm
- rts/Exception.cmm
- rts/Prelude.h
- rts/PrimOps.cmm
- rts/RtsAPI.c
- rts/RtsStartup.c
- rts/RtsSymbols.c
- + rts/RtsToHsIface.c
- rts/StgMiscClosures.cmm
- rts/StgStdThunks.cmm
- rts/configure.ac
- − rts/external-symbols.list.in
- rts/include/Rts.h
- rts/include/RtsAPI.h
- rts/include/Stg.h
- rts/include/rts/Constants.h
- + rts/include/rts/RtsToHsIface.h
- rts/include/rts/Types.h
- rts/include/stg/MiscClosures.h
- rts/include/stg/Prim.h
- rts/posix/Signals.c
- libraries/ghc-prim/cbits/atomic.c → rts/prim/atomic.c
- libraries/ghc-prim/cbits/bitrev.c → rts/prim/bitrev.c
- libraries/ghc-prim/cbits/bswap.c → rts/prim/bswap.c
- libraries/ghc-prim/cbits/clz.c → rts/prim/clz.c
- libraries/ghc-prim/cbits/ctz.c → rts/prim/ctz.c
- + rts/prim/int64x2minmax.c
- libraries/ghc-prim/cbits/longlong.c → rts/prim/longlong.c
- libraries/ghc-prim/cbits/mulIntMayOflo.c → rts/prim/mulIntMayOflo.c
- libraries/ghc-prim/cbits/pdep.c → rts/prim/pdep.c
- libraries/ghc-prim/cbits/pext.c → rts/prim/pext.c
- libraries/ghc-prim/cbits/popcnt.c → rts/prim/popcnt.c
- + rts/prim/vectorQuotRem.c
- libraries/ghc-prim/cbits/word2float.c → rts/prim/word2float.c
- − rts/rts.buildinfo.in
- rts/rts.cabal
- rts/wasm/JSFFI.c
- rts/wasm/scheduler.cmm
- rts/win32/libHSghc-internal.def
- + testsuite/tests/llvm/should_run/T22487.hs
- + testsuite/tests/llvm/should_run/T22487.stdout
- testsuite/tests/llvm/should_run/all.T
- utils/deriveConstants/Main.hs
- utils/llvm-targets/gen-data-layout.sh
The diff was not included because it is too large.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/871e635e359c8840f40d27e9e0d5f0f...
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/871e635e359c8840f40d27e9e0d5f0f...
You're receiving this email because of your account on gitlab.haskell.org.