From e47c3be3fdf5af16c3020f70efbf8e144a1aee91 Mon Sep 17 00:00:00 2001 From: Evan Richter Date: Tue, 28 Dec 2021 18:30:14 -0600 Subject: [PATCH] [libafl_qemu] fix build.rs (#435) I noticed qemu was only building on one core, so I debugged the jobs environment variable. Evidently cargo passes `CARGO_BUILD_JOBS` is passed to build.rs scripts as `NUM_JOBS`. Other env vars for build.rs can be found [here](https://web.mit.edu/rust-lang_v1.25/arch/amd64_ubuntu1404/share/doc/rust/html/cargo/reference/environment-variables.html#environment-variables-cargo-sets-for-build-scripts) --- libafl_qemu/build.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libafl_qemu/build.rs b/libafl_qemu/build.rs index 0dae22b92e..efb906b8f1 100644 --- a/libafl_qemu/build.rs +++ b/libafl_qemu/build.rs @@ -47,7 +47,7 @@ fn main() { } else if cfg!(feature = "aarch64") { "aarch64".to_string() } else if cfg!(feature = "i386") { - "i368".to_string() + "i386".to_string() } else { env::var("CPU_TARGET").unwrap_or_else(|_| { println!( @@ -57,7 +57,7 @@ fn main() { }) }; - let jobs = env::var("CARGO_BUILD_JOBS"); + let jobs = env::var("NUM_JOBS"); let cross_cc = env::var("CROSS_CC").unwrap_or_else(|_| { println!("cargo:warning=CROSS_CC is not set, default to cc (things can go wrong if the selected cpu target ({}) is not the host arch ({}))", cpu_target, env::consts::ARCH);