Skip to content

Commit

Permalink
Sync wamr to commit 67fa155
Browse files Browse the repository at this point in the history
The commit will bypass access mode modification of STDIN, STDOUT and STDERR.
It will help to enable runwasi to run successfully although we don't know
why the sandbox in runwasi will let STDOUT read-only.
  • Loading branch information
lum1n0us committed Aug 13, 2024
1 parent a945627 commit 43f330f
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 9 deletions.
6 changes: 6 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[env]
# vprintf callback. refer to https://github.com/bytecodealliance/wasm-micro-runtime/blob/main/doc/build_wamr.md?plain=1#L193
#WAMR_BH_VPRINTF = ""
# https://github.com/bytecodealliance/wasm-micro-runtime/blob/main/doc/port_wamr.md#wamr-porting-guide
#WAMR_BUILD_PLATFORM = "new OS name"
#WAMR_SHARED_PLATFORM_CONFIG = "core/shared/platform/new os/shared_platform.cmake"
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,5 @@ esp-idf-sys = { version = "0.35" }
bindings_header = "./crates/wamr-sys/wasm-micro-runtime/core/iwasm/include/wasm_export.h"
component_dirs = ["./crates/wamr-sys/wasm-micro-runtime/build-scripts/esp-idf"]

# [features]
# llvmjit = ["wamr-sys/llvmjit"]
[features]
llvmjit = ["wamr-sys/llvmjit"]
5 changes: 3 additions & 2 deletions crates/wamr-sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,6 @@ bindgen = "0.69"
cc = "1.1"
cmake = "0.1"

# [features]
# llvmjit = []
[features]
llvmjit = []
std = []
7 changes: 3 additions & 4 deletions crates/wamr-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@ fn main() {
let wamr_root = wamr_root.join("wasm-micro-runtime");
assert!(wamr_root.exists());

let is_espidf = env::var("CARGO_CFG_TARGET_OS").unwrap() != "espidf";

if is_espidf {
let no_espidf = env::var("CARGO_CFG_TARGET_OS").unwrap() != "espidf";
if no_espidf {
let enable_llvm_jit = if cfg!(feature = "llvmjit") { "1" } else { "0" };
// TODO: define LLVM_DIR
let mut cfg = Config::new(&wamr_root);
Expand All @@ -38,7 +37,7 @@ fn main() {
// .define("WAMR_BUILD_DUMP_CALL_STACK", "1")
// .define("WAMR_BUILD_CUSTOM_NAME_SECTION", "1")
// .define("WAMR_BUILD_LOAD_CUSTOM_SECTION", "1")
// hw bound checker (workaround)
// hw bound checker (workaround for runwasi)
.define("WAMR_DISABLE_HW_BOUND_CHECK", "1");

// support STDIN/STDOUT/STDERR redirect.
Expand Down
2 changes: 1 addition & 1 deletion crates/wamr-sys/wasm-micro-runtime

0 comments on commit 43f330f

Please sign in to comment.