Skip to content

Commit

Permalink
cli: add create-obj command
Browse files Browse the repository at this point in the history
lib/compiler: read static object
  • Loading branch information
epilys committed Aug 2, 2022
1 parent 8b096a5 commit 3085ae9
Show file tree
Hide file tree
Showing 16 changed files with 1,762 additions and 85 deletions.
4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,10 @@ singlepass = ["wasmer-compiler-singlepass", "compiler"]
cranelift = ["wasmer-compiler-cranelift", "compiler"]
llvm = ["wasmer-compiler-llvm", "compiler"]
middlewares = ["wasmer-middlewares"]
wasmer-artifact-load = ["wasmer-compiler/wasmer-artifact-load"]
wasmer-artifact-create = ["wasmer-compiler/wasmer-artifact-create"]
static-artifact-load = ["wasmer-compiler/static-artifact-load"]
static-artifact-create = ["wasmer-compiler/static-artifact-create"]

# Testing features
test-singlepass = ["singlepass"]
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -254,13 +254,13 @@ space := $() $()
comma := ,

# Define the compiler Cargo features for all crates.
compiler_features := --features $(subst $(space),$(comma),$(compilers))
compiler_features := --features $(subst $(space),$(comma),$(compilers)),wasmer-artifact-create,static-artifact-create,wasmer-artifact-load,static-artifact-load
capi_compilers_engines_exclude :=

# Define the compiler Cargo features for the C API. It always excludes
# LLVM for the moment because it causes the linker to fail since LLVM is not statically linked.
# TODO: Reenable LLVM in C-API
capi_compiler_features := --features $(subst $(space),$(comma),$(filter-out llvm, $(compilers)))
capi_compiler_features := --features $(subst $(space),$(comma),$(filter-out llvm, $(compilers))),wasmer-artifact-create,static-artifact-create,wasmer-artifact-load,static-artifact-load
capi_compilers_engines_exclude += llvm-universal

# We exclude singlepass-universal because it doesn't support multivalue (required in wasm-c-api tests)
Expand Down
5 changes: 5 additions & 0 deletions lib/api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -120,5 +120,10 @@ enable-serde = [
"wasmer-types/enable-serde",
]

wasmer-artifact-load = ["wasmer-compiler/wasmer-artifact-load"]
wasmer-artifact-create = ["wasmer-compiler/wasmer-artifact-create"]
static-artifact-load = ["wasmer-compiler/static-artifact-load"]
static-artifact-create = ["wasmer-compiler/static-artifact-create"]

[package.metadata.docs.rs]
features = ["compiler", "core", "cranelift", "engine", "jit", "native", "singlepass", "sys", "sys-default" ]
4 changes: 4 additions & 0 deletions lib/c-api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ llvm = [
"wasmer-compiler-llvm",
"compiler",
]
wasmer-artifact-load = ["wasmer-compiler/wasmer-artifact-load"]
wasmer-artifact-create = ["wasmer-compiler/wasmer-artifact-create"]
static-artifact-load = ["wasmer-compiler/static-artifact-load"]
static-artifact-create = ["wasmer-compiler/static-artifact-create"]

# Deprecated features.
jit = ["compiler"]
Expand Down
25 changes: 23 additions & 2 deletions lib/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ default = [
"emscripten",
"compiler",
"wasmer-artifact-create",
"static-artifact-create",
]
cache = ["wasmer-cache"]
cache-blake3-pure = ["wasmer-cache/blake3-pure"]
Expand All @@ -78,8 +79,28 @@ compiler = [
"wasmer-compiler/translator",
"wasmer-compiler/compiler",
]
wasmer-artifact-create = ["compiler", "wasmer-compiler/wasmer-artifact-create", "wasmer-object"]
static-artifact-create = ["compiler", "wasmer-compiler/static-artifact-create", "wasmer-object"]
wasmer-artifact-create = ["compiler",
"wasmer/wasmer-artifact-load",
"wasmer/wasmer-artifact-create",
"wasmer-compiler/wasmer-artifact-load",
"wasmer-compiler/wasmer-artifact-create",
"wasmer-object",
]
static-artifact-create = ["compiler",
"wasmer/static-artifact-load",
"wasmer/static-artifact-create",
"wasmer-compiler/static-artifact-load",
"wasmer-compiler/static-artifact-create",
"wasmer-object",
]
wasmer-artifact-load = ["compiler",
"wasmer/wasmer-artifact-load",
"wasmer-compiler/wasmer-artifact-load",
]
static-artifact-load = ["compiler",
"wasmer/static-artifact-load",
"wasmer-compiler/static-artifact-load",
]

experimental-io-devices = [
"wasmer-wasi-experimental-io-devices",
Expand Down
Loading

0 comments on commit 3085ae9

Please sign in to comment.