While updating my zroaring project to zig 0.17.0, i’m seeing the error below. This happens while building an AFL fuzz exe. If I’m reading right, It seems that latest AFL from nix packages unstable uses llvm 21.8 while zig 0.17 uses llvm 22. afl-clang-lto version 5 is showing the error message below.
Looking for suggestions on how to get it working again. I guess we have to wait for AFL to update to llvm 22 and stay on 0.16.0 in the meantime? .
Building AFL++ from source actually isn’t too bad as long as you restrict it to the modes you need. I have instructions here:
Clone https://github.com/AFLplusplus/AFLplusplus (avoid recursively cloning, avoid initializing submodules–they are huge and unnecessary for our purposes)
Make sure llvm-config --version matches the same version that your Zig uses
cd AFLplusplus
make source-only NO_NYX=1
make install
(or sudo make install if needed)
And I actually will need to build AFL++ in a second, so I’ll report back if the instructions need to change in any way.
Building from source seems like a good option. I’m getting most of the way through it but can’t seem to get LTO mode to compile. Let me know how it goes.
[-] LLVM LTO mode could not be built, it is optional, if you want it, please install LLVM 11-14. More information at instrumentation/README.lto.md on how to build it
AFL++ isn’t tied to a particular LLVM version, so using the latest stable branch should work, too. I just compiled successfully with LLVM 23, will try again with LLVM 22 later if you can’t get it working.
Here’s what part of the build output for me looks like, what does this part of the build output look like for you?
make[1]: Entering directory '/home/ryan/Programming/misc/fuzzing/AFLplusplus'
[+] llvm_mode detected llvm 16+, enabling c++17
[+] llvm_mode detected llvm 12+, enabling afl-lto LTO implementation
[+] shmat seems to be working.
[*] Checking for working 'llvm-config'...
[*] Checking for working '/usr/lib/llvm-23/bin/clang'...
[*] Checking for matching versions of '/usr/lib/llvm-23/bin/clang' and 'llvm-config'
[*] We have llvm-config version 23.1.4 with a clang version 23.1.4, good.
Discovered that v4.40c was the llvm 22 tag. Was able to build afl-cc and afl-clang-lto with llvm 22 even though there were some unrelated build errors.