Skip to content

A lightweight WebAssembly runtime that is fast, secure, and standards-compliant

Fix enabling `cfg(gc_zeal)` during fuzzing (#13123)

Alex Crichton9707e9c4e72d
diff --git a/crates/cranelift/build.rs b/crates/cranelift/build.rs
index 20153fe6fa..d70c2572c8 100644
--- a/crates/cranelift/build.rs
+++ b/crates/cranelift/build.rs
@@ -1,5 +1,5 @@
fn main() {
- if cfg!(fuzzing) {
+ if std::env::var("CARGO_CFG_FUZZING").is_ok() {
println!("cargo:rustc-cfg=gc_zeal");
}
}
diff --git a/crates/wasmtime/build.rs b/crates/wasmtime/build.rs
index 9b783f93ee..33f9c78b91 100644
--- a/crates/wasmtime/build.rs
+++ b/crates/wasmtime/build.rs
@@ -34,7 +34,7 @@ fn main() {
custom_cfg("has_virtual_memory", has_virtual_memory);
custom_cfg("has_custom_sync", has_custom_sync);
custom_cfg("has_host_compiler_backend", has_host_compiler_backend);
- custom_cfg("gc_zeal", cfg!(fuzzing));
+ custom_cfg("gc_zeal", cfg("fuzzing"));
// If this OS isn't supported and no debug-builtins or if Cranelift doesn't support
// the host or there's no need to build these helpers.