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:
parent
665d3b2e05
commit
2e381e8f4d
1 changed files with 4 additions and 4 deletions
8
build.rs
8
build.rs
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue