aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar DavidKorczynski <david@adalogics.com>2022-01-18 21:52:59 +0000
committerGravatar GitHub <noreply@github.com>2022-01-18 21:52:59 +0000
commit2333df02bb935bcb789eaf8b3d6f57e97c7d7bb6 (patch)
tree6f3932598052eb2f9f70a1f287fe7cf8532504b0
parent7921270476ef3ed15b82f2c4bce86094c7cad735 (diff)
spidermonkey-ufi: fix build (#7151)
* spidermonkey-ufi: fix build * Fix coverage * nit
-rw-r--r--projects/spidermonkey-ufi/Dockerfile6
-rwxr-xr-xprojects/spidermonkey-ufi/build.sh13
2 files changed, 17 insertions, 2 deletions
diff --git a/projects/spidermonkey-ufi/Dockerfile b/projects/spidermonkey-ufi/Dockerfile
index 25e4d2d6..9ed8ed70 100644
--- a/projects/spidermonkey-ufi/Dockerfile
+++ b/projects/spidermonkey-ufi/Dockerfile
@@ -20,11 +20,15 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
python \
libc++1 \
libc++abi1 \
- m4
+ m4 llvm-dev curl
# This wrapper of cargo seems to interfere with our build system.
RUN rm -f /usr/local/bin/cargo
+RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > $SRC/rustbuild.sh && \
+ chmod +x $SRC/rustbuild.sh && \
+ $SRC/rustbuild.sh -y
+
RUN git clone --depth=1 https://github.com/mozilla/gecko-dev mozilla-central
WORKDIR mozilla-central/js/src/
COPY build.sh target.c $SRC/
diff --git a/projects/spidermonkey-ufi/build.sh b/projects/spidermonkey-ufi/build.sh
index 9f703305..7cbcfa0e 100755
--- a/projects/spidermonkey-ufi/build.sh
+++ b/projects/spidermonkey-ufi/build.sh
@@ -21,7 +21,12 @@ FUZZ_TARGETS=(
Wasm
)
+# Ensure rust nightly is used
+source $HOME/.cargo/env
+rustup default nightly
+
# Install dependencies.
+export MOZBUILD_STATE_PATH=/root/.mozbuild
export SHELL=/bin/bash
../../mach --no-interactive bootstrap --application-choice browser
@@ -37,13 +42,19 @@ touch ../../tools/fuzzing/libfuzzer/patches/dummy.patch
mkdir -p build_OPT.OBJ
cd build_OPT.OBJ
+if [ "$SANITIZER" = coverage ]; then
+ SAN_OPT="--enable-coverage"
+else
+ SAN_OPT="--enable-$SANITIZER-sanitizer"
+fi
+
../configure \
--enable-debug \
--enable-optimize="-O2 -gline-tables-only" \
--disable-jemalloc \
--enable-tests \
--enable-fuzzing \
- --enable-$SANITIZER-sanitizer
+ $SAN_OPT
make "-j$(nproc)"