From de52eac2b06b9cf91efd526a43dd910105d0b14f Mon Sep 17 00:00:00 2001 From: "Christian Holler (:decoder)" Date: Sat, 20 Mar 2021 16:34:44 +0100 Subject: [PATCH] [firefox] Fix various build problems (#5456) * [firefox] Suppress LSan errors during build * [firefox] Properly ignore CFLAGS/CXXFLAGS * [firefox] Use the same Rust Nightly version as in Mozilla CI --- projects/firefox/build.sh | 13 +++++++++++++ projects/firefox/mozconfig.address | 5 ++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/projects/firefox/build.sh b/projects/firefox/build.sh index aebd619bd..8788e190e 100755 --- a/projects/firefox/build.sh +++ b/projects/firefox/build.sh @@ -42,8 +42,21 @@ FUZZ_TARGETS=( export MOZ_OBJDIR=$WORK/obj-fuzz export MOZCONFIG=$SRC/mozconfig.$SANITIZER +# Without this, a host tool used during Rust part of the build will fail +export ASAN_OPTIONS="detect_leaks=0" + # Install remaining dependencies. export SHELL=/bin/bash + +# Firefox might not be buildable on the latest Rust Nightly, so we should try +# to use the same version that we use in our CI. +RUST_NIGHTLY_VERSION=$(sed -n 's/^.*--channel.*\(nightly-[0-9-]*\).*$/\1/p' \ + $SRC/mozilla-central/taskcluster/ci/toolchain/rust.yml +) + +rustup toolchain install ${RUST_NIGHTLY_VERSION} +rustup default ${RUST_NIGHTLY_VERSION}-x86_64-unknown-linux-gnu + ./mach --no-interactive bootstrap --application-choice browser # Skip patches for now diff --git a/projects/firefox/mozconfig.address b/projects/firefox/mozconfig.address index c9eb33d0b..0bc2c36c4 100644 --- a/projects/firefox/mozconfig.address +++ b/projects/firefox/mozconfig.address @@ -1,4 +1,7 @@ . $SRC/mozconfig.coverage ac_add_options --enable-address-sanitizer -mk_add_options CFLAGS= CXXFLAGS= + +# Don't use standard CFLAGS/CXXFLAGS provided by oss-fuzz +export CFLAGS="" +export CXXFLAGS=""