Bug 1906897 - Add AFL++ builds for fuzzing debug and fuzzing coverage r=taskgraph-reviewers,bhearsum,firefox-build-system-reviewers,glandium

Differential Revision: https://phabricator.services.mozilla.com/D217647
This commit is contained in:
Jesse Schwartzentruber
2024-07-26 13:55:37 +00:00
parent fb2b2bf62d
commit 081382237c
7 changed files with 116 additions and 26 deletions

View File

@@ -0,0 +1,3 @@
. "$topsrcdir/browser/config/mozconfigs/linux64/debug-fuzzing"
. "$topsrcdir/build/unix/mozconfig.afl"
. "$topsrcdir/build/mozconfig.common.override"

View File

@@ -0,0 +1,3 @@
. "$topsrcdir/browser/config/mozconfigs/linux64/fuzzing-ccov"
. "$topsrcdir/build/unix/mozconfig.afl"
. "$topsrcdir/build/mozconfig.common.override"

View File

@@ -1,9 +1,3 @@
. "$topsrcdir/browser/config/mozconfigs/linux64/nightly-fuzzing-asan"
export CC="$MOZ_FETCHES_DIR/afl-instrumentation/bin/afl-clang-fast"
export CXX="$MOZ_FETCHES_DIR/afl-instrumentation/bin/afl-clang-fast++"
export HOST_CC="$MOZ_FETCHES_DIR/clang/bin/clang"
export HOST_CXX="$MOZ_FETCHES_DIR/clang/bin/clang++"
. "$topsrcdir/build/unix/mozconfig.afl"
. "$topsrcdir/build/mozconfig.common.override"

View File

@@ -0,0 +1,5 @@
. "$topsrcdir/browser/config/mozconfigs/linux64/nightly-fuzzing-asan-nyx"
mk_add_options "export AFL_LLVM_INSTRUMENT=llvmcodecov"
. "$topsrcdir/build/mozconfig.common.override"

View File

@@ -1,13 +1,9 @@
. "$topsrcdir/build/unix/mozconfig.afl"
# We still need to build with debug symbols
ac_add_options --disable-debug
ac_add_options --enable-optimize="-O2 -gline-tables-only"
export CC="$MOZ_FETCHES_DIR/afl-instrumentation/bin/afl-clang-fast"
export CXX="$MOZ_FETCHES_DIR/afl-instrumentation/bin/afl-clang-fast++"
export HOST_CC="$MOZ_FETCHES_DIR/clang/bin/clang"
export HOST_CXX="$MOZ_FETCHES_DIR/clang/bin/clang++"
#add-on signing is checked but not enforced
MOZ_REQUIRE_SIGNING=

10
build/unix/mozconfig.afl Normal file
View File

@@ -0,0 +1,10 @@
mk_add_options "export AFL_CC=$MOZ_FETCHES_DIR/clang/bin/clang"
mk_add_options "export AFL_CXX=$MOZ_FETCHES_DIR/clang/bin/clang++"
mk_add_options "export AFL_LLVM_INSTRUMENT=llvmnative"
mk_add_options "export AFL_LLVM_NO_RPATH=1"
export CC="$MOZ_FETCHES_DIR/afl-instrumentation/bin/afl-clang-fast"
export CXX="$MOZ_FETCHES_DIR/afl-instrumentation/bin/afl-clang-fast++"
export HOST_CC="$MOZ_FETCHES_DIR/clang/bin/clang"
export HOST_CXX="$MOZ_FETCHES_DIR/clang/bin/clang++"

View File

@@ -1099,10 +1099,6 @@ linux64-asan-fuzzing-afl/opt:
env:
PERFHERDER_EXTRA_OPTIONS: asan-fuzzing-afl
MOZ_AUTOMATION_PACKAGE_TESTS: "1"
AFL_CC: /builds/worker/fetches/clang/bin/clang
AFL_CXX: /builds/worker/fetches/clang/bin/clang++
AFL_LLVM_INSTRUMENT: llvmnative
AFL_LLVM_NO_RPATH: "1"
max-run-time: 7200
run:
using: mozharness
@@ -1134,6 +1130,97 @@ linux64-asan-fuzzing-afl/opt:
optimization:
skip-unless-expanded: null
linux64-fuzzing-afl/debug:
description: "Linux64 Fuzzing Debug AFL"
index:
product: firefox
job-name: linux64-fuzzing-afl-debug
attributes:
# The gtest libxul contains libFuzzer targets
skip-verify-test-packaging: true
treeherder:
platform: linux64/debug
symbol: Baf
worker:
env:
PERFHERDER_EXTRA_OPTIONS: fuzzing-afl
MOZ_AUTOMATION_PACKAGE_TESTS: "1"
max-run-time: 7200
run:
using: mozharness
actions: [get-secrets, build]
config:
- builds/releng_base_firefox.py
- builds/releng_base_linux_64_builds.py
script: "mozharness/scripts/fx_desktop_build.py"
secrets: true
custom-build-variant-cfg: fuzzing-debug
mozconfig-variant: debug-fuzzing-afl
tooltool-downloads: public
use-sccache: true
fetches:
toolchain:
- linux64-afl-instrumentation
- linux64-clang
- linux64-rust-dev
- linux64-rust-size
- linux64-cbindgen
- linux64-dump_syms
- linux64-llvm-symbolizer
- linux64-sccache
- linux64-nasm
- linux64-node
- linux64-pkgconf
- sysroot-x86_64-linux-gnu
- sysroot-wasm32-wasi
optimization:
skip-unless-expanded: null
linux64-fuzzing-afl-ccov/opt:
description: "Linux64 Fuzzing Opt AFL w/ Coverage"
index:
product: firefox
job-name: linux64-ccov-fuzzing-afl-opt
attributes:
# The gtest libxul contains libFuzzer targets
skip-verify-test-packaging: true
treeherder:
platform: linux64/opt
symbol: Bacf
worker:
env:
PERFHERDER_EXTRA_OPTIONS: fuzzing-ccov-afl
MOZ_AUTOMATION_PACKAGE_TESTS: "1"
max-run-time: 7200
run:
using: mozharness
actions: [get-secrets, build]
config:
- builds/releng_base_firefox.py
- builds/releng_base_linux_64_builds.py
script: "mozharness/scripts/fx_desktop_build.py"
secrets: true
mozconfig-variant: fuzzing-ccov-afl
tooltool-downloads: public
use-sccache: true
fetches:
toolchain:
- linux64-afl-instrumentation
- linux64-clang
- linux64-rust-dev
- linux64-rust-size
- linux64-cbindgen
- linux64-dump_syms
- linux64-llvm-symbolizer
- linux64-sccache
- linux64-nasm
- linux64-node
- linux64-pkgconf
- sysroot-x86_64-linux-gnu
- sysroot-wasm32-wasi
optimization:
skip-unless-expanded: null
linux64-asan-fuzzing-nyx/opt:
description: "Linux64 Fuzzing Opt ASAN NYX"
index:
@@ -1149,10 +1236,6 @@ linux64-asan-fuzzing-nyx/opt:
env:
PERFHERDER_EXTRA_OPTIONS: asan-fuzzing-nyx
MOZ_AUTOMATION_PACKAGE_TESTS: "1"
AFL_CC: /builds/worker/fetches/clang/bin/clang
AFL_CXX: /builds/worker/fetches/clang/bin/clang++
AFL_LLVM_INSTRUMENT: llvmnative
AFL_LLVM_NO_RPATH: "1"
max-run-time: 7200
run:
using: mozharness
@@ -1199,10 +1282,6 @@ linux64-asan-fuzzing-nyx-ccov/opt:
env:
PERFHERDER_EXTRA_OPTIONS: asan-fuzzing-ccov-nyx
MOZ_AUTOMATION_PACKAGE_TESTS: "1"
AFL_CC: /builds/worker/fetches/clang/bin/clang
AFL_CXX: /builds/worker/fetches/clang/bin/clang++
AFL_LLVM_INSTRUMENT: llvmcodecov
AFL_LLVM_NO_RPATH: "1"
max-run-time: 7200
run:
using: mozharness
@@ -1213,7 +1292,7 @@ linux64-asan-fuzzing-nyx-ccov/opt:
script: "mozharness/scripts/fx_desktop_build.py"
secrets: true
custom-build-variant-cfg: fuzzing-asan-tc
mozconfig-variant: nightly-fuzzing-asan-nyx
mozconfig-variant: nightly-fuzzing-asan-ccov-nyx
tooltool-downloads: public
run-on-projects: ['mozilla-central']
use-sccache: true