This straightforward update builds with llvm22 and kind of works with
the caveat that you need to pass LDFLAGS=-lexecinfo to afl-cc and
friends. This can be solved with wrapper scripts but it would be nice if
there was a better solution...

Index: Makefile
===================================================================
RCS file: /cvs/ports/devel/afl++/Makefile,v
diff -u -p -r1.14 Makefile
--- Makefile    2 Jun 2026 17:47:05 -0000       1.14
+++ Makefile    8 Jun 2026 19:21:44 -0000
@@ -14,7 +14,7 @@ MAINTAINER=   Jasper Lievisse Adriaanse <j
 # 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}"
Index: distinfo
===================================================================
RCS file: /cvs/ports/devel/afl++/distinfo,v
diff -u -p -r1.6 distinfo
--- distinfo    17 Jun 2025 07:07:05 -0000      1.6
+++ distinfo    8 Jun 2026 19:21:44 -0000
@@ -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
Index: patches/patch-GNUmakefile
===================================================================
RCS file: /cvs/ports/devel/afl++/patches/patch-GNUmakefile,v
diff -u -p -r1.7 patch-GNUmakefile
--- patches/patch-GNUmakefile   17 Jun 2025 07:07:05 -0000      1.7
+++ patches/patch-GNUmakefile   8 Jun 2026 19:21:44 -0000
@@ -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"
Index: patches/patch-GNUmakefile_llvm
===================================================================
RCS file: /cvs/ports/devel/afl++/patches/patch-GNUmakefile_llvm,v
diff -u -p -r1.2 patch-GNUmakefile_llvm
--- patches/patch-GNUmakefile_llvm      11 Mar 2022 18:49:31 -0000      1.2
+++ patches/patch-GNUmakefile_llvm      8 Jun 2026 19:21:44 -0000
@@ -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")
- 
Index: patches/patch-afl-cmin
===================================================================
RCS file: /cvs/ports/devel/afl++/patches/patch-afl-cmin,v
diff -u -p -r1.3 patch-afl-cmin
--- patches/patch-afl-cmin      9 Feb 2024 13:23:31 -0000       1.3
+++ patches/patch-afl-cmin      8 Jun 2026 19:21:44 -0000
@@ -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) {
Index: patches/patch-utils_aflpp_driver_aflpp_driver_c
===================================================================
RCS file: 
/cvs/ports/devel/afl++/patches/patch-utils_aflpp_driver_aflpp_driver_c,v
diff -u -p -r1.3 patch-utils_aflpp_driver_aflpp_driver_c
--- patches/patch-utils_aflpp_driver_aflpp_driver_c     17 Jun 2025 07:07:05 
-0000      1.3
+++ patches/patch-utils_aflpp_driver_aflpp_driver_c     8 Jun 2026 19:21:44 
-0000
@@ -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; }
  
Index: pkg/PLIST
===================================================================
RCS file: /cvs/ports/devel/afl++/pkg/PLIST,v
diff -u -p -r1.6 PLIST
--- pkg/PLIST   17 Jun 2025 07:07:05 -0000      1.6
+++ pkg/PLIST   8 Jun 2026 19:21:44 -0000
@@ -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_doc
 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

Reply via email to