From f8a00efe4c71ced9472551f118cce91295605932 Mon Sep 17 00:00:00 2001 From: Abhishek Arya Date: Thu, 21 May 2020 17:37:02 -0700 Subject: [PATCH] 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. --- infra/base-images/base-builder/compile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/infra/base-images/base-builder/compile b/infra/base-images/base-builder/compile index a05d320d0..8e0342caa 100755 --- a/infra/base-images/base-builder/compile +++ b/infra/base-images/base-builder/compile @@ -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.