Don't add Rust sanitizer flags when using ubsan or i386. (#3862)

Rust sanitizer flags are not supported for these configs.
Fixes Cras and ecc-diff-fuzzer builds.
This commit is contained in:
Abhishek Arya 2020-05-21 17:37:02 -07:00 committed by GitHub
parent e360d35bda
commit f8a00efe4c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -67,7 +67,11 @@ fi
# use RUSTFLAGS.
# FIXME: Support code coverage once support is in.
# See https://github.com/rust-lang/rust/issues/34701.
export RUSTFLAGS="--cfg fuzzing -Zsanitizer=${SANITIZER} -Cdebuginfo=1 -Cforce-frame-pointers"
if [ "$SANITIZER" != "undefined" ] && [ "$ARCHITECTURE" != 'i386' ]; then
export RUSTFLAGS="--cfg fuzzing -Zsanitizer=${SANITIZER} -Cdebuginfo=1 -Cforce-frame-pointers"
else
export RUSTFLAGS="--cfg fuzzing -Cdebuginfo=1 -Cforce-frame-pointers"
fi
# Add Rust libfuzzer flags.
# See https://github.com/rust-fuzz/libfuzzer/blob/master/build.rs#L12.