Skip to content

WASM backend doesn't work #134

Description

@hasufell

Reproduce:

  1. git clone https://github.com/stable-haskell/ghc.git && git submodule update --init
  2. git checkout stable-ghc-9.14
  3. apply this patch: https://gist.github.com/hasufell/93cb545d57ba1ea00f0fec151c08c5a1
  4. make CABAL=_build/stage0/bin/cabal stage2
  5. install wasm-meta as described here: https://www.haskell.org/ghcup/guide/#ghc-wasm-cross-bindists-experimental but don't perform the last step: source ~/.ghc-wasm/env!
  6. edit ~/.ghc-wasm/env to only include the PATH changes and source it
  7. make CABAL=_build/stage0/bin/cabal stage3-wasm32-unknown-wasi

Result should be something like:

Building library 'nonthreaded-nodebug' for rts-1.0.3...
wasm-ld: error: symbol type mismatch: stg_ap_pv_info
>>> defined as WASM_SYMBOL_TYPE_DATA in /home/hasufell/git/ghc/_build/stage3/wasm32-unknown-wasi/build/host/wasm32-wasi/ghc-9.14/rts-1.0.3-nonthreaded-nodebug/build/nonthreaded-nodebug/RaiseAsync.dyn_o
>>> defined as WASM_SYMBOL_TYPE_FUNCTION in /home/hasufell/git/ghc/_build/stage3/wasm32-unknown-wasi/build/host/wasm32-wasi/ghc-9.14/rts-1.0.3-nonthreaded-nodebug/build/nonthreaded-nodebug/Exception.dyn_o

wasm-ld: error: symbol type mismatch: stg_BLACKHOLE_info
>>> defined as WASM_SYMBOL_TYPE_DATA in /home/hasufell/git/ghc/_build/stage3/wasm32-unknown-wasi/build/host/wasm32-wasi/ghc-9.14/rts-1.0.3-nonthreaded-nodebug/build/nonthreaded-nodebug/Messages.dyn_o
>>> defined as WASM_SYMBOL_TYPE_FUNCTION in /home/hasufell/git/ghc/_build/stage3/wasm32-unknown-wasi/build/host/wasm32-wasi/ghc-9.14/rts-1.0.3-nonthreaded-nodebug/build/nonthreaded-nodebug/StgMiscClosures.dyn_o

wasm-ld: error: symbol type mismatch: stg_marked_upd_frame_info
>>> defined as WASM_SYMBOL_TYPE_DATA in /home/hasufell/git/ghc/_build/stage3/wasm32-unknown-wasi/build/host/wasm32-wasi/ghc-9.14/rts-1.0.3-nonthreaded-nodebug/build/nonthreaded-nodebug/ThreadPaused.dyn_o
>>> defined as WASM_SYMBOL_TYPE_FUNCTION in /home/hasufell/git/ghc/_build/stage3/wasm32-unknown-wasi/build/host/wasm32-wasi/ghc-9.14/rts-1.0.3-nonthreaded-nodebug/build/nonthreaded-nodebug/Updates.dyn_o
wasm32-wasi-clang: error: linker command failed with exit code 1 (use -v to see invocation)
`wasm32-wasi-clang' failed in phase `Linker'. (Exit code: 1)

Motivation: test the https://gitlab.haskell.org/ghc/ghc/-/commit/867c26755e8855c6df949e65df0c2aebc9da64c3 change and whether that resolves the recursive loading issues.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions