From 92dff871b4a1b20b5863b02b0c2f1b2c3a2b7ee4 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 19 Aug 2019 16:36:26 +0000 Subject: [PATCH 1/3] Bump serde from 1.0.98 to 1.0.99 Bumps [serde](https://github.com/serde-rs/serde) from 1.0.98 to 1.0.99. - [Release notes](https://github.com/serde-rs/serde/releases) - [Commits](https://github.com/serde-rs/serde/compare/v1.0.98...v1.0.99) Signed-off-by: dependabot-preview[bot] --- Cargo.lock | 34 +++++++++++++++++----------------- lib/clif-backend/Cargo.toml | 2 +- lib/runtime-core/Cargo.toml | 2 +- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 086fe7c18e9..a10bab7d067 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -77,7 +77,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "autocfg 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.98 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -152,7 +152,7 @@ name = "cargo_toml" version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "serde 1.0.98 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.98 (registry+https://github.com/rust-lang/crates.io-index)", "toml 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -171,7 +171,7 @@ dependencies = [ "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.98 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.39 (registry+https://github.com/rust-lang/crates.io-index)", "syn 0.15.34 (registry+https://github.com/rust-lang/crates.io-index)", "tempfile 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -324,7 +324,7 @@ dependencies = [ "rand_xoshiro 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "rayon 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "rayon-core 1.5.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.98 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.98 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.39 (registry+https://github.com/rust-lang/crates.io-index)", "tinytemplate 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -388,7 +388,7 @@ dependencies = [ "csv-core 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", "ryu 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.98 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -590,7 +590,7 @@ name = "indexmap" version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "serde 1.0.98 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1097,7 +1097,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "serde" -version = "1.0.98" +version = "1.0.99" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "serde_derive 1.0.98 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1109,7 +1109,7 @@ version = "0.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.98 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1117,7 +1117,7 @@ name = "serde_bytes" version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "serde 1.0.98 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1137,7 +1137,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", "ryu 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.98 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1297,7 +1297,7 @@ name = "tinytemplate" version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "serde 1.0.98 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.39 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1306,7 +1306,7 @@ name = "toml" version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "serde 1.0.98 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1314,7 +1314,7 @@ name = "toml" version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "serde 1.0.98 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1362,7 +1362,7 @@ name = "wabt" version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "serde 1.0.98 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.98 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.39 (registry+https://github.com/rust-lang/crates.io-index)", "wabt-sys 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1423,7 +1423,7 @@ dependencies = [ "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", "nix 0.14.1 (registry+https://github.com/rust-lang/crates.io-index)", "rayon 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.98 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)", "serde-bench 0.0.7 (registry+https://github.com/rust-lang/crates.io-index)", "serde_bytes 0.11.1 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.98 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1578,7 +1578,7 @@ dependencies = [ "page_size 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.98 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)", "serde-bench 0.0.7 (registry+https://github.com/rust-lang/crates.io-index)", "serde_bytes 0.11.1 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.98 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1854,7 +1854,7 @@ dependencies = [ "checksum scroll_derive 0.9.5 (registry+https://github.com/rust-lang/crates.io-index)" = "8f1aa96c45e7f5a91cb7fabe7b279f02fea7126239fc40b732316e8b6a2d0fcb" "checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" "checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" -"checksum serde 1.0.98 (registry+https://github.com/rust-lang/crates.io-index)" = "7fe5626ac617da2f2d9c48af5515a21d5a480dbd151e01bb1c355e26a3e68113" +"checksum serde 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)" = "fec2851eb56d010dc9a21b89ca53ee75e6528bab60c11e89d38390904982da9f" "checksum serde-bench 0.0.7 (registry+https://github.com/rust-lang/crates.io-index)" = "d733da87e79faaac25616e33d26299a41143fd4cd42746cbb0e91d8feea243fd" "checksum serde_bytes 0.11.1 (registry+https://github.com/rust-lang/crates.io-index)" = "aaff47db6ef8771cca5d88febef2f22f47f645420e51226374049f68c6b08569" "checksum serde_derive 1.0.98 (registry+https://github.com/rust-lang/crates.io-index)" = "01e69e1b8a631f245467ee275b8c757b818653c6d704cdbcaeb56b56767b529c" diff --git a/lib/clif-backend/Cargo.toml b/lib/clif-backend/Cargo.toml index c30591f477d..f9ebb684943 100644 --- a/lib/clif-backend/Cargo.toml +++ b/lib/clif-backend/Cargo.toml @@ -24,7 +24,7 @@ rayon = "1.1.0" # Dependencies for caching. [dependencies.serde] -version = "1.0.98" +version = "1.0.99" features = ["rc"] [dependencies.serde_derive] version = "1.0.98" diff --git a/lib/runtime-core/Cargo.toml b/lib/runtime-core/Cargo.toml index 9c994cf1247..c0d491e7f82 100644 --- a/lib/runtime-core/Cargo.toml +++ b/lib/runtime-core/Cargo.toml @@ -26,7 +26,7 @@ features = ["serde-1"] # Dependencies for caching. [dependencies.serde] -version = "1.0.98" +version = "1.0.99" # This feature is required for serde to support serializing/deserializing reference counted pointers (e.g. Rc and Arc). features = ["rc"] [dependencies.serde_derive] From d6fce6cf675aa98354d93d1e1ffbebf854cc63b5 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 19 Aug 2019 16:36:27 +0000 Subject: [PATCH 2/3] Bump serde_bytes from 0.11.1 to 0.11.2 Bumps [serde_bytes](https://github.com/serde-rs/bytes) from 0.11.1 to 0.11.2. - [Release notes](https://github.com/serde-rs/bytes/releases) - [Commits](https://github.com/serde-rs/bytes/compare/0.11.1...0.11.2) Signed-off-by: dependabot-preview[bot] --- Cargo.lock | 8 ++++---- lib/clif-backend/Cargo.toml | 2 +- lib/runtime-core/Cargo.toml | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 086fe7c18e9..30bf34fd8b2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1114,7 +1114,7 @@ dependencies = [ [[package]] name = "serde_bytes" -version = "0.11.1" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "serde 1.0.98 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1425,7 +1425,7 @@ dependencies = [ "rayon 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.98 (registry+https://github.com/rust-lang/crates.io-index)", "serde-bench 0.0.7 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_bytes 0.11.1 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_bytes 0.11.2 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.98 (registry+https://github.com/rust-lang/crates.io-index)", "target-lexicon 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "wasmer-clif-fork-frontend 0.33.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1580,7 +1580,7 @@ dependencies = [ "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.98 (registry+https://github.com/rust-lang/crates.io-index)", "serde-bench 0.0.7 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_bytes 0.11.1 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_bytes 0.11.2 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.98 (registry+https://github.com/rust-lang/crates.io-index)", "smallvec 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)", "wasmparser 0.35.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1856,7 +1856,7 @@ dependencies = [ "checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" "checksum serde 1.0.98 (registry+https://github.com/rust-lang/crates.io-index)" = "7fe5626ac617da2f2d9c48af5515a21d5a480dbd151e01bb1c355e26a3e68113" "checksum serde-bench 0.0.7 (registry+https://github.com/rust-lang/crates.io-index)" = "d733da87e79faaac25616e33d26299a41143fd4cd42746cbb0e91d8feea243fd" -"checksum serde_bytes 0.11.1 (registry+https://github.com/rust-lang/crates.io-index)" = "aaff47db6ef8771cca5d88febef2f22f47f645420e51226374049f68c6b08569" +"checksum serde_bytes 0.11.2 (registry+https://github.com/rust-lang/crates.io-index)" = "45af0182ff64abaeea290235eb67da3825a576c5d53e642c4d5b652e12e6effc" "checksum serde_derive 1.0.98 (registry+https://github.com/rust-lang/crates.io-index)" = "01e69e1b8a631f245467ee275b8c757b818653c6d704cdbcaeb56b56767b529c" "checksum serde_json 1.0.39 (registry+https://github.com/rust-lang/crates.io-index)" = "5a23aa71d4a4d43fdbfaac00eff68ba8a06a51759a89ac3304323e800c4dd40d" "checksum shlex 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7fdf1b9db47230893d76faad238fd6097fd6d6a9245cd7a4d90dbd639536bbd2" diff --git a/lib/clif-backend/Cargo.toml b/lib/clif-backend/Cargo.toml index c30591f477d..556c6f8d7ac 100644 --- a/lib/clif-backend/Cargo.toml +++ b/lib/clif-backend/Cargo.toml @@ -29,7 +29,7 @@ features = ["rc"] [dependencies.serde_derive] version = "1.0.98" [dependencies.serde_bytes] -version = "0.11.1" +version = "0.11.2" [dependencies.serde-bench] version = "0.0.7" diff --git a/lib/runtime-core/Cargo.toml b/lib/runtime-core/Cargo.toml index 9c994cf1247..cb5187ad243 100644 --- a/lib/runtime-core/Cargo.toml +++ b/lib/runtime-core/Cargo.toml @@ -32,7 +32,7 @@ features = ["rc"] [dependencies.serde_derive] version = "1.0.98" [dependencies.serde_bytes] -version = "0.11.1" +version = "0.11.2" [dependencies.serde-bench] version = "0.0.7" [dependencies.blake2b_simd] From 3f0dae33293293c6e0e6ceec9bf3e0abf486c4c7 Mon Sep 17 00:00:00 2001 From: losfair Date: Tue, 20 Aug 2019 16:17:43 -0700 Subject: [PATCH 3/3] Fix compilation on AArch64 Linux. --- lib/clif-backend/src/libcalls.rs | 9 ++++----- lib/clif-backend/src/signal/unix.rs | 9 +++++++++ lib/emscripten/src/env/unix/mod.rs | 4 ++-- lib/emscripten/src/exec.rs | 2 +- lib/emscripten/src/io/unix.rs | 2 +- lib/emscripten/src/libc.rs | 2 +- lib/emscripten/src/syscalls/mod.rs | 12 ++++++------ lib/emscripten/src/syscalls/unix.rs | 20 ++++++++++---------- lib/emscripten/src/utils.rs | 3 ++- 9 files changed, 36 insertions(+), 27 deletions(-) diff --git a/lib/clif-backend/src/libcalls.rs b/lib/clif-backend/src/libcalls.rs index d7fe5ab5a25..d03e9e899a6 100644 --- a/lib/clif-backend/src/libcalls.rs +++ b/lib/clif-backend/src/libcalls.rs @@ -76,8 +76,7 @@ pub extern "C" fn nearbyintf64(x: f64) -> f64 { } } -/// A declaration for the stack probe function in Rust's standard library, for -/// catching callstack overflow. -extern "C" { - pub fn __rust_probestack(); -} +// FIXME: Is there a replacement on AArch64? +#[cfg(all(target_os = "linux", target_arch = "aarch64"))] +#[no_mangle] +pub extern "C" fn __rust_probestack() {} diff --git a/lib/clif-backend/src/signal/unix.rs b/lib/clif-backend/src/signal/unix.rs index 2f12713fa6a..39f3aa893c6 100644 --- a/lib/clif-backend/src/signal/unix.rs +++ b/lib/clif-backend/src/signal/unix.rs @@ -138,6 +138,14 @@ pub unsafe fn do_unwind(signum: i32, siginfo: *const c_void, ucontext: *const c_ longjmp(jmp_buf as *mut ::nix::libc::c_void, signum) } +#[cfg(all(target_os = "linux", target_arch = "aarch64"))] +unsafe fn get_faulting_addr_and_ip( + _siginfo: *const c_void, + _ucontext: *const c_void, +) -> (*const c_void, *const c_void) { + (::std::ptr::null(), ::std::ptr::null()) +} + #[cfg(all(target_os = "linux", target_arch = "x86_64"))] unsafe fn get_faulting_addr_and_ip( siginfo: *const c_void, @@ -230,5 +238,6 @@ unsafe fn get_faulting_addr_and_ip( #[cfg(not(any( all(target_os = "macos", target_arch = "x86_64"), all(target_os = "linux", target_arch = "x86_64"), + all(target_os = "linux", target_arch = "aarch64"), )))] compile_error!("This crate doesn't yet support compiling on operating systems other than linux and macos and architectures other than x86_64"); diff --git a/lib/emscripten/src/env/unix/mod.rs b/lib/emscripten/src/env/unix/mod.rs index 486ae337949..0e62e8e2f62 100644 --- a/lib/emscripten/src/env/unix/mod.rs +++ b/lib/emscripten/src/env/unix/mod.rs @@ -159,7 +159,7 @@ pub fn _gai_strerror(ctx: &mut Ctx, ecode: i32) -> i32 { .unwrap() }; for (i, byte) in bytes.iter().enumerate() { - writer[i].set(*byte as i8); + writer[i].set(*byte as _); } string_on_guest.offset() as _ @@ -283,7 +283,7 @@ pub fn _getaddrinfo( .deref(ctx.memory(0), 0, str_size as _) .unwrap(); for (i, b) in canonname_bytes.into_iter().enumerate() { - guest_canonname_writer[i].set(*b as i8) + guest_canonname_writer[i].set(*b as _) } guest_canonname diff --git a/lib/emscripten/src/exec.rs b/lib/emscripten/src/exec.rs index 5751e3199a2..87971c69b63 100644 --- a/lib/emscripten/src/exec.rs +++ b/lib/emscripten/src/exec.rs @@ -37,7 +37,7 @@ pub fn execvp(ctx: &mut Ctx, command_name_offset: u32, argv_offset: u32) -> i32 // construct raw pointers and hand them to `execvp` let command_pointer = command_name_string.as_ptr() as *const i8; let args_pointer = argv.as_ptr(); - unsafe { libc_execvp(command_pointer, args_pointer) } + unsafe { libc_execvp(command_pointer as *const _, args_pointer as *const *const _) } } /// execl diff --git a/lib/emscripten/src/io/unix.rs b/lib/emscripten/src/io/unix.rs index c9206b343f4..740210d460a 100644 --- a/lib/emscripten/src/io/unix.rs +++ b/lib/emscripten/src/io/unix.rs @@ -23,7 +23,7 @@ pub fn printf(ctx: &mut Ctx, memory_offset: i32, extra: i32) -> i32 { pub fn chroot(ctx: &mut Ctx, name_ptr: i32) -> i32 { debug!("emscripten::chroot"); let name = emscripten_memory_pointer!(ctx.memory(0), name_ptr) as *const i8; - unsafe { _chroot(name) } + unsafe { _chroot(name as *const _) } } /// getpwuid diff --git a/lib/emscripten/src/libc.rs b/lib/emscripten/src/libc.rs index 988f9c11b36..0c9d6ef11dd 100644 --- a/lib/emscripten/src/libc.rs +++ b/lib/emscripten/src/libc.rs @@ -54,7 +54,7 @@ pub fn killpg(_ctx: &mut Ctx, _a: i32, _b: i32) -> i32 { pub fn pathconf(ctx: &mut Ctx, path_ptr: i32, name: i32) -> i32 { debug!("emscripten::pathconf"); let path = emscripten_memory_pointer!(ctx.memory(0), path_ptr) as *const i8; - unsafe { libc::pathconf(path, name).try_into().unwrap() } + unsafe { libc::pathconf(path as *const _, name).try_into().unwrap() } } #[cfg(not(unix))] diff --git a/lib/emscripten/src/syscalls/mod.rs b/lib/emscripten/src/syscalls/mod.rs index 8c1b0a43af7..b098bd1529e 100644 --- a/lib/emscripten/src/syscalls/mod.rs +++ b/lib/emscripten/src/syscalls/mod.rs @@ -97,7 +97,7 @@ pub fn ___syscall6(ctx: &mut Ctx, _which: c_int, mut varargs: VarArgs) -> c_int pub fn ___syscall12(ctx: &mut Ctx, _which: c_int, mut varargs: VarArgs) -> c_int { debug!("emscripten::___syscall12 (chdir) {}", _which); let path_ptr = varargs.get_str(ctx); - let real_path_owned = get_cstr_path(ctx, path_ptr); + let real_path_owned = get_cstr_path(ctx, path_ptr as *const _); let real_path = if let Some(ref rp) = real_path_owned { rp.as_c_str().as_ptr() } else { @@ -168,13 +168,13 @@ pub fn ___syscall38(ctx: &mut Ctx, _which: c_int, mut varargs: VarArgs) -> i32 { debug!("emscripten::___syscall38 (rename)"); let old_path = varargs.get_str(ctx); let new_path = varargs.get_str(ctx); - let real_old_path_owned = get_cstr_path(ctx, old_path); + let real_old_path_owned = get_cstr_path(ctx, old_path as *const _); let real_old_path = if let Some(ref rp) = real_old_path_owned { rp.as_c_str().as_ptr() } else { old_path }; - let real_new_path_owned = get_cstr_path(ctx, new_path); + let real_new_path_owned = get_cstr_path(ctx, new_path as *const _); let real_new_path = if let Some(ref rp) = real_new_path_owned { rp.as_c_str().as_ptr() } else { @@ -194,7 +194,7 @@ pub fn ___syscall38(ctx: &mut Ctx, _which: c_int, mut varargs: VarArgs) -> i32 { pub fn ___syscall40(ctx: &mut Ctx, _which: c_int, mut varargs: VarArgs) -> c_int { debug!("emscripten::___syscall40 (rmdir)"); let pathname_addr = varargs.get_str(ctx); - let real_path_owned = get_cstr_path(ctx, pathname_addr); + let real_path_owned = get_cstr_path(ctx, pathname_addr as *const _); let real_path = if let Some(ref rp) = real_path_owned { rp.as_c_str().as_ptr() } else { @@ -359,7 +359,7 @@ pub fn ___syscall183(ctx: &mut Ctx, _which: c_int, mut varargs: VarArgs) -> i32 let buf_writer = buf_offset.deref(ctx.memory(0), 0, len as u32 + 1).unwrap(); for (i, byte) in path_string.bytes().enumerate() { - buf_writer[i].set(byte as i8); + buf_writer[i].set(byte as _); } buf_writer[len].set(0); buf_offset.offset() as i32 @@ -535,7 +535,7 @@ pub fn ___syscall195(ctx: &mut Ctx, _which: c_int, mut varargs: VarArgs) -> c_in let pathname_addr = varargs.get_str(ctx); let buf: u32 = varargs.get(ctx); - let real_path_owned = get_cstr_path(ctx, pathname_addr); + let real_path_owned = get_cstr_path(ctx, pathname_addr as *const _); let real_path = if let Some(ref rp) = real_path_owned { rp.as_c_str().as_ptr() } else { diff --git a/lib/emscripten/src/syscalls/unix.rs b/lib/emscripten/src/syscalls/unix.rs index cff58545202..000a3e31920 100644 --- a/lib/emscripten/src/syscalls/unix.rs +++ b/lib/emscripten/src/syscalls/unix.rs @@ -146,7 +146,7 @@ pub fn ___syscall5(ctx: &mut Ctx, _which: c_int, mut varargs: VarArgs) -> c_int let pathname_addr = varargs.get_str(ctx); let flags: i32 = varargs.get(ctx); let mode: u32 = varargs.get(ctx); - let real_path_owned = utils::get_cstr_path(ctx, pathname_addr); + let real_path_owned = utils::get_cstr_path(ctx, pathname_addr as *const _); let real_path = if let Some(ref rp) = real_path_owned { rp.as_c_str().as_ptr() } else { @@ -198,13 +198,13 @@ pub fn ___syscall83(ctx: &mut Ctx, _which: c_int, mut varargs: VarArgs) -> c_int let path1 = varargs.get_str(ctx); let path2 = varargs.get_str(ctx); - let real_path1_owned = utils::get_cstr_path(ctx, path1); + let real_path1_owned = utils::get_cstr_path(ctx, path1 as *const _); let real_path1 = if let Some(ref rp) = real_path1_owned { rp.as_c_str().as_ptr() } else { path1 }; - let real_path2_owned = utils::get_cstr_path(ctx, path2); + let real_path2_owned = utils::get_cstr_path(ctx, path2 as *const _); let real_path2 = if let Some(ref rp) = real_path2_owned { rp.as_c_str().as_ptr() } else { @@ -227,7 +227,7 @@ pub fn ___syscall85(ctx: &mut Ctx, _which: c_int, mut varargs: VarArgs) -> i32 { let buf = varargs.get_str(ctx); // let buf_addr: i32 = varargs.get(ctx); let buf_size: i32 = varargs.get(ctx); - let real_path_owned = get_cstr_path(ctx, pathname_addr); + let real_path_owned = get_cstr_path(ctx, pathname_addr as *const _); let real_path = if let Some(ref rp) = real_path_owned { rp.as_c_str().as_ptr() } else { @@ -266,7 +266,7 @@ pub fn ___syscall194(ctx: &mut Ctx, _which: c_int, mut varargs: VarArgs) -> c_in pub fn ___syscall198(ctx: &mut Ctx, _which: c_int, mut varargs: VarArgs) -> c_int { debug!("emscripten::___syscall198 (lchown) {}", _which); let path_ptr = varargs.get_str(ctx); - let real_path_owned = utils::get_cstr_path(ctx, path_ptr); + let real_path_owned = utils::get_cstr_path(ctx, path_ptr as *const _); let real_path = if let Some(ref rp) = real_path_owned { rp.as_c_str().as_ptr() } else { @@ -307,7 +307,7 @@ pub fn ___syscall212(ctx: &mut Ctx, _which: c_int, mut varargs: VarArgs) -> c_in debug!("emscripten::___syscall212 (chown) {}", _which); let pathname_addr = varargs.get_str(ctx); - let real_path_owned = utils::get_cstr_path(ctx, pathname_addr); + let real_path_owned = utils::get_cstr_path(ctx, pathname_addr as *const _); let real_path = if let Some(ref rp) = real_path_owned { rp.as_c_str().as_ptr() } else { @@ -336,7 +336,7 @@ pub fn ___syscall219(ctx: &mut Ctx, _which: c_int, mut varargs: VarArgs) -> c_in pub fn ___syscall33(ctx: &mut Ctx, _which: c_int, mut varargs: VarArgs) -> c_int { debug!("emscripten::___syscall33 (access) {}", _which); let path = varargs.get_str(ctx); - let real_path_owned = utils::get_cstr_path(ctx, path); + let real_path_owned = utils::get_cstr_path(ctx, path as *const _); let real_path = if let Some(ref rp) = real_path_owned { rp.as_c_str().as_ptr() } else { @@ -364,7 +364,7 @@ pub fn ___syscall34(ctx: &mut Ctx, _which: c_int, mut varargs: VarArgs) -> c_int pub fn ___syscall39(ctx: &mut Ctx, _which: c_int, mut varargs: VarArgs) -> c_int { debug!("emscripten::___syscall39 (mkdir) {}", _which); let pathname_addr = varargs.get_str(ctx); - let real_path_owned = utils::get_cstr_path(ctx, pathname_addr); + let real_path_owned = utils::get_cstr_path(ctx, pathname_addr as *const _); let real_path = if let Some(ref rp) = real_path_owned { rp.as_c_str().as_ptr() } else { @@ -986,7 +986,7 @@ pub fn ___syscall122(ctx: &mut Ctx, _which: c_int, mut varargs: VarArgs) -> c_in pub fn ___syscall196(ctx: &mut Ctx, _which: i32, mut varargs: VarArgs) -> i32 { debug!("emscripten::___syscall196 (lstat64) {}", _which); let path = varargs.get_str(ctx); - let real_path_owned = utils::get_cstr_path(ctx, path); + let real_path_owned = utils::get_cstr_path(ctx, path as *const _); let real_path = if let Some(ref rp) = real_path_owned { rp.as_c_str().as_ptr() } else { @@ -1063,7 +1063,7 @@ pub fn ___syscall220(ctx: &mut Ctx, _which: i32, mut varargs: VarArgs) -> i32 { let upper_bound = std::cmp::min((*dirent).d_reclen, 255) as usize; let mut i = 0; while i < upper_bound { - *(dirp.add(pos + 11 + i) as *mut i8) = (*dirent).d_name[i]; + *(dirp.add(pos + 11 + i) as *mut i8) = (*dirent).d_name[i] as _; i += 1; } // We set the termination string char diff --git a/lib/emscripten/src/utils.rs b/lib/emscripten/src/utils.rs index 57d26f24e17..2585af43fea 100644 --- a/lib/emscripten/src/utils.rs +++ b/lib/emscripten/src/utils.rs @@ -236,7 +236,8 @@ pub fn read_string_from_wasm(memory: &Memory, offset: u32) -> String { pub fn get_cstr_path(ctx: &mut Ctx, path: *const i8) -> Option { use std::collections::VecDeque; - let path_str = unsafe { std::ffi::CStr::from_ptr(path).to_str().unwrap() }.to_string(); + let path_str = + unsafe { std::ffi::CStr::from_ptr(path as *const _).to_str().unwrap() }.to_string(); let data = get_emscripten_data(ctx); let path = PathBuf::from(path_str); let mut prefix_added = false;