Bug 2459753

Summary: AFL's GCC plugin reports error
Product: [Fedora] Fedora Reporter: W. Michael Petullo <mike>
Component: american-fuzzy-lopAssignee: Richard W.M. Jones <rjones>
Status: NEW --- QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 44CC: p, rjones
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: ---
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description W. Michael Petullo 2026-04-20 14:05:12 UTC
I applied AFL to an old project to re-familiarize myself with the tool. I found that the project would not compile with AFL's afl-gcc-fast, but it would compile with AFL's afl-clang-fast.

Versions used:

american-fuzzy-lop-4.35c-5.20260206gitafbcb07.fc44.x86_64
gcc-16.0.1-0.10.fc44.x86_64
clang-22.1.1-2.fc44.x86_64

Reproducible: Always

Steps to Reproduce:
I downloaded an old version of flac (https://ftp.osuosl.org/pub/xiph/releases/flac/flac-1.0-src.tar.gz), and I configured it with:

CC="gcc -std=c89" ./configure --disable-shared

Next, I tried to compile it with:

make CC="/bin/afl-gcc-fast -std=c89"
Actual Results:
The build failed with the following error:

[...]
make[3]: Entering directory 'flac-1.0/src/libFLAC'
/bin/sh ../../libtool --mode=compile /bin/afl-gcc-fast -std=c89 -DPACKAGE=\"flac\" -DVERSION=\"1.0\" -DSIZEOF_SHORT=2 -DSIZEOF_INT=4 -DSIZEOF_LONG=8 -DSIZEOF_LONG_LONG=8  -I. -I.      -I../.. -I./include -I ../../include -Wall -W -O3 -DNDEBUG -fomit-frame-pointer -funroll-loops -finline-functions -Winline -DFLaC__INLINE=__inline__ -g -O2 -c bitbuffer.c
../../libtool: line 722: test: =: unary operator expected
/bin/afl-gcc-fast -std=c89 -DPACKAGE=\"flac\" -DVERSION=\"1.0\" -DSIZEOF_SHORT=2 -DSIZEOF_INT=4 -DSIZEOF_LONG=8 -DSIZEOF_LONG_LONG=8 -I. -I. -I../.. -I./include -I ../../include -Wall -W -O3 -DNDEBUG -fomit-frame-pointer -funroll-loops -finline-functions -Winline -DFLaC__INLINE=__inline__ -g -O2 -c bitbuffer.c -o bitbuffer.o
afl-cc++4.36a by Michal Zalewski, Laszlo Szekeres, Marc Heuse - mode: GCC_PLUGIN-DEFAULT

[-] PROGRAM ABORT : GCC and plugin have incompatible versions, expected GCC 16.0.1, is 16.0.1
         Location : plugin_init(), instrumentation/afl-gcc-pass.so.cc:482


Additional Information:
Replacing "gcc" with "clang" allowed the compile to complete. So, there seems to be a problem with the gcc plugin, but the clang plugin works.

Comment 1 Richard W.M. Jones 2026-04-23 10:17:13 UTC
Probably a dupe of either https://bugzilla.redhat.com/show_bug.cgi?id=2430875 or
https://bugzilla.redhat.com/show_bug.cgi?id=2297764

Please try the Rawhide version where it should all be fixed.

Comment 2 W. Michael Petullo 2026-06-12 13:38:44 UTC
The problem seems to remain when using the Rawhide packages. Here is the result after I installed them:

$ rpm -q american-fuzzy-lop gcc
american-fuzzy-lop-4.40c-1.20260313git263c433.fc45.x86_64
gcc-16.1.1-2.fc44.x86_64
$ afl-gcc-fast hello.c 
afl-cc++4.40c by Michal Zalewski, Laszlo Szekeres, Marc Heuse - mode: GCC_PLUGIN-DEFAULT

[-] PROGRAM ABORT : GCC and plugin have incompatible versions, expected GCC 16.0.1, is 16.1.1
         Location : plugin_init(), instrumentation/afl-gcc-pass.so.cc:622

Comment 3 Richard W.M. Jones 2026-06-25 11:37:01 UTC
I just built a new version (5.01c) in Rawhide.

I guess we probably need a hard GCC dependency, which is a big pain for everyone.