IPE builds don't work with wasm backend yet
When building boot libs with IPE support with --flavour=perf+ipe
, linking would fail with:
$ /workspace/ghc/_build/stage1/bin/wasm32-wasi-ghc -package ghc hello.hs -o hello.wasm
[1 of 2] Compiling Main ( hello.hs, hello.o )
[2 of 2] Linking hello.wasm
wasm-ld: error: /workspace/ghc/_build/stage1/lib/../lib/wasm32-wasi-ghc-9.5.20221210/unix-2.8.0.0/libHSunix-2.8.0.0.a(ghc_5.o): undefined symbol: chown
wasm-ld: error: /workspace/ghc/_build/stage1/lib/../lib/wasm32-wasi-ghc-9.5.20221210/unix-2.8.0.0/libHSunix-2.8.0.0.a(ghc_5.o): undefined symbol: fchdir
wasm-ld: error: /workspace/ghc/_build/stage1/lib/../lib/wasm32-wasi-ghc-9.5.20221210/unix-2.8.0.0/libHSunix-2.8.0.0.a(ghc_5.o): undefined symbol: fchown
wasm-ld: error: /workspace/ghc/_build/stage1/lib/../lib/wasm32-wasi-ghc-9.5.20221210/unix-2.8.0.0/libHSunix-2.8.0.0.a(ghc_5.o): undefined symbol: fchmod
wasm-ld: error: /workspace/ghc/_build/stage1/lib/../lib/wasm32-wasi-ghc-9.5.20221210/time-1.12.2/libHStime-1.12.2.a(HsTime.o): undefined symbol: tzset
wasm-ld: error: /workspace/ghc/_build/stage1/lib/../lib/wasm32-wasi-ghc-9.5.20221210/base-4.17.0.0/libHSbase-4.17.0.0.a(ghc_7.o): undefined symbol: waitpid
wasm-ld: error: /workspace/ghc/_build/stage1/lib/../lib/wasm32-wasi-ghc-9.5.20221210/base-4.17.0.0/libHSbase-4.17.0.0.a(ghc_7.o): undefined symbol: umask
clang-15: error: linker command failed with exit code 1 (use -v to see invocation)
wasm32-wasi-ghc: `clang' failed in phase `Linker'. (Exit code: 1)
I haven't taken a closer look at IPE codegen logic yet to figure out why these things would be linked into the final product, maybe it's some stub code that make some otherwise unused stuff reachable. So what's broken is likely not IPE, but some conditional compilation logic missed out in base
, time
and unix
. They should be fixed, and there should be an IPE build in !9428 (closed) to avoid regression like this.