Commit 17bdcd1
committed
wasm-cross (partial): arch(wasm32) shared-triple + RtsStartup wasm call guard
Two of the fixes #181 (feat/wasm-cross-ghcup) carries but the stable-ghc-9.14 /
#188 base lacks, needed to build stage3-wasm32-unknown-wasi:
* cabal.project.stage3: replace the stale `if os(wasi) { package * shared:True }`
(which alone leaves GHC's wasm link pipeline inconsistent — fails at the
ghc-internal link with [GHC-74335]) with #181's `if arch(wasm32)` triple
(shared + executable-dynamic + rts +dynamic).
* rts/RtsStartup.c: guard the promoteBootLibrariesToGlobal() *call site* with
!defined(wasm32_HOST_ARCH) to match its definition (which is already
wasm-excluded; it uses dladdr/dlopen). Without this the wasm rts fails to
compile ("call to undeclared function 'promoteBootLibrariesToGlobal'").
NOTE: these are necessary but NOT sufficient. stage3-wasm still fails at the
ghc-internal shared-lib link ([GHC-74335] "-dynamic ignored when linking
binaries on WASM" -> mismatched interface profile tag) because the real fix is
in the GHC COMPILER, on #181 but not here:
- 4d84ace "compiler: per-target settings drive GHC Dynamic / Profiled"
(Platform/Settings/Settings.IO/Driver.Session: targetIsDynamic etc.)
- 7396909 "rts+compiler: wasm32 cross-target patches"
(esp. compiler/GHC/Linker/Dynamic.hs — the wasm dynamic-link handling)
Porting those is the #181 <-> stable-ghc-9.14 wasm integration, tracked
separately. (7396909 also rewrites compiler/Setup.hs + ghc-boot/Setup.hs,
which conflicts with the modern-pin VerbosityHandles restore here.)1 parent 4f28184 commit 17bdcd1
2 files changed
Lines changed: 28 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
4 | 24 | | |
5 | 25 | | |
6 | 26 | | |
| |||
173 | 193 | | |
174 | 194 | | |
175 | 195 | | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
| 196 | + | |
| 197 | + | |
183 | 198 | | |
184 | 199 | | |
185 | 200 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
424 | 424 | | |
425 | 425 | | |
426 | 426 | | |
427 | | - | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
428 | 433 | | |
429 | 434 | | |
430 | 435 | | |
| |||
0 commit comments