diff --git a/ci/emscripten-entry.sh b/ci/emscripten-entry.sh index 80b091903b1fc..de6f2cb16adbc 100755 --- a/ci/emscripten-entry.sh +++ b/ci/emscripten-entry.sh @@ -7,6 +7,6 @@ source /emsdk-portable/emsdk_env.sh &> /dev/null # emsdk-portable provides a node binary, but we need version 8 to run wasm # NOTE: Do not forget to sync Node.js version with `emscripten.sh`! -export PATH="/node-v14.17.0-linux-x64/bin:$PATH" +export PATH="/node-v18.0.0-linux-x64/bin:$PATH" exec "$@" diff --git a/ci/emscripten.sh b/ci/emscripten.sh index c16e793bb4e1f..730ce6ed0bcd1 100644 --- a/ci/emscripten.sh +++ b/ci/emscripten.sh @@ -2,7 +2,7 @@ set -ex -EMSDK_VERSION=1.39.20 +EMSDK_VERSION=3.1.9 hide_output() { set +x @@ -39,5 +39,5 @@ chmod a+rxw -R /emsdk-portable # node 8 is required to run wasm # NOTE: Do not forget to sync Node.js version with `emscripten-entry.sh`! cd / -curl --retry 5 -L https://nodejs.org/dist/v14.17.0/node-v14.17.0-linux-x64.tar.xz | \ +curl --retry 5 -L https://nodejs.org/dist/v18.0.0/node-v18.0.0-linux-x64.tar.xz | \ tar -xJ diff --git a/ci/run.sh b/ci/run.sh index 3ef84d42ac0dc..303a4afacea0a 100755 --- a/ci/run.sh +++ b/ci/run.sh @@ -109,6 +109,13 @@ if [ "$TARGET" = "s390x-unknown-linux-gnu" ]; then sleep 1 done else + if [ "$TARGET" = "asmjs-unknown-emscripten" ]; then + # Rust uses -g4 by default what causes link issues. + # This should disable the -g4 option. + export RUSTFLAGS="-Cdebuginfo=0" + export EMCC_FLAGS="-s USE_PTHREADS=1 --shared-memory" + export EMCC_CFLAGS="-s USE_PTHREADS=1 --shared-memory" + fi cargo test --no-default-features --manifest-path libc-test/Cargo.toml \ --target "${TARGET}" ${LIBC_CI_ZBUILD_STD+"-Zbuild-std"} diff --git a/libc-test/build.rs b/libc-test/build.rs index 9609cc55711b3..350c9e79cd8b9 100644 --- a/libc-test/build.rs +++ b/libc-test/build.rs @@ -2406,7 +2406,6 @@ fn test_emscripten(target: &str) { "sys/reboot.h", "sys/resource.h", "sys/sem.h", - "sys/sendfile.h", "sys/shm.h", "sys/signalfd.h", "sys/socket.h", diff --git a/src/unix/linux_like/emscripten/mod.rs b/src/unix/linux_like/emscripten/mod.rs index 11fbb31c3830d..06ac15859e725 100644 --- a/src/unix/linux_like/emscripten/mod.rs +++ b/src/unix/linux_like/emscripten/mod.rs @@ -1883,6 +1883,16 @@ extern "C" { f: extern "C" fn(*mut ::c_void) -> *mut ::c_void, value: *mut ::c_void, ) -> ::c_int; + pub fn pthread_setschedparam( + native: ::pthread_t, + policy: ::c_int, + param: *const ::sched_param, + ) -> ::c_int; + pub fn pthread_getschedparam( + native: ::pthread_t, + policy: *mut ::c_int, + param: *mut ::sched_param, + ) -> ::c_int; } cfg_if! { diff --git a/src/unix/linux_like/mod.rs b/src/unix/linux_like/mod.rs index 57600f24b8f12..00e6186e72648 100644 --- a/src/unix/linux_like/mod.rs +++ b/src/unix/linux_like/mod.rs @@ -108,13 +108,13 @@ s! { pub struct sched_param { pub sched_priority: ::c_int, - #[cfg(any(target_env = "musl", target_os = "emscripten"))] + #[cfg(target_env = "musl")] pub sched_ss_low_priority: ::c_int, - #[cfg(any(target_env = "musl", target_os = "emscripten"))] + #[cfg(target_env = "musl")] pub sched_ss_repl_period: ::timespec, - #[cfg(any(target_env = "musl", target_os = "emscripten"))] + #[cfg(target_env = "musl")] pub sched_ss_init_budget: ::timespec, - #[cfg(any(target_env = "musl", target_os = "emscripten"))] + #[cfg(target_env = "musl")] pub sched_ss_max_repl: ::c_int, }