[clang] [WebAssembly] Change the default linker for `wasm32-wasip2` (PR #84569)

Cheng Shao via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 22 11:54:27 PDT 2024


TerrorJack wrote:

@alexcrichton This is breaking `wasi-sdk` build with:

```
/workspace/wasi-sdk/build/install/opt/wasi-sdk/bin/clang --target=wasm32-wasip2 -nodefaultlibs -shared --sysroot=/workspace/wasi-sdk/build/install/opt/wasi-sdk/share/wasi-sysroot \
-o /workspace/wasi-sdk/build/install/opt/wasi-sdk/share/wasi-sysroot/lib/wasm32-wasip2/libc.so -Wl,--whole-archive build/wasm32-wasip2/libc.so.a -Wl,--no-whole-archive /workspace/wasi-sdk/build/install/opt/wasi-sdk/lib/clang/19/lib/wasi/libclang_rt.builtins-wasm32.a
error: unexpected argument '--entry' found

  tip: a similar argument exists: '--no-entry'

Usage: wasm-component-ld -o <OUTPUT> --wasm-ld-path <WASM_LD_PATH> <--export <EXPORT>|-z <Z_OPTS>|--stack-first|--allow-undefined|--fatal-warnings|--no-demangle|--gc-sections|-O <OPTIMIZE>|-L <LINK_PATH>|-l <LIBRARIES>|--no-entry|-m <TARGET_EMULATION>|--strip-all|OBJECTS>

For more information, try '--help'.
clang: error: linker command failed with exit code 2 (use -v to see invocation)
make[1]: *** [Makefile:569: /workspace/wasi-sdk/build/install/opt/wasi-sdk/share/wasi-sysroot/lib/wasm32-wasip2/libc.so] Error 2
make[1]: Leaving directory '/workspace/wasi-sdk/src/wasi-libc'
make: *** [Makefile:142: build/wasi-libc.BUILT] Error 2
```

https://github.com/llvm/llvm-project/pull/84569


More information about the cfe-commits mailing list