262: create an llvm flag r=lachlansneff a=xmclark
Some users may not care about building for the LLVM backend, so it may be useful to isolate it with a feature flag. Building should now only build the cranelift backend and does not require any LLVM setup.
Co-authored-by: Mackenzie Clark <mackenzie.a.z.c@gmail.com>
Co-authored-by: Lachlan Sneff <lachlan.sneff@gmail.com>
* fix(emscripten) Remove unused imports.
This patch removes unused imports reported by `rustc` as warnings.
* fix(emscripten) Allow unreachable patterns in `_clock_gettime`.
The compiler thinks `CLOCK_MONOTONIC_COARSE` is unreachable, which is
not always the case. Add an attribute to allow unreachable patterns to
remove the warning.
* fix(emscripten) Rename unused variables.
This patch renames various unused variables by appending an underscore
to them.
* fix(emscripten) Declare `table` as immutable.
The `table` variable in `EmscriptenGlobals::new` was declared as
mutable, but it's never mutated.
* fix(emscripten) Remove an unnecessary `unsafe` block.
* fix(emscripten) Remove duplicate definition of `SO_NOSIGPIPE`.
The `SO_NOSIGPIPE` constant is defined in `syscalls/mod.rs` and
`syscalls/unix.rs`. It's never used in the first case. We can safely
remove it in this file, and keep it in `unix.rs`.
* fix(emscripten) `read_string_from_wasm` is used only on Windows.
Mark `read_string_from_wasm` as possible deadcode, since it's used
only on Windows.
* fix(emscripten) Remove `DYNAMICTOP_PTR_DIFF`, `stacktop`, `stack_max`,
`dynamic_base` and `dynamic_ptr`.
Four functions and one constant are used together but never used
inside or outside this file. They are deadcode.
* fix(emscripten) Remove `infinity` and `nan` fields of `EmscriptenGlobalsData`.
Those fields are never used.
* fix(emscripten) Allow non snake case in `emscripten_target.rs`.
Many functions in this file don't follow the snake case style for Rust
function names. The reason is that we want the names to match the
emscripten symbol names; even if a mapping is done in `lib.rs`, it's
easier to get the same names.
* fix(emscripten) Rename `STATIC_TOP` to `static_top`.
This variable is not a constant.
263: fix(runtime-core) Remove unused imports r=Hywan a=Hywan
This patch removes unused imports as reported by `rustc` as warnings.
265: fix(clif-backend) Remove unused imports r=Hywan a=Hywan
This patch removes unused imports reported by `rustc` as warnings.
Co-authored-by: Ivan Enderlin <ivan.enderlin@hoa-project.net>
261: feat(runtime-c-api) Add an API to update `vm::Ctx.data` r=Hywan a=Hywan
This patch adds 2 functions for the runtime C API, respectively
`wasmer_instance_context_data_set` and
`wasmer_instance_context_data_get`. The goal is to modify the
`vm::Ctx.data` field in the `runtime-core` library.
Since all imported functions receive this context, that's the
simplest way to pass dynamic data to them.
Co-authored-by: Ivan Enderlin <ivan.enderlin@hoa-project.net>
Co-authored-by: Syrus Akbary <me@syrusakbary.com>
260: fix(runtime-c-api) Fix the `imports` length. r=Hywan a=Hywan
`imports` contains `func_import`, `global_import`, `memory_import` and
`table_import`, so 4 items. This patch updates the length of `imports`
when calling the `wasmer_instantiate` function.
Co-authored-by: Ivan Enderlin <ivan.enderlin@hoa-project.net>
Co-authored-by: Syrus Akbary <me@syrusakbary.com>
This patch adds 2 functions for the runtime C API, respectively
`wasmer_instance_context_data_set` and
`wasmer_instance_context_data_get`. The goal is to modify the
`vm::Ctx.data` field in the `runtime-core` library.
This is required to pass dynamic data to imported functions for
instance.
`imports` contains `func_import`, `global_import`, `memory_import` and
`table_import`, so 4 items. This patch updates the length of `imports`
when calling the `wasmer_instantiate` function.