-
Notifications
You must be signed in to change notification settings - Fork 14k
Closed as not planned
Closed as not planned
Copy link
Labels
C-bugCategory: This is a bug.Category: This is a bug.I-prioritizeIssue: Indicates that prioritization has been requested for this issue.Issue: Indicates that prioritization has been requested for this issue.O-wasiOperating system: Wasi, Webassembly System InterfaceOperating system: Wasi, Webassembly System InterfaceT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.Performance or correctness regression from stable to nightly.
Description
We are hitting some issues linking for wasi in libc:
Compiling libc-test v0.1.0 (/checkout/libc-test)
error: linking with `/opt/wasi-sdk/bin/clang` failed: exit status: 1
|
= note: "/opt/wasi-sdk/bin/clang" "-Wl,-z" "-Wl,stack-size=1048576" "-Wl,--stack-first" "-Wl,--allow-undefined" "-Wl,--no-demangle" "<sysroot>/lib<sysroot>lib/wasm32-wasip2/lib/self-contained/crt1-command.o" "<56 object files omitted>" "-lwasi-emulated-process-clocks" "-lctest_output" "<sysroot>/lib/rustlib/wasm32-wasip2/lib/libpanic_abort-*.rlib" "/checkout/target/wasm32-wasip2/debug/deps/liblibc-79541f93bd41d988.rlib" "<sysroot>/lib/rustlib/wasm32-wasip2/lib/{libstd-*,libwasi-*,libwasi-*,libwit_bindgen-*,libcfg_if-*,librustc_demangle-*,libstd_detect-*,libhashbrown-*,librustc_std_workspace_alloc-*,libminiz_oxide-*,libadler2-*,libunwind-*,liblibc-*,librustc_std_workspace_core-*,liballoc-*,libcore-*,libcompiler_builtins-*}.rlib" "-lwasi-emulated-process-clocks" "-lc" "-B<sysroot>/lib<sysroot>lib/x86_64-unknown-linux-gnu/bin/gcc-ld" "--target=wasm32-wasip2" "-nostartfiles" "-L" "/checkout/target/wasm32-wasip2/debug/build/libc-test-d3c05669973fd0d1/out" "-L" "<sysroot>/lib<sysroot>lib/wasm32-wasip2/lib/self-contained" "-o" "/checkout/target/wasm32-wasip2/debug/deps/ctest-ca9d81752a7cde6e.wasm" "-Wl,--gc-sections" "-nodefaultlibs" "-Wl,--export,cabi_realloc"
= note: some arguments are omitted. use `--verbose` to show all linker arguments
= note: error: failed to encode component
Caused by:
0: failed to decode world from module
1: module was not valid
2: failed to resolve import `env::__wasilibc_register_preopened_fd`
3: module requires an import interface named `env`
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Sample run: https://github.com/rust-lang/libc/actions/runs/19523054373/job/55890315381?pr=4835
This is with rustc 1.93.0-nightly (07bdbae 2025-11-19) and started right around the time that nightly was released, so I assume it is a recent regression. wasm32-wasip1 seems unaffected.
We set some linker args https://github.com/rust-lang/libc/blob/c4dcfd23f00ec3fe6b7a2a67416084c174222754/ci/docker/wasm32-wasip2/Dockerfile but things still fail without --export,cabi_realloc https://github.com/rust-lang/libc/actions/runs/19523413576/job/55891164987?pr=4835. I haven't had a chance to dig much more.
Metadata
Metadata
Assignees
Labels
C-bugCategory: This is a bug.Category: This is a bug.I-prioritizeIssue: Indicates that prioritization has been requested for this issue.Issue: Indicates that prioritization has been requested for this issue.O-wasiOperating system: Wasi, Webassembly System InterfaceOperating system: Wasi, Webassembly System InterfaceT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.Performance or correctness regression from stable to nightly.