Skip to content

Commit 966c54b

Browse files
committed
Fix build and clippy checks when gdb features is enabled on windows
- The toolchain paths and flags are not correctly propagated on windows. When gdb feature is enabled, wasmtime-internal-jit-debug crate tries to compile C files using cc which is not correctly set on Windows Signed-off-by: Doru Blânzeanu <[email protected]>
1 parent e7fd9c0 commit 966c54b

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

Justfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@ fmt:
7272
cd src/wasm_runtime && cargo +nightly fmt -v --all
7373
cd src/hyperlight_wasm_macro && cargo +nightly fmt -v --all
7474

75+
export CC_x86_64_unknown_none:= if os() == "windows" { justfile_directory() / "src/wasm_runtime/guest-toolchain/clang" } else { "" }
76+
export AR_x86_64_unknown_none:= if os() == "windows" { "llvm-ar" } else { "" }
77+
7578
clippy target=default-target: (check target)
7679
cargo clippy --profile={{ if target == "debug" {"dev"} else { target } }} --all-targets --all-features -- -D warnings
7780
cd src/rust_wasm_samples && cargo clippy --profile={{ if target == "debug" {"dev"} else { target } }} --all-targets --all-features -- -D warnings

src/hyperlight_wasm/build.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,8 @@ fn build_wasm_runtime() -> PathBuf {
134134
.arg(&target_dir)
135135
.current_dir(&in_repo_dir)
136136
.env_clear()
137+
// On windows when `gdb` features is enabled this is not set correctly
138+
.env("CFLAGS_x86_64_unknown_none", "-fPIC")
137139
.envs(env_vars)
138140
.env("PATH", path_with(&toolchain_dir))
139141
.env("HYPERLIGHT_GUEST_TOOLCHAIN_ROOT", &toolchain_dir);

0 commit comments

Comments
 (0)