0
0
Fork 0
mirror of https://github.com/denoland/rusty_v8.git synced 2024-11-24 15:19:31 -05:00

fix: ASAN+OPT_LEVEL check in build.rs was incorrect (#1461)

This commit is contained in:
Matt Mastracci 2024-04-15 12:01:09 -06:00 committed by GitHub
parent 665d3b2e05
commit 2e381e8f4d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -84,10 +84,6 @@ fn main() {
let is_asan = if let Some(rustflags) = env::var_os("CARGO_ENCODED_RUSTFLAGS")
{
if std::env::var_os("OPT_LEVEL").unwrap_or_default() == "0" {
panic!("v8 crate cannot be compiled with OPT_LEVEL=0 and ASAN.\nTry `[profile.dev.package.v8] opt-level = 1`.\nAborting before miscompilations cause issues.");
}
let rustflags = rustflags.to_string_lossy();
rustflags.find("-Z sanitizer=address").is_some()
|| rustflags.find("-Zsanitizer=address").is_some()
@ -97,6 +93,10 @@ fn main() {
// Build from source
if env::var_os("V8_FROM_SOURCE").is_some() {
if is_asan && std::env::var_os("OPT_LEVEL").unwrap_or_default() == "0" {
panic!("v8 crate cannot be compiled with OPT_LEVEL=0 and ASAN.\nTry `[profile.dev.package.v8] opt-level = 1`.\nAborting before miscompilations cause issues.");
}
return build_v8(is_asan);
}