diff --git a/ci/docker/wasm32-wasip1/Dockerfile b/ci/docker/wasm32-wasip1/Dockerfile index 419159a0b1380..93258ac7e4422 100644 --- a/ci/docker/wasm32-wasip1/Dockerfile +++ b/ci/docker/wasm32-wasip1/Dockerfile @@ -10,7 +10,7 @@ RUN /wasi.sh # library. ENV CARGO_TARGET_WASM32_WASIP1_RUNNER=wasmtime \ CARGO_TARGET_WASM32_WASIP1_LINKER=/opt/wasi-sdk/bin/clang \ - CARGO_TARGET_WASM32_WASIP1_RUSTFLAGS="-lwasi-emulated-process-clocks -Ctarget-feature=-crt-static" \ + CARGO_TARGET_WASM32_WASIP1_RUSTFLAGS="-Clink-self-contained=n -lwasi-emulated-process-clocks" \ CC_wasm32_wasip1=/opt/wasi-sdk/bin/clang \ CFLAGS_wasm32_wasip1=-D_WASI_EMULATED_PROCESS_CLOCKS \ PATH=$PATH:/rust/bin:/wasmtime diff --git a/ci/docker/wasm32-wasip2/Dockerfile b/ci/docker/wasm32-wasip2/Dockerfile index 8d819b36e5c15..a8da1e212333e 100644 --- a/ci/docker/wasm32-wasip2/Dockerfile +++ b/ci/docker/wasm32-wasip2/Dockerfile @@ -9,7 +9,7 @@ RUN /wasi.sh # itself, this should be fixed upstream. ENV CARGO_TARGET_WASM32_WASIP2_RUNNER=wasmtime \ CARGO_TARGET_WASM32_WASIP2_LINKER=/opt/wasi-sdk/bin/clang \ - CARGO_TARGET_WASM32_WASIP2_RUSTFLAGS="-lwasi-emulated-process-clocks -Ctarget-feature=-crt-static -Clink-arg=-Wl,--export,cabi_realloc" \ + CARGO_TARGET_WASM32_WASIP2_RUSTFLAGS="-Clink-self-contained=n -lwasi-emulated-process-clocks -Clink-arg=-Wl,--export,cabi_realloc" \ CC_wasm32_wasip2=/opt/wasi-sdk/bin/clang \ CFLAGS_wasm32_wasip2=-D_WASI_EMULATED_PROCESS_CLOCKS \ PATH=$PATH:/rust/bin:/wasmtime diff --git a/ci/wasi.sh b/ci/wasi.sh index f0d8a5245c99b..2648aa38207d7 100755 --- a/ci/wasi.sh +++ b/ci/wasi.sh @@ -12,7 +12,7 @@ apt-get install -y --no-install-recommends \ # Wasmtime is used to execute tests and wasi-sdk is used to compile tests. # Download appropriate versions here and configure various flags below. wasmtime=38.0.2 -wasi_sdk=27 +wasi_sdk=29 curl -L https://github.com/bytecodealliance/wasmtime/releases/download/v$wasmtime/wasmtime-v$wasmtime-x86_64-linux.tar.xz | tar xJf - diff --git a/src/wasi/mod.rs b/src/wasi/mod.rs index 7891322991ed8..ec6830594e098 100644 --- a/src/wasi/mod.rs +++ b/src/wasi/mod.rs @@ -793,6 +793,7 @@ extern "C" { timeout: *const timeval, ) -> c_int; + #[cfg(target_env = "p1")] pub fn __wasilibc_register_preopened_fd(fd: c_int, path: *const c_char) -> c_int; pub fn __wasilibc_fd_renumber(fd: c_int, newfd: c_int) -> c_int; pub fn __wasilibc_unlinkat(fd: c_int, path: *const c_char) -> c_int;