From 8d35407a9806b5c3e0fc1eb94c2e597f3355390f Mon Sep 17 00:00:00 2001 From: tb Date: Tue, 16 Jun 2026 14:29:57 +0000 Subject: [PATCH] Update to afl++ 4.40c This builds with llvm22 but isn't perfect and needs more polishing. For now you need to pass LDFLAGS+=-lexecinfo to afl-cc and friends. maintainer timeout --- devel/afl++/Makefile | 3 ++- devel/afl++/distinfo | 4 ++-- devel/afl++/patches/patch-GNUmakefile | 4 ++-- devel/afl++/patches/patch-GNUmakefile_llvm | 2 +- devel/afl++/patches/patch-afl-cmin | 12 ++++++------ .../patches/patch-utils_aflpp_driver_aflpp_driver_c | 2 +- devel/afl++/pkg/PLIST | 10 +++++++++- 7 files changed, 23 insertions(+), 14 deletions(-) diff --git a/devel/afl++/Makefile b/devel/afl++/Makefile index 52f259a9751..328e198a9fe 100644 --- a/devel/afl++/Makefile +++ b/devel/afl++/Makefile @@ -14,7 +14,7 @@ MAINTAINER= Jasper Lievisse Adriaanse # Apache 2.0 PERMIT_PACKAGE= Yes -WANTLIB = ${COMPILER_LIBCXX} c m z +WANTLIB = ${COMPILER_LIBCXX} c execinfo m z USE_GMAKE= Yes MODULES = lang/clang @@ -23,6 +23,7 @@ RUN_DEPENDS = lang/gawk # if nproc is not set, sub-makes are passed "-j" which does not limit # the number of jobs. MAKE_FLAGS = nproc=${MAKE_JOBS} \ + LDFLAGS=-lexecinfo \ LLVM_CONFIG=llvm-config-${MODCLANG_VERSION} \ NO_PYTHON=1 FAKE_FLAGS= PREFIX="${TRUEPREFIX}" diff --git a/devel/afl++/distinfo b/devel/afl++/distinfo index ad7f9a88b17..64484d3ca62 100644 --- a/devel/afl++/distinfo +++ b/devel/afl++/distinfo @@ -1,2 +1,2 @@ -SHA256 (AFLplusplus-4.32c.tar.gz) = 3H9ZoRzoz2ej7QmlrHgCjG95OyObIf2D5bI3DOoWaSY= -SIZE (AFLplusplus-4.32c.tar.gz) = 3045679 +SHA256 (AFLplusplus-4.40c.tar.gz) = M0N5bwtpsL7AfkQDNggoDDYODpC03ba92iY9WY/D5HI= +SIZE (AFLplusplus-4.40c.tar.gz) = 3197695 diff --git a/devel/afl++/patches/patch-GNUmakefile b/devel/afl++/patches/patch-GNUmakefile index 860ebb01a67..1ae60db89c4 100644 --- a/devel/afl++/patches/patch-GNUmakefile +++ b/devel/afl++/patches/patch-GNUmakefile @@ -14,7 +14,7 @@ Index: GNUmakefile INCLUDE_PATH = $(PREFIX)/include/afl PROGNAME = afl -@@ -332,7 +332,7 @@ ifdef TEST_MMAP +@@ -328,7 +328,7 @@ ifeq "$(ARCH)" "aarch64" endif .PHONY: all @@ -23,7 +23,7 @@ Index: GNUmakefile -$(MAKE) -C utils/aflpp_driver @echo @echo -@@ -698,7 +698,6 @@ endif +@@ -733,7 +733,6 @@ endif distrib: all -$(MAKE) -j$(nproc) -f GNUmakefile.llvm ifneq "$(SYS)" "Darwin" diff --git a/devel/afl++/patches/patch-GNUmakefile_llvm b/devel/afl++/patches/patch-GNUmakefile_llvm index 753aad1ab7b..0a94d1cefef 100644 --- a/devel/afl++/patches/patch-GNUmakefile_llvm +++ b/devel/afl++/patches/patch-GNUmakefile_llvm @@ -12,6 +12,6 @@ Index: GNUmakefile.llvm MISC_PATH ?= $(PREFIX)/share/afl -MAN_PATH ?= $(PREFIX)/share/man/man8 +MAN_PATH ?= $(PREFIX)/man/man8 + INCLUDE_PATH := $(PREFIX)/include/afl BUILD_DATE ?= $(shell date -u -d "@$(SOURCE_DATE_EPOCH)" "+%Y-%m-%d" 2>/dev/null || date -u -r "$(SOURCE_DATE_EPOCH)" "+%Y-%m-%d" 2>/dev/null || date -u "+%Y-%m-%d") - diff --git a/devel/afl++/patches/patch-afl-cmin b/devel/afl++/patches/patch-afl-cmin index 01a494370e4..5a0c6453dd8 100644 --- a/devel/afl++/patches/patch-afl-cmin +++ b/devel/afl++/patches/patch-afl-cmin @@ -1,19 +1,19 @@ - d822181467ec41f1ee2d840c3c5b1918c72ffc86 introduced a bunch of gawk-isms. - nproc doesn't exist on OpenBSD -Index: afl-cmin ---- afl-cmin.orig -+++ afl-cmin -@@ -8,7 +8,7 @@ export AFL_QUIET=1 +Index: afl-cmin.awk +--- afl-cmin.awk.orig ++++ afl-cmin.awk +@@ -10,7 +10,7 @@ test "$SYS" = "Darwin" && { + export AFL_QUIET=1 export ASAN_OPTIONS=detect_leaks=0 - THISPATH=`dirname ${0}` export PATH="${THISPATH}:$PATH" -awk -f - -- ${@+"$@"} <<'EOF' +gawk -f - -- ${@+"$@"} <<'EOF' #!/usr/bin/awk -f # awk script to minimize a test corpus of input files # -@@ -373,7 +373,7 @@ BEGIN { +@@ -377,7 +377,7 @@ BEGIN { } if (threads) { diff --git a/devel/afl++/patches/patch-utils_aflpp_driver_aflpp_driver_c b/devel/afl++/patches/patch-utils_aflpp_driver_aflpp_driver_c index 2ff9df4392d..3e72b6cd5f3 100644 --- a/devel/afl++/patches/patch-utils_aflpp_driver_aflpp_driver_c +++ b/devel/afl++/patches/patch-utils_aflpp_driver_aflpp_driver_c @@ -1,7 +1,7 @@ Index: utils/aflpp_driver/aflpp_driver.c --- utils/aflpp_driver/aflpp_driver.c.orig +++ utils/aflpp_driver/aflpp_driver.c -@@ -236,7 +236,9 @@ static int ExecuteFilesOnyByOne(int argc, char **argv, +@@ -269,7 +269,9 @@ static int ExecuteFilesOnyByOne(int argc, char **argv, if (fd == -1) { continue; } diff --git a/devel/afl++/pkg/PLIST b/devel/afl++/pkg/PLIST index 7c374abad3e..563a3fb299a 100644 --- a/devel/afl++/pkg/PLIST +++ b/devel/afl++/pkg/PLIST @@ -10,7 +10,9 @@ bin/afl-clang-fast++ bin/afl-clang-lto bin/afl-clang-lto++ bin/afl-cmin +bin/afl-cmin.awk bin/afl-cmin.bash +bin/afl-cmin.py @bin bin/afl-fuzz bin/afl-g++ bin/afl-gcc @@ -26,6 +28,7 @@ bin/afl-system-config bin/afl-whatsup include/afl/ include/afl/afl-fuzz.h +include/afl/afl-ijon-min.h include/afl/afl-mutations.h include/afl/afl-persistent-replay.h include/afl/afl-prealloc.h @@ -57,6 +60,7 @@ libexec/afl/afl-compiler-rt-32.o libexec/afl/afl-compiler-rt-64.o libexec/afl/afl-compiler-rt.o @so libexec/afl/afl-llvm-dict2file.so +@so libexec/afl/afl-llvm-ijon-pass.so @so libexec/afl/afl-llvm-lto-instrumentlist.so @so libexec/afl/afl-llvm-pass.so libexec/afl/afl-llvm-rt-lto-32.o @@ -81,7 +85,9 @@ libexec/afl/dynamic_list.txt @man man/man8/afl-clang-lto++.8 @man man/man8/afl-clang-lto.8 @man man/man8/afl-cmin.8 +@man man/man8/afl-cmin.awk.8 @man man/man8/afl-cmin.bash.8 +@man man/man8/afl-cmin.py.8 @man man/man8/afl-fuzz.8 @man man/man8/afl-gotcpu.8 @man man/man8/afl-lto++.8 @@ -156,6 +162,7 @@ share/afl/dictionaries/sas.dict share/afl/dictionaries/spss.dict share/afl/dictionaries/sql.dict share/afl/dictionaries/stata.dict +share/afl/dictionaries/stl.dict share/afl/dictionaries/svg.dict share/afl/dictionaries/tex.dict share/afl/dictionaries/theme-load-fuzz.dict @@ -269,6 +276,8 @@ share/afl/testcases/others/xml/small_document.xml share/doc/afl/ share/doc/afl/Changelog.md share/doc/afl/FAQ.md +share/doc/afl/FrameShift.md +share/doc/afl/IJON.md share/doc/afl/INSTALL.md share/doc/afl/README.cmplog.md share/doc/afl/README.gcc_plugin.md @@ -287,7 +296,6 @@ share/doc/afl/env_variables.md share/doc/afl/features.md share/doc/afl/fuzzing_binary-only_targets.md share/doc/afl/fuzzing_in_depth.md -share/doc/afl/ideas.md share/doc/afl/important_changes.md share/doc/afl/rpc_statsd.md share/doc/afl/third_party_tools.md