google / fuzzbench

FuzzBench - Fuzzer benchmarking as a service.

Home Page:https://google.github.io/fuzzbench/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot build AFL++ SanitizerCoverageLTO pass due to LLVM version

VoodooChild99 opened this issue · comments

Hi:

When testing the libxml2_xml benchmark locally, I ran into an error when building AFL++ SanitizerCoverageLTO pass (version: AFLplusplus/AFLplusplus@2d0d1e2):

/usr/local/bin/clang++ `llvm-config --cxxflags` -fno-rtti -fPIC -O1 -fno-omit-frame-pointer -gline-tables-only -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION -stdlib=libc++ -Wall -g -I ./include/ -DVERSION=\"++4.06a\" -Wno-variadic-macros -Wno-deprecated-copy-with-dtor -DLLVM_MINOR=0 -DLLVM_MAJOR=15 -Wno-deprecated-declarations -Wl,-znodelete -Wno-writable-strings -fno-rtti -fPIC -std=c++14 -shared instrumentation/SanitizerCoverageLTO.so.cc -o SanitizerCoverageLTO.so `llvm-config --ldflags`  instrumentation/afl-llvm-common.o
instrumentation/SanitizerCoverageLTO.so.cc:329:16: error: no member named 'registerFullLinkTimeOptimizationLastEPCallback' in 'llvm::PassBuilder'
            PB.registerFullLinkTimeOptimizationLastEPCallback(
            ~~ ^
1 error generated.
make[1]: *** [GNUmakefile.llvm:431: SanitizerCoverageLTO.so] Error 1

After some digging, it seems that the current LLVM version in the image was built on this commit: llvm/llvm-project@bf7f8d6:

root@70030a7d3d28:/afl# clang++ --version
clang version 15.0.0 (https://github.com/llvm/llvm-project.git bf7f8d6fa6f460bf0a16ffec319cd71592216bf4)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/bin

But registerFullLinkTimeOptimizationLastEPCallback() was introduced later in this commit: llvm/llvm-project@942efa5, which I guess causes the error.

I think maybe the LLVM version should be updated?

I am unsure if it is a good time to update llvm in the base-image, given it will also affect other fuzzers & benchmarks.
Would it be better mitigation to create a new version of AFL++ with it and download the new llvm in its own dockerfile?
@jonathanmetzman WDYT?