From d01f19dfc71ea93ccd0a77ab37c73b9cf4905921 Mon Sep 17 00:00:00 2001 From: Guido Vranken Date: Mon, 19 Dec 2022 10:33:47 +0100 Subject: [PATCH] [cryptofuzz] Add Zig --- projects/cryptofuzz/Dockerfile | 1 + projects/cryptofuzz/build.sh | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/projects/cryptofuzz/Dockerfile b/projects/cryptofuzz/Dockerfile index f0ce7818a2fd..a19d9ce4c3db 100644 --- a/projects/cryptofuzz/Dockerfile +++ b/projects/cryptofuzz/Dockerfile @@ -60,5 +60,6 @@ RUN wget https://boostorg.jfrog.io/artifactory/main/release/1.74.0/source/boost_ RUN wget https://nodejs.org/dist/v14.17.1/node-v14.17.1-linux-x64.tar.xz RUN wget https://download.java.net/java/GA/jdk18.0.1/3f48cabb83014f9fab465e280ccf630b/10/GPL/openjdk-18.0.1_linux-x64_bin.tar.gz RUN pip3 install -r $SRC/mbedtls/scripts/basic.requirements.txt +RUN bash -c "wget $(curl https://ziglang.org/download/index.json | jq -r '.master."x86_64-linux".tarball') -O zig-latest.tar.xz" COPY build.sh xxd.c $SRC/ diff --git a/projects/cryptofuzz/build.sh b/projects/cryptofuzz/build.sh index 735f9974c9f9..ac3827c5e023 100755 --- a/projects/cryptofuzz/build.sh +++ b/projects/cryptofuzz/build.sh @@ -109,6 +109,16 @@ if [ "$SANITIZER" = undefined ]; then cp CryptofuzzJavaHarness.class $OUT/ fi +if [[ $CFLAGS != *-m32* ]] +then + cd $SRC/ + tar Jxf zig-latest.tar.xz + export ZIG_BIN=$(realpath zig-linux-x86_64*/zig) + + cd $SRC/cryptofuzz/modules/zig/ + make -j$(nproc) + export CXXFLAGS="$CXXFLAGS -DCRYPTOFUZZ_ZIG" +fi # Compile NSS if [[ $CFLAGS != *-m32* ]]