mirror of
https://github.com/fluencelabs/wasmer
synced 2025-06-23 13:41:32 +00:00
Merge remote-tracking branch 'origin/master' into feature/osr
This commit is contained in:
@ -5,6 +5,13 @@ All PRs to the Wasmer repository must add to this file.
|
||||
Blocks of changes will separated by version increments.
|
||||
|
||||
## **[Unreleased]**
|
||||
## 0.5.3
|
||||
- [#523](https://github.com/wasmerio/wasmer/pull/523) Update wapm version to fix bug related to signed packages in the global namespace and locally-stored public keys
|
||||
|
||||
## 0.5.2 - 2019-07-02
|
||||
- [#521](https://github.com/wasmerio/wasmer/pull/521) Update Wapm-cli, bump version numbers
|
||||
- [#518](https://github.com/wasmerio/wasmer/pull/518) Update Cranelift and WasmParser
|
||||
- [#514](https://github.com/wasmerio/wasmer/pull/514) [#519](https://github.com/wasmerio/wasmer/pull/519) Improved Emscripten network related calls, added a null check to `WasmPtr`
|
||||
- [#515](https://github.com/wasmerio/wasmer/pull/515) Improved Emscripten dyncalls
|
||||
- [#513](https://github.com/wasmerio/wasmer/pull/513) Fix emscripten lseek implementation.
|
||||
- [#510](https://github.com/wasmerio/wasmer/pull/510) Simplify construction of floating point constants in LLVM backend. Fix LLVM assertion failure due to definition of %ctx.
|
||||
|
189
Cargo.lock
generated
189
Cargo.lock
generated
@ -244,20 +244,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "cranelift-bforest"
|
||||
version = "0.30.0"
|
||||
source = "git+https://github.com/wasmerio/cranelift.git?rev=84ec31b0fdfc10db491ef950815ee2961db057cb#84ec31b0fdfc10db491ef950815ee2961db057cb"
|
||||
version = "0.31.0"
|
||||
source = "git+https://github.com/wasmerio/cranelift.git?rev=2ada531d79b34a9e6c94c81f2615677e22d68780#2ada531d79b34a9e6c94c81f2615677e22d68780"
|
||||
dependencies = [
|
||||
"cranelift-entity 0.30.0 (git+https://github.com/wasmerio/cranelift.git?rev=84ec31b0fdfc10db491ef950815ee2961db057cb)",
|
||||
"cranelift-entity 0.31.0 (git+https://github.com/wasmerio/cranelift.git?rev=2ada531d79b34a9e6c94c81f2615677e22d68780)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "cranelift-codegen"
|
||||
version = "0.30.0"
|
||||
source = "git+https://github.com/wasmerio/cranelift.git?rev=84ec31b0fdfc10db491ef950815ee2961db057cb#84ec31b0fdfc10db491ef950815ee2961db057cb"
|
||||
version = "0.31.0"
|
||||
source = "git+https://github.com/wasmerio/cranelift.git?rev=2ada531d79b34a9e6c94c81f2615677e22d68780#2ada531d79b34a9e6c94c81f2615677e22d68780"
|
||||
dependencies = [
|
||||
"cranelift-bforest 0.30.0 (git+https://github.com/wasmerio/cranelift.git?rev=84ec31b0fdfc10db491ef950815ee2961db057cb)",
|
||||
"cranelift-codegen-meta 0.30.0 (git+https://github.com/wasmerio/cranelift.git?rev=84ec31b0fdfc10db491ef950815ee2961db057cb)",
|
||||
"cranelift-entity 0.30.0 (git+https://github.com/wasmerio/cranelift.git?rev=84ec31b0fdfc10db491ef950815ee2961db057cb)",
|
||||
"cranelift-bforest 0.31.0 (git+https://github.com/wasmerio/cranelift.git?rev=2ada531d79b34a9e6c94c81f2615677e22d68780)",
|
||||
"cranelift-codegen-meta 0.31.0 (git+https://github.com/wasmerio/cranelift.git?rev=2ada531d79b34a9e6c94c81f2615677e22d68780)",
|
||||
"cranelift-entity 0.31.0 (git+https://github.com/wasmerio/cranelift.git?rev=2ada531d79b34a9e6c94c81f2615677e22d68780)",
|
||||
"failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"failure_derive 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@ -266,50 +266,49 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "cranelift-codegen-meta"
|
||||
version = "0.30.0"
|
||||
source = "git+https://github.com/wasmerio/cranelift.git?rev=84ec31b0fdfc10db491ef950815ee2961db057cb#84ec31b0fdfc10db491ef950815ee2961db057cb"
|
||||
version = "0.31.0"
|
||||
source = "git+https://github.com/wasmerio/cranelift.git?rev=2ada531d79b34a9e6c94c81f2615677e22d68780#2ada531d79b34a9e6c94c81f2615677e22d68780"
|
||||
dependencies = [
|
||||
"cranelift-entity 0.30.0 (git+https://github.com/wasmerio/cranelift.git?rev=84ec31b0fdfc10db491ef950815ee2961db057cb)",
|
||||
"cranelift-entity 0.31.0 (git+https://github.com/wasmerio/cranelift.git?rev=2ada531d79b34a9e6c94c81f2615677e22d68780)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "cranelift-entity"
|
||||
version = "0.30.0"
|
||||
source = "git+https://github.com/wasmerio/cranelift.git?rev=84ec31b0fdfc10db491ef950815ee2961db057cb#84ec31b0fdfc10db491ef950815ee2961db057cb"
|
||||
version = "0.31.0"
|
||||
source = "git+https://github.com/wasmerio/cranelift.git?rev=2ada531d79b34a9e6c94c81f2615677e22d68780#2ada531d79b34a9e6c94c81f2615677e22d68780"
|
||||
|
||||
[[package]]
|
||||
name = "cranelift-frontend"
|
||||
version = "0.30.0"
|
||||
source = "git+https://github.com/wasmerio/cranelift.git?rev=84ec31b0fdfc10db491ef950815ee2961db057cb#84ec31b0fdfc10db491ef950815ee2961db057cb"
|
||||
version = "0.31.0"
|
||||
source = "git+https://github.com/wasmerio/cranelift.git?rev=2ada531d79b34a9e6c94c81f2615677e22d68780#2ada531d79b34a9e6c94c81f2615677e22d68780"
|
||||
dependencies = [
|
||||
"cranelift-codegen 0.30.0 (git+https://github.com/wasmerio/cranelift.git?rev=84ec31b0fdfc10db491ef950815ee2961db057cb)",
|
||||
"cranelift-codegen 0.31.0 (git+https://github.com/wasmerio/cranelift.git?rev=2ada531d79b34a9e6c94c81f2615677e22d68780)",
|
||||
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"target-lexicon 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "cranelift-native"
|
||||
version = "0.30.0"
|
||||
source = "git+https://github.com/wasmerio/cranelift.git?rev=84ec31b0fdfc10db491ef950815ee2961db057cb#84ec31b0fdfc10db491ef950815ee2961db057cb"
|
||||
version = "0.31.0"
|
||||
source = "git+https://github.com/wasmerio/cranelift.git?rev=2ada531d79b34a9e6c94c81f2615677e22d68780#2ada531d79b34a9e6c94c81f2615677e22d68780"
|
||||
dependencies = [
|
||||
"cranelift-codegen 0.30.0 (git+https://github.com/wasmerio/cranelift.git?rev=84ec31b0fdfc10db491ef950815ee2961db057cb)",
|
||||
"cranelift-codegen 0.31.0 (git+https://github.com/wasmerio/cranelift.git?rev=2ada531d79b34a9e6c94c81f2615677e22d68780)",
|
||||
"raw-cpuid 6.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"target-lexicon 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "cranelift-wasm"
|
||||
version = "0.30.0"
|
||||
source = "git+https://github.com/wasmerio/cranelift.git?rev=84ec31b0fdfc10db491ef950815ee2961db057cb#84ec31b0fdfc10db491ef950815ee2961db057cb"
|
||||
version = "0.31.0"
|
||||
source = "git+https://github.com/wasmerio/cranelift.git?rev=2ada531d79b34a9e6c94c81f2615677e22d68780#2ada531d79b34a9e6c94c81f2615677e22d68780"
|
||||
dependencies = [
|
||||
"cast 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"cranelift-codegen 0.30.0 (git+https://github.com/wasmerio/cranelift.git?rev=84ec31b0fdfc10db491ef950815ee2961db057cb)",
|
||||
"cranelift-entity 0.30.0 (git+https://github.com/wasmerio/cranelift.git?rev=84ec31b0fdfc10db491ef950815ee2961db057cb)",
|
||||
"cranelift-frontend 0.30.0 (git+https://github.com/wasmerio/cranelift.git?rev=84ec31b0fdfc10db491ef950815ee2961db057cb)",
|
||||
"cranelift-codegen 0.31.0 (git+https://github.com/wasmerio/cranelift.git?rev=2ada531d79b34a9e6c94c81f2615677e22d68780)",
|
||||
"cranelift-entity 0.31.0 (git+https://github.com/wasmerio/cranelift.git?rev=2ada531d79b34a9e6c94c81f2615677e22d68780)",
|
||||
"cranelift-frontend 0.31.0 (git+https://github.com/wasmerio/cranelift.git?rev=2ada531d79b34a9e6c94c81f2615677e22d68780)",
|
||||
"failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"failure_derive 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"wasmparser 0.29.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"wasmparser 0.32.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -1414,7 +1413,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "wasmer"
|
||||
version = "0.5.1"
|
||||
version = "0.5.3"
|
||||
dependencies = [
|
||||
"byteorder 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"errno 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@ -1423,28 +1422,28 @@ dependencies = [
|
||||
"rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"structopt 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"wabt 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"wasmer-clif-backend 0.5.1",
|
||||
"wasmer-dev-utils 0.5.1",
|
||||
"wasmer-emscripten 0.5.1",
|
||||
"wasmer-clif-backend 0.5.3",
|
||||
"wasmer-dev-utils 0.5.3",
|
||||
"wasmer-emscripten 0.5.3",
|
||||
"wasmer-kernel-loader 0.1.0",
|
||||
"wasmer-llvm-backend 0.5.1",
|
||||
"wasmer-middleware-common 0.5.1",
|
||||
"wasmer-runtime 0.5.1",
|
||||
"wasmer-runtime-core 0.5.1",
|
||||
"wasmer-singlepass-backend 0.5.1",
|
||||
"wasmer-wasi 0.5.1",
|
||||
"wasmer-llvm-backend 0.5.3",
|
||||
"wasmer-middleware-common 0.5.3",
|
||||
"wasmer-runtime 0.5.3",
|
||||
"wasmer-runtime-core 0.5.3",
|
||||
"wasmer-singlepass-backend 0.5.3",
|
||||
"wasmer-wasi 0.5.3",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "wasmer-clif-backend"
|
||||
version = "0.5.1"
|
||||
version = "0.5.3"
|
||||
dependencies = [
|
||||
"byteorder 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"cranelift-codegen 0.30.0 (git+https://github.com/wasmerio/cranelift.git?rev=84ec31b0fdfc10db491ef950815ee2961db057cb)",
|
||||
"cranelift-entity 0.30.0 (git+https://github.com/wasmerio/cranelift.git?rev=84ec31b0fdfc10db491ef950815ee2961db057cb)",
|
||||
"cranelift-frontend 0.30.0 (git+https://github.com/wasmerio/cranelift.git?rev=84ec31b0fdfc10db491ef950815ee2961db057cb)",
|
||||
"cranelift-native 0.30.0 (git+https://github.com/wasmerio/cranelift.git?rev=84ec31b0fdfc10db491ef950815ee2961db057cb)",
|
||||
"cranelift-wasm 0.30.0 (git+https://github.com/wasmerio/cranelift.git?rev=84ec31b0fdfc10db491ef950815ee2961db057cb)",
|
||||
"cranelift-codegen 0.31.0 (git+https://github.com/wasmerio/cranelift.git?rev=2ada531d79b34a9e6c94c81f2615677e22d68780)",
|
||||
"cranelift-entity 0.31.0 (git+https://github.com/wasmerio/cranelift.git?rev=2ada531d79b34a9e6c94c81f2615677e22d68780)",
|
||||
"cranelift-frontend 0.31.0 (git+https://github.com/wasmerio/cranelift.git?rev=2ada531d79b34a9e6c94c81f2615677e22d68780)",
|
||||
"cranelift-native 0.31.0 (git+https://github.com/wasmerio/cranelift.git?rev=2ada531d79b34a9e6c94c81f2615677e22d68780)",
|
||||
"cranelift-wasm 0.31.0 (git+https://github.com/wasmerio/cranelift.git?rev=2ada531d79b34a9e6c94c81f2615677e22d68780)",
|
||||
"hashbrown 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.57 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"nix 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@ -1454,22 +1453,22 @@ dependencies = [
|
||||
"serde_bytes 0.10.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde_derive 1.0.92 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"target-lexicon 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"wasmer-runtime-core 0.5.1",
|
||||
"wasmer-win-exception-handler 0.5.1",
|
||||
"wasmparser 0.29.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"wasmer-runtime-core 0.5.3",
|
||||
"wasmer-win-exception-handler 0.5.3",
|
||||
"wasmparser 0.32.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "wasmer-dev-utils"
|
||||
version = "0.5.1"
|
||||
version = "0.5.3"
|
||||
dependencies = [
|
||||
"libc 0.2.57 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "wasmer-emscripten"
|
||||
version = "0.5.1"
|
||||
version = "0.5.3"
|
||||
dependencies = [
|
||||
"byteorder 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@ -1479,11 +1478,11 @@ dependencies = [
|
||||
"rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"wabt 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"wasmer-clif-backend 0.5.1",
|
||||
"wasmer-dev-utils 0.5.1",
|
||||
"wasmer-llvm-backend 0.5.1",
|
||||
"wasmer-runtime-core 0.5.1",
|
||||
"wasmer-singlepass-backend 0.5.1",
|
||||
"wasmer-clif-backend 0.5.3",
|
||||
"wasmer-dev-utils 0.5.3",
|
||||
"wasmer-llvm-backend 0.5.3",
|
||||
"wasmer-runtime-core 0.5.3",
|
||||
"wasmer-singlepass-backend 0.5.3",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -1491,12 +1490,12 @@ name = "wasmer-kernel-loader"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"libc 0.2.57 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"wasmer-runtime-core 0.5.1",
|
||||
"wasmer-runtime-core 0.5.3",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "wasmer-llvm-backend"
|
||||
version = "0.5.1"
|
||||
version = "0.5.3"
|
||||
dependencies = [
|
||||
"capstone 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"cc 1.0.37 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@ -1511,50 +1510,50 @@ dependencies = [
|
||||
"semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"smallvec 0.6.9 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"wabt 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"wasmer-runtime-core 0.5.1",
|
||||
"wasmparser 0.29.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"wasmer-runtime-core 0.5.3",
|
||||
"wasmparser 0.32.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "wasmer-middleware-common"
|
||||
version = "0.5.1"
|
||||
version = "0.5.3"
|
||||
dependencies = [
|
||||
"criterion 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"wabt 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"wasmer-clif-backend 0.5.1",
|
||||
"wasmer-llvm-backend 0.5.1",
|
||||
"wasmer-runtime-core 0.5.1",
|
||||
"wasmer-singlepass-backend 0.5.1",
|
||||
"wasmer-clif-backend 0.5.3",
|
||||
"wasmer-llvm-backend 0.5.3",
|
||||
"wasmer-runtime-core 0.5.3",
|
||||
"wasmer-singlepass-backend 0.5.3",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "wasmer-runtime"
|
||||
version = "0.5.1"
|
||||
version = "0.5.3"
|
||||
dependencies = [
|
||||
"criterion 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"memmap 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"tempfile 3.0.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"wabt 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"wasmer-clif-backend 0.5.1",
|
||||
"wasmer-llvm-backend 0.5.1",
|
||||
"wasmer-runtime-core 0.5.1",
|
||||
"wasmer-singlepass-backend 0.5.1",
|
||||
"wasmer-clif-backend 0.5.3",
|
||||
"wasmer-llvm-backend 0.5.3",
|
||||
"wasmer-runtime-core 0.5.3",
|
||||
"wasmer-singlepass-backend 0.5.3",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "wasmer-runtime-c-api"
|
||||
version = "0.5.1"
|
||||
version = "0.5.3"
|
||||
dependencies = [
|
||||
"cbindgen 0.8.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.57 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"wasmer-runtime 0.5.1",
|
||||
"wasmer-runtime-core 0.5.1",
|
||||
"wasmer-runtime 0.5.3",
|
||||
"wasmer-runtime-core 0.5.3",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "wasmer-runtime-core"
|
||||
version = "0.5.1"
|
||||
version = "0.5.3"
|
||||
dependencies = [
|
||||
"bincode 1.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"blake2b_simd 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@ -1577,13 +1576,13 @@ dependencies = [
|
||||
"serde_bytes 0.10.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde_derive 1.0.92 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"smallvec 0.6.9 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"wasmparser 0.29.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"wasmparser 0.32.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "wasmer-singlepass-backend"
|
||||
version = "0.5.1"
|
||||
version = "0.5.3"
|
||||
dependencies = [
|
||||
"byteorder 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"colored 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@ -1594,24 +1593,24 @@ dependencies = [
|
||||
"libc 0.2.57 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"nix 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"smallvec 0.6.9 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"wasmer-runtime-core 0.5.1",
|
||||
"wasmparser 0.29.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"wasmer-runtime-core 0.5.3",
|
||||
"wasmparser 0.32.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "wasmer-spectests"
|
||||
version = "0.5.1"
|
||||
version = "0.5.3"
|
||||
dependencies = [
|
||||
"wabt 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"wasmer-clif-backend 0.5.1",
|
||||
"wasmer-llvm-backend 0.5.1",
|
||||
"wasmer-runtime-core 0.5.1",
|
||||
"wasmer-singlepass-backend 0.5.1",
|
||||
"wasmer-clif-backend 0.5.3",
|
||||
"wasmer-llvm-backend 0.5.3",
|
||||
"wasmer-runtime-core 0.5.3",
|
||||
"wasmer-singlepass-backend 0.5.3",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "wasmer-wasi"
|
||||
version = "0.5.1"
|
||||
version = "0.5.3"
|
||||
dependencies = [
|
||||
"byteorder 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"generational-arena 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@ -1620,28 +1619,28 @@ dependencies = [
|
||||
"libc 0.2.57 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"wasmer-clif-backend 0.5.1",
|
||||
"wasmer-dev-utils 0.5.1",
|
||||
"wasmer-runtime-core 0.5.1",
|
||||
"wasmer-singlepass-backend 0.5.1",
|
||||
"wasmer-clif-backend 0.5.3",
|
||||
"wasmer-dev-utils 0.5.3",
|
||||
"wasmer-runtime-core 0.5.3",
|
||||
"wasmer-singlepass-backend 0.5.3",
|
||||
"winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "wasmer-win-exception-handler"
|
||||
version = "0.5.1"
|
||||
version = "0.5.3"
|
||||
dependencies = [
|
||||
"bindgen 0.46.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"cmake 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.57 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"regex 1.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"wasmer-runtime-core 0.5.1",
|
||||
"wasmer-runtime-core 0.5.3",
|
||||
"winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "wasmparser"
|
||||
version = "0.29.2"
|
||||
version = "0.32.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
@ -1739,13 +1738,13 @@ dependencies = [
|
||||
"checksum cmake 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)" = "2ca4386c8954b76a8415b63959337d940d724b336cabd3afe189c2b51a7e1ff0"
|
||||
"checksum colored 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6cdb90b60f2927f8d76139c72dbde7e10c3a2bc47c8594c9c7a66529f2687c03"
|
||||
"checksum constant_time_eq 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8ff012e225ce166d4422e0e78419d901719760f62ae2b7969ca6b564d1b54a9e"
|
||||
"checksum cranelift-bforest 0.30.0 (git+https://github.com/wasmerio/cranelift.git?rev=84ec31b0fdfc10db491ef950815ee2961db057cb)" = "<none>"
|
||||
"checksum cranelift-codegen 0.30.0 (git+https://github.com/wasmerio/cranelift.git?rev=84ec31b0fdfc10db491ef950815ee2961db057cb)" = "<none>"
|
||||
"checksum cranelift-codegen-meta 0.30.0 (git+https://github.com/wasmerio/cranelift.git?rev=84ec31b0fdfc10db491ef950815ee2961db057cb)" = "<none>"
|
||||
"checksum cranelift-entity 0.30.0 (git+https://github.com/wasmerio/cranelift.git?rev=84ec31b0fdfc10db491ef950815ee2961db057cb)" = "<none>"
|
||||
"checksum cranelift-frontend 0.30.0 (git+https://github.com/wasmerio/cranelift.git?rev=84ec31b0fdfc10db491ef950815ee2961db057cb)" = "<none>"
|
||||
"checksum cranelift-native 0.30.0 (git+https://github.com/wasmerio/cranelift.git?rev=84ec31b0fdfc10db491ef950815ee2961db057cb)" = "<none>"
|
||||
"checksum cranelift-wasm 0.30.0 (git+https://github.com/wasmerio/cranelift.git?rev=84ec31b0fdfc10db491ef950815ee2961db057cb)" = "<none>"
|
||||
"checksum cranelift-bforest 0.31.0 (git+https://github.com/wasmerio/cranelift.git?rev=2ada531d79b34a9e6c94c81f2615677e22d68780)" = "<none>"
|
||||
"checksum cranelift-codegen 0.31.0 (git+https://github.com/wasmerio/cranelift.git?rev=2ada531d79b34a9e6c94c81f2615677e22d68780)" = "<none>"
|
||||
"checksum cranelift-codegen-meta 0.31.0 (git+https://github.com/wasmerio/cranelift.git?rev=2ada531d79b34a9e6c94c81f2615677e22d68780)" = "<none>"
|
||||
"checksum cranelift-entity 0.31.0 (git+https://github.com/wasmerio/cranelift.git?rev=2ada531d79b34a9e6c94c81f2615677e22d68780)" = "<none>"
|
||||
"checksum cranelift-frontend 0.31.0 (git+https://github.com/wasmerio/cranelift.git?rev=2ada531d79b34a9e6c94c81f2615677e22d68780)" = "<none>"
|
||||
"checksum cranelift-native 0.31.0 (git+https://github.com/wasmerio/cranelift.git?rev=2ada531d79b34a9e6c94c81f2615677e22d68780)" = "<none>"
|
||||
"checksum cranelift-wasm 0.31.0 (git+https://github.com/wasmerio/cranelift.git?rev=2ada531d79b34a9e6c94c81f2615677e22d68780)" = "<none>"
|
||||
"checksum criterion 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "0363053954f3e679645fc443321ca128b7b950a6fe288cf5f9335cc22ee58394"
|
||||
"checksum criterion-plot 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "76f9212ddf2f4a9eb2d401635190600656a1f88a932ef53d06e7fa4c7e02fb8e"
|
||||
"checksum crossbeam-deque 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f739f8c5363aca78cfb059edf753d8f0d36908c348f3d8d1503f03d8b75d9cf3"
|
||||
@ -1877,7 +1876,7 @@ dependencies = [
|
||||
"checksum wabt 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)" = "74e463a508e390cc7447e70f640fbf44ad52e1bd095314ace1fdf99516d32add"
|
||||
"checksum wabt-sys 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)" = "a6265b25719e82598d104b3717375e37661d41753e2c84cde3f51050c7ed7e3c"
|
||||
"checksum walkdir 2.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "9d9d7ed3431229a144296213105a390676cc49c9b6a72bd19f3176c98e129fa1"
|
||||
"checksum wasmparser 0.29.2 (registry+https://github.com/rust-lang/crates.io-index)" = "981a8797cf89762e0233ec45fae731cb79a4dfaee12d9f0fe6cee01e4ac58d00"
|
||||
"checksum wasmparser 0.32.1 (registry+https://github.com/rust-lang/crates.io-index)" = "22d1801de30f112ddaf665291097694ee33a36d1cb414b53a921d05b3519674a"
|
||||
"checksum which 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b57acb10231b9493c8472b20cb57317d0679a49e0bdbee44b3b803a6473af164"
|
||||
"checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a"
|
||||
"checksum winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)" = "f10e386af2b13e47c89e7236a7a14a086791a2b88ebad6df9bf42040195cf770"
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "wasmer"
|
||||
version = "0.5.1"
|
||||
version = "0.5.3"
|
||||
authors = ["The Wasmer Engineering Team <engineering@wasmer.io>"]
|
||||
edition = "2018"
|
||||
repository = "https://github.com/wasmerio/wasmer"
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "wasmer-clif-backend"
|
||||
version = "0.5.1"
|
||||
version = "0.5.3"
|
||||
description = "Wasmer runtime Cranelift compiler backend"
|
||||
license = "MIT"
|
||||
authors = ["The Wasmer Engineering Team <engineering@wasmer.io>"]
|
||||
@ -8,15 +8,15 @@ repository = "https://github.com/wasmerio/wasmer"
|
||||
edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
wasmer-runtime-core = { path = "../runtime-core", version = "0.5.1" }
|
||||
cranelift-native = { git = "https://github.com/wasmerio/cranelift.git", rev = "84ec31b0fdfc10db491ef950815ee2961db057cb" }
|
||||
cranelift-codegen = { git = "https://github.com/wasmerio/cranelift.git", rev = "84ec31b0fdfc10db491ef950815ee2961db057cb" }
|
||||
cranelift-entity = { git = "https://github.com/wasmerio/cranelift.git", rev = "84ec31b0fdfc10db491ef950815ee2961db057cb" }
|
||||
cranelift-frontend = { git = "https://github.com/wasmerio/cranelift.git", rev = "84ec31b0fdfc10db491ef950815ee2961db057cb" }
|
||||
cranelift-wasm = { git = "https://github.com/wasmerio/cranelift.git", rev = "84ec31b0fdfc10db491ef950815ee2961db057cb" }
|
||||
wasmer-runtime-core = { path = "../runtime-core", version = "0.5.3" }
|
||||
cranelift-native = { git = "https://github.com/wasmerio/cranelift.git", rev = "2ada531d79b34a9e6c94c81f2615677e22d68780" }
|
||||
cranelift-codegen = { git = "https://github.com/wasmerio/cranelift.git", rev = "2ada531d79b34a9e6c94c81f2615677e22d68780" }
|
||||
cranelift-entity = { git = "https://github.com/wasmerio/cranelift.git", rev = "2ada531d79b34a9e6c94c81f2615677e22d68780" }
|
||||
cranelift-frontend = { git = "https://github.com/wasmerio/cranelift.git", rev = "2ada531d79b34a9e6c94c81f2615677e22d68780" }
|
||||
cranelift-wasm = { git = "https://github.com/wasmerio/cranelift.git", rev = "2ada531d79b34a9e6c94c81f2615677e22d68780" }
|
||||
hashbrown = "0.1"
|
||||
target-lexicon = "0.4.0"
|
||||
wasmparser = "0.29.2"
|
||||
wasmparser = "0.32.1"
|
||||
byteorder = "1"
|
||||
nix = "0.13.0"
|
||||
libc = "0.2.49"
|
||||
@ -34,7 +34,7 @@ version = "0.0.7"
|
||||
|
||||
[target.'cfg(windows)'.dependencies]
|
||||
winapi = { version = "0.3", features = ["errhandlingapi", "minwindef", "minwinbase", "winnt"] }
|
||||
wasmer-win-exception-handler = { path = "../win-exception-handler", version = "0.5.1" }
|
||||
wasmer-win-exception-handler = { path = "../win-exception-handler", version = "0.5.3" }
|
||||
|
||||
[features]
|
||||
debug = ["wasmer-runtime-core/debug"]
|
||||
|
@ -25,6 +25,7 @@ fn get_isa() -> Box<isa::TargetIsa> {
|
||||
let flags = {
|
||||
let mut builder = settings::builder();
|
||||
builder.set("opt_level", "best").unwrap();
|
||||
builder.set("jump_tables_enabled", "false").unwrap();
|
||||
|
||||
if cfg!(not(test)) {
|
||||
builder.set("enable_verifier", "false").unwrap();
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "wasmer-dev-utils"
|
||||
version = "0.5.1"
|
||||
version = "0.5.3"
|
||||
description = "Wasmer runtime core library"
|
||||
license = "MIT"
|
||||
authors = ["The Wasmer Engineering Team <engineering@wasmer.io>"]
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "wasmer-emscripten"
|
||||
version = "0.5.1"
|
||||
version = "0.5.3"
|
||||
description = "Wasmer runtime emscripten implementation library"
|
||||
license = "MIT"
|
||||
authors = ["The Wasmer Engineering Team <engineering@wasmer.io>"]
|
||||
@ -14,17 +14,17 @@ hashbrown = "0.1"
|
||||
lazy_static = "1.2.0"
|
||||
libc = "0.2.49"
|
||||
time = "0.1.41"
|
||||
wasmer-clif-backend = { path = "../clif-backend", version = "0.5.1" }
|
||||
wasmer-llvm-backend = { path = "../llvm-backend", version = "0.5.1", optional = true }
|
||||
wasmer-runtime-core = { path = "../runtime-core", version = "0.5.1" }
|
||||
wasmer-singlepass-backend = { path = "../singlepass-backend", version = "0.5.1", optional = true }
|
||||
wasmer-clif-backend = { path = "../clif-backend", version = "0.5.3" }
|
||||
wasmer-llvm-backend = { path = "../llvm-backend", version = "0.5.3", optional = true }
|
||||
wasmer-runtime-core = { path = "../runtime-core", version = "0.5.3" }
|
||||
wasmer-singlepass-backend = { path = "../singlepass-backend", version = "0.5.3", optional = true }
|
||||
|
||||
[target.'cfg(windows)'.dependencies]
|
||||
rand = "0.6"
|
||||
|
||||
[dev-dependencies]
|
||||
wabt = "0.7.2"
|
||||
wasmer-dev-utils = { path = "../dev-utils", version = "0.5.1"}
|
||||
wasmer-dev-utils = { path = "../dev-utils", version = "0.5.3"}
|
||||
|
||||
[build-dependencies]
|
||||
glob = "0.2.11"
|
||||
|
@ -15,12 +15,12 @@ pub fn exit_with_live_runtime(_ctx: &mut Ctx) {
|
||||
}
|
||||
|
||||
pub fn setTempRet0(ctx: &mut Ctx, val: i32) {
|
||||
debug!("emscripten::setTempRet0: {}", val);
|
||||
trace!("emscripten::setTempRet0: {}", val);
|
||||
get_emscripten_data(ctx).temp_ret_0 = val;
|
||||
}
|
||||
|
||||
pub fn getTempRet0(ctx: &mut Ctx) -> i32 {
|
||||
debug!("emscripten::getTempRet0");
|
||||
trace!("emscripten::getTempRet0");
|
||||
get_emscripten_data(ctx).temp_ret_0
|
||||
}
|
||||
|
||||
@ -69,7 +69,7 @@ pub fn _dladdr(_ctx: &mut Ctx, _a: i32, _b: i32) -> i32 {
|
||||
0
|
||||
}
|
||||
pub fn _pthread_attr_destroy(_ctx: &mut Ctx, _a: i32) -> i32 {
|
||||
debug!("emscripten::_pthread_attr_destroy");
|
||||
trace!("emscripten::_pthread_attr_destroy");
|
||||
0
|
||||
}
|
||||
pub fn _pthread_attr_getstack(
|
||||
@ -88,136 +88,137 @@ pub fn _pthread_attr_getstack(
|
||||
0
|
||||
}
|
||||
pub fn _pthread_attr_init(_ctx: &mut Ctx, _a: i32) -> i32 {
|
||||
debug!("emscripten::_pthread_attr_init({})", _a);
|
||||
trace!("emscripten::_pthread_attr_init({})", _a);
|
||||
0
|
||||
}
|
||||
pub fn _pthread_attr_setstacksize(_ctx: &mut Ctx, _a: i32, _b: i32) -> i32 {
|
||||
debug!("emscripten::_pthread_attr_setstacksize");
|
||||
trace!("emscripten::_pthread_attr_setstacksize");
|
||||
0
|
||||
}
|
||||
pub fn _pthread_cleanup_pop(_ctx: &mut Ctx, _a: i32) -> () {
|
||||
debug!("emscripten::_pthread_cleanup_pop");
|
||||
trace!("emscripten::_pthread_cleanup_pop");
|
||||
}
|
||||
pub fn _pthread_cleanup_push(_ctx: &mut Ctx, _a: i32, _b: i32) -> () {
|
||||
debug!("emscripten::_pthread_cleanup_push");
|
||||
trace!("emscripten::_pthread_cleanup_push");
|
||||
}
|
||||
pub fn _pthread_cond_destroy(_ctx: &mut Ctx, _a: i32) -> i32 {
|
||||
debug!("emscripten::_pthread_cond_destroy");
|
||||
trace!("emscripten::_pthread_cond_destroy");
|
||||
0
|
||||
}
|
||||
pub fn _pthread_cond_init(_ctx: &mut Ctx, _a: i32, _b: i32) -> i32 {
|
||||
debug!("emscripten::_pthread_cond_init");
|
||||
trace!("emscripten::_pthread_cond_init");
|
||||
0
|
||||
}
|
||||
pub fn _pthread_cond_signal(_ctx: &mut Ctx, _a: i32) -> i32 {
|
||||
debug!("emscripten::_pthread_cond_signal");
|
||||
trace!("emscripten::_pthread_cond_signal");
|
||||
0
|
||||
}
|
||||
pub fn _pthread_cond_timedwait(_ctx: &mut Ctx, _a: i32, _b: i32, _c: i32) -> i32 {
|
||||
debug!("emscripten::_pthread_cond_timedwait");
|
||||
trace!("emscripten::_pthread_cond_timedwait");
|
||||
0
|
||||
}
|
||||
pub fn _pthread_cond_wait(_ctx: &mut Ctx, _a: i32, _b: i32) -> i32 {
|
||||
debug!("emscripten::_pthread_cond_wait");
|
||||
trace!("emscripten::_pthread_cond_wait");
|
||||
0
|
||||
}
|
||||
pub fn _pthread_condattr_destroy(_ctx: &mut Ctx, _a: i32) -> i32 {
|
||||
debug!("emscripten::_pthread_condattr_destroy");
|
||||
trace!("emscripten::_pthread_condattr_destroy");
|
||||
0
|
||||
}
|
||||
pub fn _pthread_condattr_init(_ctx: &mut Ctx, _a: i32) -> i32 {
|
||||
debug!("emscripten::_pthread_condattr_init");
|
||||
trace!("emscripten::_pthread_condattr_init");
|
||||
0
|
||||
}
|
||||
pub fn _pthread_condattr_setclock(_ctx: &mut Ctx, _a: i32, _b: i32) -> i32 {
|
||||
debug!("emscripten::_pthread_condattr_setclock");
|
||||
trace!("emscripten::_pthread_condattr_setclock");
|
||||
0
|
||||
}
|
||||
pub fn _pthread_create(_ctx: &mut Ctx, _a: i32, _b: i32, _c: i32, _d: i32) -> i32 {
|
||||
debug!("emscripten::_pthread_create");
|
||||
0
|
||||
trace!("emscripten::_pthread_create");
|
||||
// 11 seems to mean "no"
|
||||
11
|
||||
}
|
||||
pub fn _pthread_detach(_ctx: &mut Ctx, _a: i32) -> i32 {
|
||||
debug!("emscripten::_pthread_detach");
|
||||
trace!("emscripten::_pthread_detach");
|
||||
0
|
||||
}
|
||||
pub fn _pthread_equal(_ctx: &mut Ctx, _a: i32, _b: i32) -> i32 {
|
||||
debug!("emscripten::_pthread_equal");
|
||||
trace!("emscripten::_pthread_equal");
|
||||
0
|
||||
}
|
||||
pub fn _pthread_exit(_ctx: &mut Ctx, _a: i32) -> () {
|
||||
debug!("emscripten::_pthread_exit");
|
||||
trace!("emscripten::_pthread_exit");
|
||||
}
|
||||
pub fn _pthread_getattr_np(_ctx: &mut Ctx, _thread: i32, _attr: i32) -> i32 {
|
||||
debug!("emscripten::_pthread_getattr_np({}, {})", _thread, _attr);
|
||||
trace!("emscripten::_pthread_getattr_np({}, {})", _thread, _attr);
|
||||
0
|
||||
}
|
||||
pub fn _pthread_getspecific(_ctx: &mut Ctx, _a: i32) -> i32 {
|
||||
debug!("emscripten::_pthread_getspecific");
|
||||
trace!("emscripten::_pthread_getspecific");
|
||||
0
|
||||
}
|
||||
pub fn _pthread_join(_ctx: &mut Ctx, _a: i32, _b: i32) -> i32 {
|
||||
debug!("emscripten::_pthread_join");
|
||||
trace!("emscripten::_pthread_join");
|
||||
0
|
||||
}
|
||||
pub fn _pthread_key_create(_ctx: &mut Ctx, _a: i32, _b: i32) -> i32 {
|
||||
debug!("emscripten::_pthread_key_create");
|
||||
trace!("emscripten::_pthread_key_create");
|
||||
0
|
||||
}
|
||||
pub fn _pthread_mutex_destroy(_ctx: &mut Ctx, _a: i32) -> i32 {
|
||||
debug!("emscripten::_pthread_mutex_destroy");
|
||||
trace!("emscripten::_pthread_mutex_destroy");
|
||||
0
|
||||
}
|
||||
pub fn _pthread_mutex_init(_ctx: &mut Ctx, _a: i32, _b: i32) -> i32 {
|
||||
debug!("emscripten::_pthread_mutex_init");
|
||||
trace!("emscripten::_pthread_mutex_init");
|
||||
0
|
||||
}
|
||||
pub fn _pthread_mutexattr_destroy(_ctx: &mut Ctx, _a: i32) -> i32 {
|
||||
debug!("emscripten::_pthread_mutexattr_destroy");
|
||||
trace!("emscripten::_pthread_mutexattr_destroy");
|
||||
0
|
||||
}
|
||||
pub fn _pthread_mutexattr_init(_ctx: &mut Ctx, _a: i32) -> i32 {
|
||||
debug!("emscripten::_pthread_mutexattr_init");
|
||||
trace!("emscripten::_pthread_mutexattr_init");
|
||||
0
|
||||
}
|
||||
pub fn _pthread_mutexattr_settype(_ctx: &mut Ctx, _a: i32, _b: i32) -> i32 {
|
||||
debug!("emscripten::_pthread_mutexattr_settype");
|
||||
trace!("emscripten::_pthread_mutexattr_settype");
|
||||
0
|
||||
}
|
||||
pub fn _pthread_once(_ctx: &mut Ctx, _a: i32, _b: i32) -> i32 {
|
||||
debug!("emscripten::_pthread_once");
|
||||
trace!("emscripten::_pthread_once");
|
||||
0
|
||||
}
|
||||
pub fn _pthread_rwlock_destroy(_ctx: &mut Ctx, _rwlock: i32) -> i32 {
|
||||
debug!("emscripten::_pthread_rwlock_destroy({})", _rwlock);
|
||||
trace!("emscripten::_pthread_rwlock_destroy({})", _rwlock);
|
||||
0
|
||||
}
|
||||
pub fn _pthread_rwlock_init(_ctx: &mut Ctx, _rwlock: i32, _attr: i32) -> i32 {
|
||||
debug!("emscripten::_pthread_rwlock_init({}, {})", _rwlock, _attr);
|
||||
trace!("emscripten::_pthread_rwlock_init({}, {})", _rwlock, _attr);
|
||||
0
|
||||
}
|
||||
pub fn _pthread_rwlock_rdlock(_ctx: &mut Ctx, _a: i32) -> i32 {
|
||||
debug!("emscripten::_pthread_rwlock_rdlock");
|
||||
trace!("emscripten::_pthread_rwlock_rdlock");
|
||||
0
|
||||
}
|
||||
pub fn _pthread_rwlock_unlock(_ctx: &mut Ctx, _a: i32) -> i32 {
|
||||
debug!("emscripten::_pthread_rwlock_unlock");
|
||||
trace!("emscripten::_pthread_rwlock_unlock");
|
||||
0
|
||||
}
|
||||
pub fn _pthread_rwlock_wrlock(_ctx: &mut Ctx, _rwlock: i32) -> i32 {
|
||||
debug!("emscripten::_pthread_rwlock_wrlock({})", _rwlock);
|
||||
trace!("emscripten::_pthread_rwlock_wrlock({})", _rwlock);
|
||||
0
|
||||
}
|
||||
pub fn _pthread_setcancelstate(_ctx: &mut Ctx, _a: i32, _b: i32) -> i32 {
|
||||
debug!("emscripten::_pthread_setcancelstate");
|
||||
trace!("emscripten::_pthread_setcancelstate");
|
||||
0
|
||||
}
|
||||
pub fn _pthread_setspecific(_ctx: &mut Ctx, _a: i32, _b: i32) -> i32 {
|
||||
debug!("emscripten::_pthread_setspecific");
|
||||
trace!("emscripten::_pthread_setspecific");
|
||||
0
|
||||
}
|
||||
pub fn _pthread_sigmask(_ctx: &mut Ctx, _a: i32, _b: i32, _c: i32) -> i32 {
|
||||
debug!("emscripten::_pthread_sigmask");
|
||||
trace!("emscripten::_pthread_sigmask");
|
||||
0
|
||||
}
|
||||
pub fn ___gxx_personality_v0(
|
||||
@ -233,11 +234,6 @@ pub fn ___gxx_personality_v0(
|
||||
0
|
||||
}
|
||||
|
||||
pub fn _gai_strerror(_ctx: &mut Ctx, _ecode: i32) -> i32 {
|
||||
debug!("emscripten::_gai_strerror({})", _ecode);
|
||||
0
|
||||
}
|
||||
|
||||
#[cfg(target_os = "linux")]
|
||||
pub fn _getdtablesize(_ctx: &mut Ctx) -> i32 {
|
||||
debug!("emscripten::getdtablesize");
|
||||
|
50
lib/emscripten/src/env/mod.rs
vendored
50
lib/emscripten/src/env/mod.rs
vendored
@ -13,18 +13,22 @@ pub use self::windows::*;
|
||||
use libc::c_char;
|
||||
|
||||
use crate::{allocate_on_stack, EmscriptenData};
|
||||
use std::os::raw::c_int;
|
||||
use wasmer_runtime_core::vm::Ctx;
|
||||
|
||||
pub fn _getaddrinfo(_ctx: &mut Ctx, _one: i32, _two: i32, _three: i32, _four: i32) -> i32 {
|
||||
debug!("emscripten::_getaddrinfo");
|
||||
-1
|
||||
}
|
||||
use std::os::raw::c_int;
|
||||
use wasmer_runtime_core::{
|
||||
memory::ptr::{Array, WasmPtr},
|
||||
types::ValueType,
|
||||
vm::Ctx,
|
||||
};
|
||||
|
||||
pub fn call_malloc(ctx: &mut Ctx, size: u32) -> u32 {
|
||||
get_emscripten_data(ctx).malloc.call(size).unwrap()
|
||||
}
|
||||
|
||||
pub fn call_malloc_with_cast<T: Copy, Ty>(ctx: &mut Ctx, size: u32) -> WasmPtr<T, Ty> {
|
||||
WasmPtr::new(get_emscripten_data(ctx).malloc.call(size).unwrap())
|
||||
}
|
||||
|
||||
pub fn call_memalign(ctx: &mut Ctx, alignment: u32, size: u32) -> u32 {
|
||||
if let Some(memalign) = &get_emscripten_data(ctx).memalign {
|
||||
memalign.call(alignment, size).unwrap()
|
||||
@ -152,3 +156,37 @@ pub fn _fpathconf(_ctx: &mut Ctx, _fildes: c_int, name: c_int) -> c_int {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy)]
|
||||
#[repr(C)]
|
||||
pub struct EmAddrInfo {
|
||||
// int
|
||||
pub ai_flags: i32,
|
||||
// int
|
||||
pub ai_family: i32,
|
||||
// int
|
||||
pub ai_socktype: i32,
|
||||
// int
|
||||
pub ai_protocol: i32,
|
||||
// socklen_t
|
||||
pub ai_addrlen: u32,
|
||||
// struct sockaddr*
|
||||
pub ai_addr: WasmPtr<EmSockAddr>,
|
||||
// char*
|
||||
pub ai_canonname: WasmPtr<c_char, Array>,
|
||||
// struct addrinfo*
|
||||
pub ai_next: WasmPtr<EmAddrInfo>,
|
||||
}
|
||||
|
||||
unsafe impl ValueType for EmAddrInfo {}
|
||||
|
||||
// NOTE: from looking at emscripten JS, this should be a union
|
||||
// TODO: review this, highly likely to have bugs
|
||||
#[derive(Debug, Clone, Copy)]
|
||||
#[repr(C)]
|
||||
pub struct EmSockAddr {
|
||||
pub sa_family: i16,
|
||||
pub sa_data: [c_char; 14],
|
||||
}
|
||||
|
||||
unsafe impl ValueType for EmSockAddr {}
|
||||
|
184
lib/emscripten/src/env/unix/mod.rs
vendored
184
lib/emscripten/src/env/unix/mod.rs
vendored
@ -3,13 +3,17 @@ use libc::{
|
||||
c_int, getenv, getgrnam as libc_getgrnam, getpwnam as libc_getpwnam, putenv, setenv, sysconf,
|
||||
unsetenv,
|
||||
};
|
||||
use std::cell::Cell;
|
||||
use std::ffi::CStr;
|
||||
use std::mem;
|
||||
use std::os::raw::c_char;
|
||||
|
||||
use crate::env::call_malloc;
|
||||
use crate::env::{call_malloc, call_malloc_with_cast, EmAddrInfo, EmSockAddr};
|
||||
use crate::utils::{copy_cstr_into_wasm, copy_terminated_array_of_cstrs};
|
||||
use wasmer_runtime_core::vm::Ctx;
|
||||
use wasmer_runtime_core::{
|
||||
memory::ptr::{Array, WasmPtr},
|
||||
vm::Ctx,
|
||||
};
|
||||
|
||||
// #[no_mangle]
|
||||
/// emscripten: _getenv // (name: *const char) -> *const c_char;
|
||||
@ -140,3 +144,179 @@ pub fn _sysconf(_ctx: &mut Ctx, name: c_int) -> i32 {
|
||||
// TODO: Implement like emscripten expects regarding memory/page size
|
||||
unsafe { sysconf(name) as i32 } // TODO review i64
|
||||
}
|
||||
|
||||
// this may be a memory leak, probably not though because emscripten does the same thing
|
||||
pub fn _gai_strerror(ctx: &mut Ctx, ecode: i32) -> i32 {
|
||||
debug!("emscripten::_gai_strerror({})", ecode);
|
||||
|
||||
let cstr = unsafe { std::ffi::CStr::from_ptr(libc::gai_strerror(ecode)) };
|
||||
let bytes = cstr.to_bytes_with_nul();
|
||||
let string_on_guest: WasmPtr<c_char, Array> = call_malloc_with_cast(ctx, bytes.len() as _);
|
||||
|
||||
let writer = unsafe {
|
||||
string_on_guest
|
||||
.deref_mut(ctx.memory(0), 0, bytes.len() as _)
|
||||
.unwrap()
|
||||
};
|
||||
for (i, byte) in bytes.iter().enumerate() {
|
||||
writer[i].set(*byte as i8);
|
||||
}
|
||||
|
||||
string_on_guest.offset() as _
|
||||
}
|
||||
|
||||
pub fn _getaddrinfo(
|
||||
ctx: &mut Ctx,
|
||||
node_ptr: WasmPtr<c_char>,
|
||||
service_str_ptr: WasmPtr<c_char>,
|
||||
hints_ptr: WasmPtr<EmAddrInfo>,
|
||||
res_val_ptr: WasmPtr<WasmPtr<EmAddrInfo>>,
|
||||
) -> i32 {
|
||||
use libc::{addrinfo, freeaddrinfo};
|
||||
debug!("emscripten::_getaddrinfo");
|
||||
let memory = ctx.memory(0);
|
||||
debug!(" => node = {}", unsafe {
|
||||
node_ptr
|
||||
.deref(memory)
|
||||
.map(|np| {
|
||||
std::ffi::CStr::from_ptr(np as *const Cell<c_char> as *const c_char)
|
||||
.to_string_lossy()
|
||||
})
|
||||
.unwrap_or(std::borrow::Cow::Borrowed("null"))
|
||||
});
|
||||
debug!(" => server_str = {}", unsafe {
|
||||
service_str_ptr
|
||||
.deref(memory)
|
||||
.map(|np| {
|
||||
std::ffi::CStr::from_ptr(np as *const Cell<c_char> as *const c_char)
|
||||
.to_string_lossy()
|
||||
})
|
||||
.unwrap_or(std::borrow::Cow::Borrowed("null"))
|
||||
});
|
||||
|
||||
let hints = hints_ptr.deref(memory).map(|hints_memory| {
|
||||
let hints_guest = hints_memory.get();
|
||||
unsafe {
|
||||
let mut hints_native: addrinfo = std::mem::uninitialized();
|
||||
hints_native.ai_flags = hints_guest.ai_flags;
|
||||
hints_native.ai_family = hints_guest.ai_family;
|
||||
hints_native.ai_socktype = hints_guest.ai_socktype;
|
||||
hints_native.ai_protocol = hints_guest.ai_protocol;
|
||||
hints_native.ai_addrlen = 0;
|
||||
hints_native.ai_addr = std::ptr::null_mut();
|
||||
hints_native.ai_canonname = std::ptr::null_mut();
|
||||
hints_native.ai_next = std::ptr::null_mut();
|
||||
|
||||
hints_native
|
||||
}
|
||||
});
|
||||
|
||||
let mut out_ptr: *mut addrinfo = std::ptr::null_mut();
|
||||
|
||||
// allocate equivalent memory for res_val_ptr
|
||||
let result = unsafe {
|
||||
libc::getaddrinfo(
|
||||
(node_ptr
|
||||
.deref(memory)
|
||||
.map(|m| m as *const Cell<c_char> as *const c_char))
|
||||
.unwrap_or(std::ptr::null()),
|
||||
service_str_ptr
|
||||
.deref(memory)
|
||||
.map(|m| m as *const Cell<c_char> as *const c_char)
|
||||
.unwrap_or(std::ptr::null()),
|
||||
hints
|
||||
.as_ref()
|
||||
.map(|h| h as *const addrinfo)
|
||||
.unwrap_or(std::ptr::null()),
|
||||
&mut out_ptr as *mut *mut addrinfo,
|
||||
)
|
||||
};
|
||||
if result != 0 {
|
||||
return result;
|
||||
}
|
||||
|
||||
// walk linked list and copy over, freeing them from the kernel
|
||||
let head_of_list = unsafe {
|
||||
let mut current_host_node = out_ptr;
|
||||
let mut head_of_list = None;
|
||||
let mut previous_guest_node: Option<WasmPtr<EmAddrInfo>> = None;
|
||||
|
||||
while !current_host_node.is_null() {
|
||||
let current_guest_node_ptr: WasmPtr<EmAddrInfo> =
|
||||
call_malloc_with_cast(ctx, std::mem::size_of::<EmAddrInfo>() as _);
|
||||
if head_of_list.is_none() {
|
||||
head_of_list = Some(current_guest_node_ptr);
|
||||
}
|
||||
|
||||
// connect list
|
||||
if let Some(prev_guest) = previous_guest_node {
|
||||
let mut pg = prev_guest.deref_mut(ctx.memory(0)).unwrap().get_mut();
|
||||
pg.ai_next = current_guest_node_ptr;
|
||||
}
|
||||
|
||||
// update values
|
||||
|
||||
let host_addrlen = (*current_host_node).ai_addrlen;
|
||||
// allocate addr and copy data
|
||||
let guest_sockaddr_ptr = {
|
||||
let host_sockaddr_ptr = (*current_host_node).ai_addr;
|
||||
let guest_sockaddr_ptr: WasmPtr<EmSockAddr> =
|
||||
call_malloc_with_cast(ctx, host_addrlen as _);
|
||||
let guest_sockaddr = guest_sockaddr_ptr
|
||||
.deref_mut(ctx.memory(0))
|
||||
.unwrap()
|
||||
.get_mut();
|
||||
|
||||
guest_sockaddr.sa_family = (*host_sockaddr_ptr).sa_family as i16;
|
||||
guest_sockaddr.sa_data = (*host_sockaddr_ptr).sa_data.clone();
|
||||
guest_sockaddr_ptr
|
||||
};
|
||||
|
||||
// allocate canon name on guest and copy data over
|
||||
let guest_canonname_ptr = {
|
||||
let str_ptr = (*current_host_node).ai_canonname;
|
||||
if !str_ptr.is_null() {
|
||||
let canonname_cstr = std::ffi::CStr::from_ptr(str_ptr);
|
||||
let canonname_bytes = canonname_cstr.to_bytes_with_nul();
|
||||
let str_size = canonname_bytes.len();
|
||||
let guest_canonname: WasmPtr<c_char, Array> =
|
||||
call_malloc_with_cast(ctx, str_size as _);
|
||||
|
||||
let guest_canonname_writer = guest_canonname
|
||||
.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
|
||||
} else {
|
||||
WasmPtr::new(0)
|
||||
}
|
||||
};
|
||||
|
||||
let mut current_guest_node = current_guest_node_ptr
|
||||
.deref_mut(ctx.memory(0))
|
||||
.unwrap()
|
||||
.get_mut();
|
||||
current_guest_node.ai_flags = (*current_host_node).ai_flags;
|
||||
current_guest_node.ai_family = (*current_host_node).ai_family;
|
||||
current_guest_node.ai_socktype = (*current_host_node).ai_socktype;
|
||||
current_guest_node.ai_protocol = (*current_host_node).ai_protocol;
|
||||
current_guest_node.ai_addrlen = host_addrlen;
|
||||
current_guest_node.ai_addr = guest_sockaddr_ptr;
|
||||
current_guest_node.ai_canonname = guest_canonname_ptr;
|
||||
current_guest_node.ai_next = WasmPtr::new(0);
|
||||
|
||||
previous_guest_node = Some(current_guest_node_ptr);
|
||||
current_host_node = (*current_host_node).ai_next;
|
||||
}
|
||||
// this frees all connected nodes on the linked list
|
||||
freeaddrinfo(out_ptr);
|
||||
head_of_list.unwrap_or(WasmPtr::new(0))
|
||||
};
|
||||
|
||||
res_val_ptr.deref(ctx.memory(0)).unwrap().set(head_of_list);
|
||||
|
||||
0
|
||||
}
|
||||
|
20
lib/emscripten/src/env/windows/mod.rs
vendored
20
lib/emscripten/src/env/windows/mod.rs
vendored
@ -5,9 +5,9 @@ use std::ffi::CString;
|
||||
use std::mem;
|
||||
use std::os::raw::c_char;
|
||||
|
||||
use crate::env::call_malloc;
|
||||
use crate::env::{call_malloc, EmAddrInfo};
|
||||
use crate::utils::{copy_cstr_into_wasm, read_string_from_wasm};
|
||||
use wasmer_runtime_core::vm::Ctx;
|
||||
use wasmer_runtime_core::{memory::ptr::WasmPtr, vm::Ctx};
|
||||
|
||||
extern "C" {
|
||||
#[link_name = "_putenv"]
|
||||
@ -131,3 +131,19 @@ pub fn _sysconf(_ctx: &mut Ctx, name: c_int) -> c_long {
|
||||
// stub because sysconf is not valid on windows
|
||||
0
|
||||
}
|
||||
|
||||
pub fn _gai_strerror(_ctx: &mut Ctx, _ecode: i32) -> i32 {
|
||||
debug!("emscripten::_gai_strerror({}) - stub", _ecode);
|
||||
-1
|
||||
}
|
||||
|
||||
pub fn _getaddrinfo(
|
||||
_ctx: &mut Ctx,
|
||||
_node_ptr: WasmPtr<c_char>,
|
||||
_service_str_ptr: WasmPtr<c_char>,
|
||||
_hints_ptr: WasmPtr<EmAddrInfo>,
|
||||
_res_val_ptr: WasmPtr<WasmPtr<EmAddrInfo>>,
|
||||
) -> i32 {
|
||||
debug!("emscripten::_getaddrinfo -- stub");
|
||||
-1
|
||||
}
|
||||
|
@ -893,7 +893,7 @@ pub fn generate_emscripten_env(globals: &mut EmscriptenGlobals) -> ImportObject
|
||||
"_pthread_setspecific" => func!(crate::emscripten_target::_pthread_setspecific),
|
||||
"_pthread_sigmask" => func!(crate::emscripten_target::_pthread_sigmask),
|
||||
"___gxx_personality_v0" => func!(crate::emscripten_target::___gxx_personality_v0),
|
||||
"_gai_strerror" => func!(crate::emscripten_target::_gai_strerror),
|
||||
"_gai_strerror" => func!(crate::env::_gai_strerror),
|
||||
"_getdtablesize" => func!(crate::emscripten_target::_getdtablesize),
|
||||
"_gethostbyaddr" => func!(crate::emscripten_target::_gethostbyaddr),
|
||||
"_gethostbyname" => func!(crate::emscripten_target::_gethostbyname),
|
||||
|
@ -21,9 +21,9 @@ pub fn _emscripten_memcpy_big(ctx: &mut Ctx, dest: u32, src: u32, len: u32) -> u
|
||||
|
||||
/// emscripten: _emscripten_get_heap_size
|
||||
pub fn _emscripten_get_heap_size(ctx: &mut Ctx) -> u32 {
|
||||
debug!("emscripten::_emscripten_get_heap_size");
|
||||
trace!("emscripten::_emscripten_get_heap_size");
|
||||
let result = ctx.memory(0).size().bytes().0 as u32;
|
||||
debug!("=> {}", result);
|
||||
trace!("=> {}", result);
|
||||
|
||||
result
|
||||
}
|
||||
|
@ -276,34 +276,6 @@ pub fn ___syscall75(_ctx: &mut Ctx, _one: i32, _two: i32) -> i32 {
|
||||
-1
|
||||
}
|
||||
|
||||
// readlink
|
||||
pub fn ___syscall85(ctx: &mut Ctx, _which: c_int, mut varargs: VarArgs) -> i32 {
|
||||
debug!("emscripten::___syscall85 (readlink)");
|
||||
let _path = varargs.get_str(ctx);
|
||||
let buf = varargs.get_str(ctx);
|
||||
// let buf_addr: i32 = varargs.get(ctx);
|
||||
let buf_size: i32 = varargs.get(ctx);
|
||||
let fd = 3;
|
||||
let ret = unsafe { read(fd, buf as _, buf_size as _) as i32 };
|
||||
debug!(
|
||||
"=> buf: {}, buf_size: {}, return: {} ",
|
||||
unsafe { std::ffi::CStr::from_ptr(buf as _).to_str().unwrap() },
|
||||
buf_size,
|
||||
ret
|
||||
);
|
||||
// let ret = unsafe {
|
||||
// readlink(path, buf as _, buf_size as _) as i32
|
||||
// };
|
||||
// debug!("=> path: {}, buf: {}, buf_size: {}, return: {} ",
|
||||
// unsafe { std::ffi::CStr::from_ptr(path).to_str().unwrap() },
|
||||
// unsafe { std::ffi::CStr::from_ptr(buf as _).to_str().unwrap() },
|
||||
// // std::ffi::CStr::from_ptr(buf).to_str().unwrap(),
|
||||
// // buf,
|
||||
// buf_size,
|
||||
// ret);
|
||||
ret
|
||||
}
|
||||
|
||||
pub fn ___syscall91(_ctx: &mut Ctx, _one: i32, _two: i32) -> i32 {
|
||||
debug!("emscripten::___syscall91 - stub");
|
||||
0
|
||||
@ -531,11 +503,6 @@ pub fn ___syscall146(ctx: &mut Ctx, _which: i32, mut varargs: VarArgs) -> i32 {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn ___syscall168(_ctx: &mut Ctx, _one: i32, _two: i32) -> i32 {
|
||||
debug!("emscripten::___syscall168 - stub");
|
||||
-1
|
||||
}
|
||||
|
||||
pub fn ___syscall191(ctx: &mut Ctx, _which: i32, mut varargs: VarArgs) -> i32 {
|
||||
let _resource: i32 = varargs.get(ctx);
|
||||
debug!(
|
||||
|
@ -7,7 +7,6 @@ use libc::{
|
||||
accept,
|
||||
access,
|
||||
bind,
|
||||
c_char,
|
||||
c_int,
|
||||
c_void,
|
||||
chown,
|
||||
@ -72,15 +71,15 @@ use libc::{
|
||||
F_GETFD,
|
||||
F_SETFD,
|
||||
SOL_SOCKET,
|
||||
SO_REUSEADDR,
|
||||
TIOCGWINSZ,
|
||||
};
|
||||
|
||||
#[allow(unused_imports)]
|
||||
use std::ffi::CStr;
|
||||
use wasmer_runtime_core::vm::Ctx;
|
||||
use wasmer_runtime_core::{memory::ptr::WasmPtr, vm::Ctx};
|
||||
|
||||
use crate::utils;
|
||||
use crate::env::EmSockAddr;
|
||||
use crate::utils::{self, get_cstr_path};
|
||||
#[allow(unused_imports)]
|
||||
use std::io::Error;
|
||||
use std::mem;
|
||||
@ -92,7 +91,7 @@ extern "C" {
|
||||
pub fn wait4(pid: pid_t, status: *mut c_int, options: c_int, rusage: *mut rusage) -> pid_t;
|
||||
pub fn madvise(addr: *mut c_void, len: size_t, advice: c_int) -> c_int;
|
||||
pub fn fdatasync(fd: c_int) -> c_int;
|
||||
pub fn lstat64(path: *const c_char, buf: *mut c_void) -> c_int;
|
||||
pub fn lstat64(path: *const libc::c_char, buf: *mut c_void) -> c_int;
|
||||
}
|
||||
|
||||
#[cfg(not(target_os = "macos"))]
|
||||
@ -101,9 +100,9 @@ use libc::{fallocate, fdatasync, ftruncate64, lstat, madvise, wait4};
|
||||
// Another conditional constant for name resolution: Macos et iOS use
|
||||
// SO_NOSIGPIPE as a setsockopt flag to disable SIGPIPE emission on socket.
|
||||
// Other platforms do otherwise.
|
||||
#[cfg(target_os = "darwin")]
|
||||
#[cfg(target_os = "macos")]
|
||||
use libc::SO_NOSIGPIPE;
|
||||
#[cfg(not(target_os = "darwin"))]
|
||||
#[cfg(not(target_os = "macos"))]
|
||||
const SO_NOSIGPIPE: c_int = 0;
|
||||
|
||||
/// open
|
||||
@ -187,6 +186,35 @@ pub fn ___syscall83(ctx: &mut Ctx, _which: c_int, mut varargs: VarArgs) -> c_int
|
||||
result
|
||||
}
|
||||
|
||||
/// readlink
|
||||
pub fn ___syscall85(ctx: &mut Ctx, _which: c_int, mut varargs: VarArgs) -> i32 {
|
||||
debug!("emscripten::___syscall85 (readlink)");
|
||||
let pathname_addr = varargs.get_str(ctx);
|
||||
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 = if let Some(ref rp) = real_path_owned {
|
||||
rp.as_c_str().as_ptr()
|
||||
} else {
|
||||
pathname_addr
|
||||
};
|
||||
|
||||
let ret = unsafe { libc::readlink(real_path, buf as _, buf_size as _) as i32 };
|
||||
if ret == -1 {
|
||||
debug!("readlink failed");
|
||||
return ret;
|
||||
}
|
||||
debug!(
|
||||
"=> path: {}, buf: {}, buf_size: {}, return: {} ",
|
||||
unsafe { std::ffi::CStr::from_ptr(real_path).to_str().unwrap() },
|
||||
unsafe { std::ffi::CStr::from_ptr(buf as _).to_str().unwrap() },
|
||||
buf_size,
|
||||
ret
|
||||
);
|
||||
ret
|
||||
}
|
||||
|
||||
/// ftruncate64
|
||||
pub fn ___syscall194(ctx: &mut Ctx, _which: c_int, mut varargs: VarArgs) -> c_int {
|
||||
debug!("emscripten::___syscall194 (ftruncate64) {}", _which);
|
||||
@ -434,6 +462,9 @@ pub fn ___syscall54(ctx: &mut Ctx, _which: c_int, mut varargs: VarArgs) -> c_int
|
||||
}
|
||||
}
|
||||
|
||||
const SOCK_NON_BLOCK: i32 = 2048;
|
||||
const SOCK_CLOEXC: i32 = 0x80000;
|
||||
|
||||
// socketcall
|
||||
#[allow(clippy::cast_ptr_alignment)]
|
||||
pub fn ___syscall102(ctx: &mut Ctx, _which: c_int, mut varargs: VarArgs) -> c_int {
|
||||
@ -441,6 +472,7 @@ pub fn ___syscall102(ctx: &mut Ctx, _which: c_int, mut varargs: VarArgs) -> c_in
|
||||
let call: u32 = varargs.get(ctx);
|
||||
let mut socket_varargs: VarArgs = varargs.get(ctx);
|
||||
|
||||
// migrating to EmSockAddr, port being separate here is nice, should update that too
|
||||
#[repr(C)]
|
||||
pub struct GuestSockaddrIn {
|
||||
pub sin_family: sa_family_t, // u16
|
||||
@ -455,26 +487,29 @@ pub fn ___syscall102(ctx: &mut Ctx, _which: c_int, mut varargs: VarArgs) -> c_in
|
||||
pub s_addr: in_addr_t, // u32
|
||||
}
|
||||
|
||||
// debug!("GuestSockaddrIn = {}", size_of::<GuestSockaddrIn>());
|
||||
|
||||
pub struct LinuxSockAddr {
|
||||
pub sa_family: u16,
|
||||
pub sa_data: [c_char; 14],
|
||||
}
|
||||
|
||||
match call {
|
||||
1 => {
|
||||
debug!("socket: socket");
|
||||
// socket (domain: c_int, ty: c_int, protocol: c_int) -> c_int
|
||||
let domain: i32 = socket_varargs.get(ctx);
|
||||
let ty: i32 = socket_varargs.get(ctx);
|
||||
let ty_and_flags: i32 = socket_varargs.get(ctx);
|
||||
let protocol: i32 = socket_varargs.get(ctx);
|
||||
let ty = ty_and_flags & (!SOCK_NON_BLOCK) & (!SOCK_CLOEXC);
|
||||
let fd = unsafe { socket(domain, ty, protocol) };
|
||||
|
||||
if ty_and_flags & SOCK_CLOEXC != 0 {
|
||||
// set_cloexec
|
||||
unsafe {
|
||||
ioctl(fd, FIOCLEX);
|
||||
};
|
||||
}
|
||||
|
||||
if ty_and_flags & SOCK_NON_BLOCK != 0 {
|
||||
// do something here
|
||||
unimplemented!("non blocking sockets");
|
||||
}
|
||||
|
||||
// why is this here?
|
||||
type T = u32;
|
||||
let payload = 1 as *const T as _;
|
||||
unsafe {
|
||||
@ -488,7 +523,7 @@ pub fn ___syscall102(ctx: &mut Ctx, _which: c_int, mut varargs: VarArgs) -> c_in
|
||||
};
|
||||
|
||||
debug!(
|
||||
"=> domain: {} (AF_INET/2), type: {} (SOCK_STREAM/1), protocol: {} = fd: {}",
|
||||
"=> domain: {}, type: {}, protocol: {} = fd: {}",
|
||||
domain, ty, protocol, fd
|
||||
);
|
||||
fd as _
|
||||
@ -543,47 +578,75 @@ pub fn ___syscall102(ctx: &mut Ctx, _which: c_int, mut varargs: VarArgs) -> c_in
|
||||
5 => {
|
||||
debug!("socket: accept");
|
||||
// accept (socket: c_int, address: *mut sockaddr, address_len: *mut socklen_t) -> c_int
|
||||
let socket = socket_varargs.get(ctx);
|
||||
let address_addr: u32 = socket_varargs.get(ctx);
|
||||
let address_len: u32 = socket_varargs.get(ctx);
|
||||
let address = emscripten_memory_pointer!(ctx.memory(0), address_addr) as *mut sockaddr;
|
||||
let socket: i32 = socket_varargs.get(ctx);
|
||||
let address: WasmPtr<EmSockAddr> = socket_varargs.get(ctx);
|
||||
let address_len: WasmPtr<u32> = socket_varargs.get(ctx);
|
||||
|
||||
debug!(
|
||||
"=> socket: {}, address: {:?}, address_len: {}",
|
||||
socket, address, address_len
|
||||
socket,
|
||||
address.deref(ctx.memory(0)).unwrap().get(),
|
||||
address_len.deref(ctx.memory(0)).unwrap().get()
|
||||
);
|
||||
let address_len_addr =
|
||||
emscripten_memory_pointer!(ctx.memory(0), address_len) as *mut socklen_t;
|
||||
unsafe { address_len.deref_mut(ctx.memory(0)).unwrap().get_mut() };
|
||||
// let mut address_len_addr: socklen_t = 0;
|
||||
|
||||
let fd = unsafe { accept(socket, address, address_len_addr) };
|
||||
let (fd, host_address) = unsafe {
|
||||
let mut host_address: sockaddr = std::mem::uninitialized();
|
||||
let fd = accept(socket, &mut host_address, address_len_addr);
|
||||
|
||||
unsafe {
|
||||
let address_linux =
|
||||
emscripten_memory_pointer!(ctx.memory(0), address_addr) as *mut LinuxSockAddr;
|
||||
(*address_linux).sa_family = (*address).sa_family as u16;
|
||||
(*address_linux).sa_data = (*address).sa_data;
|
||||
(fd, host_address)
|
||||
};
|
||||
|
||||
let address_addr = unsafe { address.deref_mut(ctx.memory(0)).unwrap().get_mut() };
|
||||
|
||||
address_addr.sa_family = host_address.sa_family as _;
|
||||
address_addr.sa_data = host_address.sa_data.clone();
|
||||
|
||||
// why is this here?
|
||||
// set_cloexec
|
||||
unsafe {
|
||||
ioctl(fd, FIOCLEX);
|
||||
};
|
||||
|
||||
debug!("fd: {}", fd);
|
||||
debug!(
|
||||
"address: {:?}, len: {}, result fd = {}",
|
||||
address_addr, address_len_addr, fd
|
||||
);
|
||||
|
||||
fd as _
|
||||
}
|
||||
6 => {
|
||||
debug!("socket: getsockname");
|
||||
// getsockname (socket: c_int, address: *mut sockaddr, address_len: *mut socklen_t) -> c_int
|
||||
let socket = socket_varargs.get(ctx);
|
||||
let address: u32 = socket_varargs.get(ctx);
|
||||
let address_len: u32 = socket_varargs.get(ctx);
|
||||
let address = emscripten_memory_pointer!(ctx.memory(0), address) as *mut sockaddr;
|
||||
let socket: i32 = socket_varargs.get(ctx);
|
||||
let address: WasmPtr<EmSockAddr> = socket_varargs.get(ctx);
|
||||
let address_len: WasmPtr<u32> = socket_varargs.get(ctx);
|
||||
let address_len_addr =
|
||||
emscripten_memory_pointer!(ctx.memory(0), address_len) as *mut socklen_t;
|
||||
unsafe { getsockname(socket, address, address_len_addr) }
|
||||
unsafe { address_len.deref_mut(ctx.memory(0)).unwrap().get_mut() };
|
||||
|
||||
let (ret, sock_addr_host) = unsafe {
|
||||
// read host data into new var
|
||||
let mut address: sockaddr = std::mem::uninitialized();
|
||||
let ret = getsockname(
|
||||
socket,
|
||||
&mut address as *mut sockaddr,
|
||||
address_len_addr as *mut u32,
|
||||
);
|
||||
(ret, address)
|
||||
};
|
||||
// translate from host data into emscripten data
|
||||
let mut address_mut = unsafe { address.deref_mut(ctx.memory(0)).unwrap().get_mut() };
|
||||
address_mut.sa_family = sock_addr_host.sa_family as _;
|
||||
address_mut.sa_data = sock_addr_host.sa_data.clone();
|
||||
|
||||
debug!(
|
||||
"=> socket: {}, address, {:?}, address_len: {}, result = {}",
|
||||
socket, address_mut, address_len_addr, ret
|
||||
);
|
||||
|
||||
ret
|
||||
}
|
||||
7 => {
|
||||
debug!("socket: getpeername");
|
||||
@ -635,25 +698,23 @@ pub fn ___syscall102(ctx: &mut Ctx, _which: c_int, mut varargs: VarArgs) -> c_in
|
||||
}
|
||||
14 => {
|
||||
debug!("socket: setsockopt");
|
||||
// NOTE: Emscripten seems to be passing the wrong values to this syscall
|
||||
// level: Em passes 1 as SOL_SOCKET; SOL_SOCKET is 0xffff in BSD
|
||||
// name: Em passes SO_ACCEPTCONN, but Nginx complains about REUSEADDR
|
||||
// OSX and BSD have completely different values, be very careful here
|
||||
// https://github.com/openbsd/src/blob/master/sys/sys/socket.h#L156
|
||||
// setsockopt (socket: c_int, level: c_int, name: c_int, value: *const c_void, option_len: socklen_t) -> c_int
|
||||
|
||||
let socket = socket_varargs.get(ctx);
|
||||
// SOL_SOCKET = 0xffff (BSD, Linux)
|
||||
let level: i32 = SOL_SOCKET;
|
||||
let _: u32 = socket_varargs.get(ctx);
|
||||
// SO_REUSEADDR = 0x4 (BSD, Linux)
|
||||
let name: i32 = SO_REUSEADDR;
|
||||
let _: u32 = socket_varargs.get(ctx);
|
||||
let level: i32 = socket_varargs.get(ctx);
|
||||
let level = if level == 1 { SOL_SOCKET } else { level };
|
||||
let untranslated_name: i32 = socket_varargs.get(ctx);
|
||||
let value: u32 = socket_varargs.get(ctx);
|
||||
let option_len = socket_varargs.get(ctx);
|
||||
let value_addr = emscripten_memory_pointer!(ctx.memory(0), value) as _; // Endian problem
|
||||
let option_len: u32 = socket_varargs.get(ctx);
|
||||
let value_addr =
|
||||
emscripten_memory_pointer!(ctx.memory(0), value) as *const libc::c_void;
|
||||
let name: i32 = translate_socket_name_flag(untranslated_name);
|
||||
|
||||
let ret = unsafe { setsockopt(socket, level, name, value_addr, option_len) };
|
||||
|
||||
debug!("=> socketfd: {}, level: {} (SOL_SOCKET/0xffff), name: {} (SO_REUSEADDR/4), value_addr: {:?}, option_len: {} = status: {}", socket, level, name, value_addr, option_len, ret);
|
||||
debug!("=> socketfd: {}, level: {}, name: {}, value_addr: {:?}, option_len: {} = status: {}", socket, level, untranslated_name, value_addr, option_len, ret);
|
||||
ret
|
||||
}
|
||||
15 => {
|
||||
@ -661,7 +722,9 @@ pub fn ___syscall102(ctx: &mut Ctx, _which: c_int, mut varargs: VarArgs) -> c_in
|
||||
// getsockopt (sockfd: c_int, level: c_int, optname: c_int, optval: *mut c_void, optlen: *mut socklen_t) -> c_int
|
||||
let socket = socket_varargs.get(ctx);
|
||||
let level: i32 = socket_varargs.get(ctx);
|
||||
let name: i32 = socket_varargs.get(ctx);
|
||||
let level = if level == 1 { SOL_SOCKET } else { level };
|
||||
let untranslated_name: i32 = socket_varargs.get(ctx);
|
||||
let name: i32 = translate_socket_name_flag(untranslated_name);
|
||||
let value: u32 = socket_varargs.get(ctx);
|
||||
let option_len: u32 = socket_varargs.get(ctx);
|
||||
let value_addr = emscripten_memory_pointer!(ctx.memory(0), value) as _;
|
||||
@ -694,6 +757,60 @@ pub fn ___syscall102(ctx: &mut Ctx, _which: c_int, mut varargs: VarArgs) -> c_in
|
||||
}
|
||||
}
|
||||
|
||||
/// OSX and BSD have completely different values, we must translate from emscripten's Linuxy
|
||||
/// value into one that we can pass to native syscalls
|
||||
fn translate_socket_name_flag(name: i32) -> i32 {
|
||||
match name {
|
||||
2 => libc::SO_REUSEADDR,
|
||||
3 => libc::SO_TYPE,
|
||||
4 => libc::SO_ERROR,
|
||||
5 => libc::SO_DONTROUTE,
|
||||
6 => libc::SO_BROADCAST,
|
||||
7 => libc::SO_SNDBUF,
|
||||
8 => libc::SO_RCVBUF,
|
||||
9 => libc::SO_KEEPALIVE,
|
||||
10 => libc::SO_OOBINLINE,
|
||||
13 => libc::SO_LINGER,
|
||||
18 => libc::SO_RCVLOWAT,
|
||||
19 => libc::SO_SNDLOWAT,
|
||||
20 => libc::SO_RCVTIMEO,
|
||||
21 => libc::SO_SNDTIMEO,
|
||||
// SO_DEBUG missing
|
||||
30 => libc::SO_ACCEPTCONN,
|
||||
otherwise => otherwise,
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
#[repr(C)]
|
||||
pub struct EmPollFd {
|
||||
pub fd: i32,
|
||||
pub events: i16,
|
||||
pub revents: i16,
|
||||
}
|
||||
|
||||
unsafe impl wasmer_runtime_core::types::ValueType for EmPollFd {}
|
||||
|
||||
/// poll
|
||||
pub fn ___syscall168(ctx: &mut Ctx, _which: i32, mut varargs: VarArgs) -> i32 {
|
||||
debug!("emscripten::___syscall168(poll)");
|
||||
let fds: WasmPtr<EmPollFd> = varargs.get(ctx);
|
||||
let nfds: u32 = varargs.get(ctx);
|
||||
let timeout: i32 = varargs.get(ctx);
|
||||
|
||||
let fds_mut = unsafe { fds.deref_mut(ctx.memory(0)).unwrap().get_mut() };
|
||||
|
||||
let ret = unsafe {
|
||||
libc::poll(
|
||||
fds_mut as *mut EmPollFd as *mut libc::pollfd,
|
||||
nfds as _,
|
||||
timeout,
|
||||
)
|
||||
};
|
||||
|
||||
ret
|
||||
}
|
||||
|
||||
// pread
|
||||
pub fn ___syscall180(ctx: &mut Ctx, _which: c_int, mut varargs: VarArgs) -> c_int {
|
||||
debug!("emscripten::___syscall180 (pread) {}", _which);
|
||||
@ -873,11 +990,11 @@ pub fn ___syscall220(ctx: &mut Ctx, _which: i32, mut varargs: VarArgs) -> i32 {
|
||||
|
||||
let dirp = emscripten_memory_pointer!(ctx.memory(0), dirp_addr) as *mut u8;
|
||||
|
||||
let mut opened_dirs = &mut get_emscripten_data(ctx).opened_dirs;
|
||||
let opened_dirs = &mut get_emscripten_data(ctx).opened_dirs;
|
||||
|
||||
// need to persist stream across calls?
|
||||
// let dir: *mut libc::DIR = unsafe { libc::fdopendir(fd) };
|
||||
let mut dir = &*opened_dirs
|
||||
let dir = &*opened_dirs
|
||||
.entry(fd)
|
||||
.or_insert_with(|| unsafe { Box::new(libc::fdopendir(fd)) });
|
||||
|
||||
|
@ -128,6 +128,12 @@ pub fn ___syscall83(_ctx: &mut Ctx, _which: c_int, _varargs: VarArgs) -> c_int {
|
||||
unimplemented!()
|
||||
}
|
||||
|
||||
/// readlink
|
||||
pub fn ___syscall85(_ctx: &mut Ctx, _which: c_int, _varargs: VarArgs) -> c_int {
|
||||
debug!("emscripten::___syscall85 (readlink) {}", _which);
|
||||
-1
|
||||
}
|
||||
|
||||
/// lchown
|
||||
pub fn ___syscall198(_ctx: &mut Ctx, _which: c_int, _varargs: VarArgs) -> c_int {
|
||||
debug!("emscripten::___syscall198 (lchown) {}", _which);
|
||||
@ -255,6 +261,12 @@ pub fn ___syscall122(_ctx: &mut Ctx, which: c_int, mut _varargs: VarArgs) -> c_i
|
||||
-1
|
||||
}
|
||||
|
||||
/// poll
|
||||
pub fn ___syscall168(_ctx: &mut Ctx, _which: i32, _varargs: VarArgs) -> i32 {
|
||||
debug!("emscripten::___syscall168(poll) - stub");
|
||||
-1
|
||||
}
|
||||
|
||||
/// lstat64
|
||||
pub fn ___syscall196(_ctx: &mut Ctx, _one: i32, _two: i32) -> i32 {
|
||||
debug!("emscripten::___syscall196 (lstat64) - stub");
|
||||
|
@ -1,13 +1,13 @@
|
||||
[package]
|
||||
name = "wasmer-llvm-backend"
|
||||
version = "0.5.1"
|
||||
version = "0.5.3"
|
||||
authors = ["Lachlan Sneff <lachlan.sneff@gmail.com>"]
|
||||
edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
wasmer-runtime-core = { path = "../runtime-core", version = "0.5.1" }
|
||||
wasmer-runtime-core = { path = "../runtime-core", version = "0.5.3" }
|
||||
inkwell = { git = "https://github.com/wasmerio/inkwell", branch = "llvm7-0" }
|
||||
wasmparser = "0.29.2"
|
||||
wasmparser = "0.32.1"
|
||||
hashbrown = "0.1.8"
|
||||
smallvec = "0.6.8"
|
||||
goblin = "0.0.20"
|
||||
|
@ -24,7 +24,7 @@ use wasmparser::{BinaryReaderError, MemoryImmediate, Operator, Type as WpType};
|
||||
|
||||
use crate::backend::LLVMBackend;
|
||||
use crate::intrinsics::{CtxType, GlobalCache, Intrinsics, MemoryCache};
|
||||
use crate::read_info::type_to_type;
|
||||
use crate::read_info::{blocktype_to_type, type_to_type};
|
||||
use crate::state::{ControlFrame, IfElseState, State};
|
||||
use crate::trampolines::generate_trampolines;
|
||||
|
||||
@ -525,7 +525,7 @@ impl FunctionCodeGenerator<CodegenError> for LLVMFunctionCodeGenerator {
|
||||
let end_block = context.append_basic_block(&function, "end");
|
||||
builder.position_at_end(&end_block);
|
||||
|
||||
let phis = if let Ok(wasmer_ty) = type_to_type(ty) {
|
||||
let phis = if let Ok(wasmer_ty) = blocktype_to_type(ty) {
|
||||
let llvm_ty = type_to_llvm(intrinsics, wasmer_ty);
|
||||
[llvm_ty]
|
||||
.iter()
|
||||
@ -545,7 +545,7 @@ impl FunctionCodeGenerator<CodegenError> for LLVMFunctionCodeGenerator {
|
||||
builder.build_unconditional_branch(&loop_body);
|
||||
|
||||
builder.position_at_end(&loop_next);
|
||||
let phis = if let Ok(wasmer_ty) = type_to_type(ty) {
|
||||
let phis = if let Ok(wasmer_ty) = blocktype_to_type(ty) {
|
||||
let llvm_ty = type_to_llvm(intrinsics, wasmer_ty);
|
||||
[llvm_ty]
|
||||
.iter()
|
||||
@ -680,7 +680,7 @@ impl FunctionCodeGenerator<CodegenError> for LLVMFunctionCodeGenerator {
|
||||
let end_phis = {
|
||||
builder.position_at_end(&end_block);
|
||||
|
||||
let phis = if let Ok(wasmer_ty) = type_to_type(ty) {
|
||||
let phis = if let Ok(wasmer_ty) = blocktype_to_type(ty) {
|
||||
let llvm_ty = type_to_llvm(intrinsics, wasmer_ty);
|
||||
[llvm_ty]
|
||||
.iter()
|
||||
|
@ -1,5 +1,5 @@
|
||||
use wasmer_runtime_core::types::Type;
|
||||
use wasmparser::{BinaryReaderError, Type as WpType};
|
||||
use wasmparser::{BinaryReaderError, Type as WpType, TypeOrFuncType as WpTypeOrFuncType};
|
||||
|
||||
pub fn type_to_type(ty: WpType) -> Result<Type, BinaryReaderError> {
|
||||
Ok(match ty {
|
||||
@ -21,3 +21,16 @@ pub fn type_to_type(ty: WpType) -> Result<Type, BinaryReaderError> {
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
pub fn blocktype_to_type(ty: WpTypeOrFuncType) -> Result<Type, BinaryReaderError> {
|
||||
match ty {
|
||||
WpTypeOrFuncType::Type(inner_ty) => type_to_type(inner_ty),
|
||||
_ => {
|
||||
return Err(BinaryReaderError {
|
||||
message:
|
||||
"the wasmer llvm backend does not yet support the multi-value return extension",
|
||||
offset: -1isize as usize,
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "wasmer-middleware-common"
|
||||
version = "0.5.1"
|
||||
version = "0.5.3"
|
||||
repository = "https://github.com/wasmerio/wasmer"
|
||||
description = "Wasmer runtime common middlewares"
|
||||
license = "MIT"
|
||||
@ -9,9 +9,9 @@ edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
wasmer-runtime-core = { path = "../runtime-core" }
|
||||
wasmer-clif-backend = { path = "../clif-backend", version = "0.5.1" }
|
||||
wasmer-llvm-backend = { path = "../llvm-backend", version = "0.5.1", optional = true }
|
||||
wasmer-singlepass-backend = { path = "../singlepass-backend", version = "0.5.1", optional = true }
|
||||
wasmer-clif-backend = { path = "../clif-backend", version = "0.5.3" }
|
||||
wasmer-llvm-backend = { path = "../llvm-backend", version = "0.5.3", optional = true }
|
||||
wasmer-singlepass-backend = { path = "../singlepass-backend", version = "0.5.3", optional = true }
|
||||
|
||||
[dev-dependencies]
|
||||
wabt = "0.7.4"
|
||||
|
@ -2,7 +2,7 @@ use wasmer_runtime_core::{
|
||||
codegen::{Event, EventSink, FunctionMiddleware, InternalEvent},
|
||||
module::ModuleInfo,
|
||||
vm::{Ctx, InternalField},
|
||||
wasmparser::{Operator, Type as WpType},
|
||||
wasmparser::{Operator, Type as WpType, TypeOrFuncType as WpTypeOrFuncType},
|
||||
Instance,
|
||||
};
|
||||
|
||||
@ -92,7 +92,7 @@ impl FunctionMiddleware for Metering {
|
||||
}));
|
||||
sink.push(Event::WasmOwned(Operator::I64GeU));
|
||||
sink.push(Event::WasmOwned(Operator::If {
|
||||
ty: WpType::EmptyBlockType,
|
||||
ty: WpTypeOrFuncType::Type(WpType::EmptyBlockType),
|
||||
}));
|
||||
sink.push(Event::Internal(InternalEvent::Breakpoint(Box::new(|_| {
|
||||
Err(Box::new(ExecutionLimitExceededError))
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "wasmer-runtime-abi"
|
||||
version = "0.5.1"
|
||||
version = "0.5.3"
|
||||
description = "Wasmer runtime core library"
|
||||
license = "MIT"
|
||||
authors = ["The Wasmer Engineering Team <engineering@wasmer.io>"]
|
||||
@ -13,7 +13,7 @@ wasmer-runtime-core = { path = "../runtime-core" }
|
||||
hashbrown = "0.1"
|
||||
failure = "0.1"
|
||||
tar = "0.4"
|
||||
wasmparser = "0.29.2"
|
||||
wasmparser = "0.32.1"
|
||||
zstd = "0.4"
|
||||
|
||||
# [target.'cfg(unix)'.dependencies.zbox]
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "wasmer-runtime-c-api"
|
||||
version = "0.5.1"
|
||||
version = "0.5.3"
|
||||
description = "Wasmer C API library"
|
||||
license = "MIT"
|
||||
authors = ["The Wasmer Engineering Team <engineering@wasmer.io>"]
|
||||
@ -16,11 +16,11 @@ libc = "0.2"
|
||||
|
||||
[dependencies.wasmer-runtime]
|
||||
path = "../runtime"
|
||||
version = "0.5.1"
|
||||
version = "0.5.3"
|
||||
|
||||
[dependencies.wasmer-runtime-core]
|
||||
path = "../runtime-core"
|
||||
version = "0.5.1"
|
||||
version = "0.5.3"
|
||||
|
||||
[features]
|
||||
debug = ["wasmer-runtime/debug"]
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "wasmer-runtime-core"
|
||||
version = "0.5.1"
|
||||
version = "0.5.3"
|
||||
description = "Wasmer runtime core library"
|
||||
license = "MIT"
|
||||
authors = ["The Wasmer Engineering Team <engineering@wasmer.io>"]
|
||||
@ -10,7 +10,7 @@ edition = "2018"
|
||||
[dependencies]
|
||||
nix = "0.12.0"
|
||||
page_size = "0.4.1"
|
||||
wasmparser = "0.29.2"
|
||||
wasmparser = "0.32.1"
|
||||
parking_lot = "0.7.1"
|
||||
lazy_static = "1.2.0"
|
||||
indexmap = "1.0.2"
|
||||
|
@ -46,7 +46,9 @@ fn align_pointer(ptr: usize, align: usize) -> usize {
|
||||
impl<T: Copy + ValueType> WasmPtr<T, Item> {
|
||||
#[inline]
|
||||
pub fn deref<'a>(self, memory: &'a Memory) -> Option<&'a Cell<T>> {
|
||||
if (self.offset as usize) + mem::size_of::<T>() >= memory.size().bytes().0 {
|
||||
if self.offset == 0
|
||||
|| (self.offset as usize) + mem::size_of::<T>() >= memory.size().bytes().0
|
||||
{
|
||||
return None;
|
||||
}
|
||||
unsafe {
|
||||
@ -57,6 +59,20 @@ impl<T: Copy + ValueType> WasmPtr<T, Item> {
|
||||
Some(&*cell_ptr)
|
||||
}
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub unsafe fn deref_mut<'a>(self, memory: &'a Memory) -> Option<&'a mut Cell<T>> {
|
||||
if self.offset == 0
|
||||
|| (self.offset as usize) + mem::size_of::<T>() >= memory.size().bytes().0
|
||||
{
|
||||
return None;
|
||||
}
|
||||
let cell_ptr = align_pointer(
|
||||
memory.view::<u8>().as_ptr().add(self.offset as usize) as usize,
|
||||
mem::align_of::<T>(),
|
||||
) as *mut Cell<T>;
|
||||
Some(&mut *cell_ptr)
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: Copy + ValueType> WasmPtr<T, Array> {
|
||||
@ -67,7 +83,9 @@ impl<T: Copy + ValueType> WasmPtr<T, Array> {
|
||||
let item_size = mem::size_of::<T>() + (mem::size_of::<T>() % mem::align_of::<T>());
|
||||
let slice_full_len = index as usize + length as usize;
|
||||
|
||||
if (self.offset as usize) + (item_size * slice_full_len) >= memory.size().bytes().0 {
|
||||
if self.offset == 0
|
||||
|| (self.offset as usize) + (item_size * slice_full_len) >= memory.size().bytes().0
|
||||
{
|
||||
return None;
|
||||
}
|
||||
|
||||
@ -81,6 +99,33 @@ impl<T: Copy + ValueType> WasmPtr<T, Array> {
|
||||
Some(cell_ptrs)
|
||||
}
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub unsafe fn deref_mut<'a>(
|
||||
self,
|
||||
memory: &'a Memory,
|
||||
index: u32,
|
||||
length: u32,
|
||||
) -> Option<&'a mut [Cell<T>]> {
|
||||
// gets the size of the item in the array with padding added such that
|
||||
// for any index, we will always result an aligned memory access
|
||||
let item_size = mem::size_of::<T>() + (mem::size_of::<T>() % mem::align_of::<T>());
|
||||
let slice_full_len = index as usize + length as usize;
|
||||
|
||||
if self.offset == 0
|
||||
|| (self.offset as usize) + (item_size * slice_full_len) >= memory.size().bytes().0
|
||||
{
|
||||
return None;
|
||||
}
|
||||
|
||||
let cell_ptr = align_pointer(
|
||||
memory.view::<u8>().as_ptr().add(self.offset as usize) as usize,
|
||||
mem::align_of::<T>(),
|
||||
) as *mut Cell<T>;
|
||||
let cell_ptrs = &mut std::slice::from_raw_parts_mut(cell_ptr, slice_full_len)
|
||||
[index as usize..slice_full_len];
|
||||
Some(cell_ptrs)
|
||||
}
|
||||
}
|
||||
|
||||
unsafe impl<T: Copy, Ty> WasmExternType for WasmPtr<T, Ty> {
|
||||
|
@ -93,6 +93,7 @@ pub fn read_module<
|
||||
enable_reference_types: false,
|
||||
enable_simd: false,
|
||||
enable_bulk_memory: false,
|
||||
enable_multi_value: false,
|
||||
},
|
||||
mutable_global_imports: false,
|
||||
}),
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "wasmer-runtime"
|
||||
version = "0.5.1"
|
||||
version = "0.5.3"
|
||||
description = "Wasmer runtime library"
|
||||
license = "MIT"
|
||||
authors = ["The Wasmer Engineering Team <engineering@wasmer.io>"]
|
||||
@ -9,17 +9,17 @@ edition = "2018"
|
||||
readme = "README.md"
|
||||
|
||||
[dependencies]
|
||||
wasmer-singlepass-backend = { path = "../singlepass-backend", version = "0.5.1", optional = true }
|
||||
wasmer-singlepass-backend = { path = "../singlepass-backend", version = "0.5.3", optional = true }
|
||||
lazy_static = "1.2.0"
|
||||
memmap = "0.7.0"
|
||||
|
||||
[dependencies.wasmer-runtime-core]
|
||||
path = "../runtime-core"
|
||||
version = "0.5.1"
|
||||
version = "0.5.3"
|
||||
|
||||
[dependencies.wasmer-clif-backend]
|
||||
path = "../clif-backend"
|
||||
version = "0.5.1"
|
||||
version = "0.5.3"
|
||||
optional = true
|
||||
|
||||
[dev-dependencies]
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "wasmer-singlepass-backend"
|
||||
version = "0.5.1"
|
||||
version = "0.5.3"
|
||||
repository = "https://github.com/wasmerio/wasmer"
|
||||
description = "Wasmer runtime single pass compiler backend"
|
||||
license = "MIT"
|
||||
@ -8,8 +8,8 @@ authors = ["The Wasmer Engineering Team <engineering@wasmer.io>"]
|
||||
edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
wasmer-runtime-core = { path = "../runtime-core", version = "0.5.1" }
|
||||
wasmparser = "0.29.2"
|
||||
wasmer-runtime-core = { path = "../runtime-core", version = "0.5.3" }
|
||||
wasmparser = "0.32.1"
|
||||
dynasm = "0.3.2"
|
||||
dynasmrt = "0.3.1"
|
||||
lazy_static = "1.2.0"
|
||||
|
@ -34,7 +34,7 @@ use wasmer_runtime_core::{
|
||||
},
|
||||
vm::{self, LocalGlobal, LocalTable, INTERNALS_SIZE},
|
||||
};
|
||||
use wasmparser::{Operator, Type as WpType};
|
||||
use wasmparser::{Operator, Type as WpType, TypeOrFuncType as WpTypeOrFuncType};
|
||||
|
||||
lazy_static! {
|
||||
/// Performs a System V call to `target` with [stack_top..stack_base] as the argument list, from right to left.
|
||||
@ -3782,8 +3782,9 @@ impl FunctionCodeGenerator<CodegenError> for X64FunctionCode {
|
||||
loop_like: false,
|
||||
if_else: IfElseState::If(label_else),
|
||||
returns: match ty {
|
||||
WpType::EmptyBlockType => smallvec![],
|
||||
_ => smallvec![ty],
|
||||
WpTypeOrFuncType::Type(WpType::EmptyBlockType) => smallvec![],
|
||||
WpTypeOrFuncType::Type(inner_ty) => smallvec![inner_ty],
|
||||
_ => panic!("multi-value returns not yet implemented"),
|
||||
},
|
||||
value_stack_depth: self.value_stack.len(),
|
||||
state: self.machine.state.clone(),
|
||||
@ -3888,8 +3889,9 @@ impl FunctionCodeGenerator<CodegenError> for X64FunctionCode {
|
||||
loop_like: false,
|
||||
if_else: IfElseState::None,
|
||||
returns: match ty {
|
||||
WpType::EmptyBlockType => smallvec![],
|
||||
_ => smallvec![ty],
|
||||
WpTypeOrFuncType::Type(WpType::EmptyBlockType) => smallvec![],
|
||||
WpTypeOrFuncType::Type(inner_ty) => smallvec![inner_ty],
|
||||
_ => panic!("multi-value returns not yet implemented"),
|
||||
},
|
||||
value_stack_depth: self.value_stack.len(),
|
||||
state: self.machine.state.clone(),
|
||||
@ -3912,8 +3914,9 @@ impl FunctionCodeGenerator<CodegenError> for X64FunctionCode {
|
||||
loop_like: true,
|
||||
if_else: IfElseState::None,
|
||||
returns: match ty {
|
||||
WpType::EmptyBlockType => smallvec![],
|
||||
_ => smallvec![ty],
|
||||
WpTypeOrFuncType::Type(WpType::EmptyBlockType) => smallvec![],
|
||||
WpTypeOrFuncType::Type(inner_ty) => smallvec![inner_ty],
|
||||
_ => panic!("multi-value returns not yet implemented"),
|
||||
},
|
||||
value_stack_depth: self.value_stack.len(),
|
||||
state: self.machine.state.clone(),
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "wasmer-spectests"
|
||||
version = "0.5.1"
|
||||
version = "0.5.3"
|
||||
description = "Wasmer spectests library"
|
||||
license = "MIT"
|
||||
authors = ["The Wasmer Engineering Team <engineering@wasmer.io>"]
|
||||
@ -9,10 +9,10 @@ edition = "2018"
|
||||
build = "build/mod.rs"
|
||||
|
||||
[dependencies]
|
||||
wasmer-runtime-core = { path = "../runtime-core", version = "0.5.1" }
|
||||
wasmer-clif-backend = { path = "../clif-backend", version = "0.5.1" }
|
||||
wasmer-llvm-backend = { path = "../llvm-backend", version = "0.5.1", optional = true }
|
||||
wasmer-singlepass-backend = { path = "../singlepass-backend", version = "0.5.1", optional = true }
|
||||
wasmer-runtime-core = { path = "../runtime-core", version = "0.5.3" }
|
||||
wasmer-clif-backend = { path = "../clif-backend", version = "0.5.3" }
|
||||
wasmer-llvm-backend = { path = "../llvm-backend", version = "0.5.3", optional = true }
|
||||
wasmer-singlepass-backend = { path = "../singlepass-backend", version = "0.5.3", optional = true }
|
||||
|
||||
[build-dependencies]
|
||||
wabt = "0.7.2"
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "wasmer-wasi"
|
||||
version = "0.5.1"
|
||||
version = "0.5.3"
|
||||
description = "Wasmer runtime WASI implementation library"
|
||||
license = "MIT"
|
||||
authors = ["The Wasmer Engineering Team <engineering@wasmer.io>"]
|
||||
@ -9,7 +9,7 @@ edition = "2018"
|
||||
build = "build/mod.rs"
|
||||
|
||||
[dependencies]
|
||||
wasmer-runtime-core = { path = "../runtime-core", version = "0.5.1" }
|
||||
wasmer-runtime-core = { path = "../runtime-core", version = "0.5.3" }
|
||||
libc = "0.2.50"
|
||||
rand = "0.6.5"
|
||||
# wasmer-runtime-abi = { path = "../runtime-abi" }
|
||||
@ -18,7 +18,7 @@ generational-arena = "0.2.2"
|
||||
log = "0.4.6"
|
||||
byteorder = "1.3.1"
|
||||
# hack to get tests to work
|
||||
wasmer-singlepass-backend = { path = "../singlepass-backend", version = "0.5.1", optional = true }
|
||||
wasmer-singlepass-backend = { path = "../singlepass-backend", version = "0.5.3", optional = true }
|
||||
|
||||
[target.'cfg(windows)'.dependencies]
|
||||
winapi = "0.3"
|
||||
@ -27,8 +27,8 @@ winapi = "0.3"
|
||||
glob = "0.2.11"
|
||||
|
||||
[dev-dependencies]
|
||||
wasmer-clif-backend = { path = "../clif-backend", version = "0.5.1" }
|
||||
wasmer-dev-utils = { path = "../dev-utils", version = "0.5.1"}
|
||||
wasmer-clif-backend = { path = "../clif-backend", version = "0.5.3" }
|
||||
wasmer-dev-utils = { path = "../dev-utils", version = "0.5.3"}
|
||||
|
||||
[features]
|
||||
clif = []
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "wasmer-win-exception-handler"
|
||||
version = "0.5.1"
|
||||
version = "0.5.3"
|
||||
description = "Wasmer runtime exception handling for Windows"
|
||||
license = "MIT"
|
||||
authors = ["The Wasmer Engineering Team <engineering@wasmer.io>"]
|
||||
@ -8,7 +8,7 @@ repository = "https://github.com/wasmerio/wasmer"
|
||||
edition = "2018"
|
||||
|
||||
[target.'cfg(windows)'.dependencies]
|
||||
wasmer-runtime-core = { path = "../runtime-core", version = "0.5.1" }
|
||||
wasmer-runtime-core = { path = "../runtime-core", version = "0.5.3" }
|
||||
winapi = { version = "0.3", features = ["winbase", "errhandlingapi", "minwindef", "minwinbase", "winnt"] }
|
||||
libc = "0.2.49"
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
PREVIOUS_VERSION='0.5.0'
|
||||
NEXT_VERSION='0.5.1'
|
||||
PREVIOUS_VERSION='0.5.2'
|
||||
NEXT_VERSION='0.5.3'
|
||||
|
||||
# quick hack
|
||||
fd Cargo.toml --exec sed -i '' "s/version = \"$PREVIOUS_VERSION\"/version = \"$NEXT_VERSION\"/"
|
||||
|
2
wapm-cli
2
wapm-cli
Submodule wapm-cli updated: 9fa419885d...7190f50b62
Reference in New Issue
Block a user