Build error in `libfuzzer_dataflow` integration
One build command that runs in /src/openss/ reads:
./config --prefix=/src/curl_install --debug enable-fuzz-libfuzzer -DPEDANTIC -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION no-shared enable-tls1_3 enable-rc5 enable-md2 enable-ssl3 enable-ec_nistp_64_gcc_128 enable-ssl3-method enable-nextprotoneg enable-weak-ssl-ciphers -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION -pthread -Wl,--no-as-needed -Wl,-ldl -Wl,-lm -Wno-unused-command-line-argument -O3 -fsanitize=fuzzer-no-link -fsanitize-coverage=trace-loads,trace-stores /weak.o -fno-sanitize=alignment
This command fails with the following output:
Operating system: x86_64-whatever-linux2
Configuring for linux-x86_64-clang
target already defined - linux-x86_64-clang (offending arg: /weak.o)
To fix it, the command needs to be changed to:
./Configure --prefix=/src/curl_install --debug enable-fuzz-libfuzzer -DPEDANTIC -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION no-shared enable-tls1_3 enable-rc5 enable-md2 enable-ssl3 enable-ec_nistp_64_gcc_128 enable-ssl3-method enable-nextprotoneg enable-weak-ssl-ciphers -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION -pthread -Wl,--no-as-needed -Wl,-ldl -Wl,-lm -Wno-unused-command-line-argument -O3 -fsanitize=fuzzer-no-link -fsanitize-coverage=trace-loads,trace-stores /weak.o -fno-sanitize=alignment os/compiler:linux-x86_64-clang
That is:
- Replace the leading
./configwith./Configure, and - Append
os/compiler:linux-x86_64-clangat the end.
However, I am not sure what is the best way to fix it in its Dockerfile.
Why do we still need libfuzzer_dataflow?
Because we want to compare its performance with Centipede: They use the same dataflow tracing algorithm to assist fuzzing but rely on different engineering backend.
Is this hard to fix because the dockerfile calls into scripts that are kept in the curl repo? Can you make a copy of the script (put it in curl/third_party because it is third_party code) and patch it as needed.
Ah thanks! Yesterday I was looking at the code and wondering how it could be done. I will do as you suggested!
Hmm... It seems my hack did not fix the error but deferred it to later build steps.
Got a lot of strange ld errors like:
/usr/bin/ld: Dwarf Error: found dwarf version '304', this reader only handles version '2', '3', '4'.
Not sure how to fix it now.