tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

build-afl.sh (1079B)


      1 #!/bin/sh
      2 
      3 set -e -x
      4 
      5 artifact="$(basename "$TOOLCHAIN_ARTIFACT")"
      6 dir="${artifact%.tar.*}"
      7 scripts="$(realpath "${0%/*}")"
      8 
      9 # these lists are copied from AFLplusplus/GNUmakefile
     10 PROGS="afl-fuzz afl-showmap afl-tmin afl-gotcpu afl-analyze"
     11 SH_PROGS="afl-plot afl-cmin afl-cmin.bash afl-whatsup afl-addseeds afl-system-config afl-persistent-config"
     12 
     13 cd "$MOZ_FETCHES_DIR/AFLplusplus"
     14 patch -p1 -i "$scripts/afl-nyx.patch"
     15 patch -p1 -i "$scripts/afl-llvm20.patch"
     16 
     17 make -f GNUmakefile $PROGS \
     18    CC="$MOZ_FETCHES_DIR/clang/bin/clang" \
     19    CFLAGS="--sysroot $MOZ_FETCHES_DIR/sysroot" \
     20    CODE_COVERAGE=1 \
     21    NO_PYTHON=1 \
     22    PREFIX=/
     23 mkdir -p "$dir/bin"
     24 install -m 755 $PROGS $SH_PROGS "$dir/bin"
     25 install -m 644 ./utils/dynamic_covfilter/make_symbol_list.py "$dir/bin/"
     26 
     27 make -f GNUmakefile.llvm install \
     28    CODE_COVERAGE=1 \
     29    CPPFLAGS="--sysroot $MOZ_FETCHES_DIR/sysroot" \
     30    DESTDIR="$dir" \
     31    LLVM_CONFIG="$MOZ_FETCHES_DIR/clang/bin/llvm-config" \
     32    PREFIX=/
     33 rm -rf "$dir/share"
     34 
     35 tar caf "$artifact" "$dir"
     36 
     37 mkdir -p "$UPLOAD_DIR"
     38 mv "$artifact" "$UPLOAD_DIR"