Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

clang: error: unsupported option --with-fuzzer-lib #102

Open
bagder opened this issue Jan 21, 2024 · 2 comments
Open

clang: error: unsupported option --with-fuzzer-lib #102

bagder opened this issue Jan 21, 2024 · 2 comments

Comments

@bagder
Copy link
Member

bagder commented Jan 21, 2024

It's been a while since I built the fuzzer and now when I run mainline.sh it exits in the OpenSSL build pretty quickly with this error message:

making all in crypto...
make[1]: Entering directory '/home/dast/src/curl-fuzzer/openssl/crypto'
...
clang -I. -I.. -I../include  -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H --debug --with-fuzzer-lib=/usr/lib/libFuzzingEngine -DPEDANTIC -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION -fsanitize=address,fuzzer-no-link -fno-sanitize=alignment -m64 -DL_ENDIAN -O3 -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wno-language-extension-token  -Wno-extended-offsetof -Qunused-arguments -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DRC4_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DAES_ASM -DVPAES_ASM -DBSAES_ASM -DWHIRLPOOL_ASM -DGHASH_ASM -DECP_NISTZ256_ASM -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION  -c -o cryptlib.o cryptlib.c
clang: error: unsupported option '--with-fuzzer-lib=/usr/lib/libFuzzingEngine'
make[1]: *** [<builtin>: cryptlib.o] Error 1
make[1]: Leaving directory '/home/dast/src/curl-fuzzer/openssl/crypto'
make: *** [Makefile:287: build_crypto] Error 1
+ exit 1

This is clang 16, I also tried forcing it to use 14 but it made no difference. I can't recall having seen this before nor how I overcome this in the past. Any clues?

@cmeister2
Copy link
Collaborator

How bizarre. I'd recommend going via the ossfuzz infra helper in the meantime, but I'll investigate.

@cmeister2
Copy link
Collaborator

The method I use (and that I should really document in the REPRODUCING guide) is:

  • Use ossfuzz
  • python3 infra/helper.py build_image curl
  • python3 infra/helper.py build_fuzzers curl
  • Copy the clusterfuzz test case into the ossfuzz build/out directory
  • python3 infra/helper.py shell which drops you into a Docker container
  • export GDBMODE=1
  • Run compile, which will compile the fuzzers for you and also compile a version of GDB that will work
  • Run gdb /out/<thefuzzeryouwanttorun>
  • In gdb, break __asan::ReportGenericError
  • then, run run /out/clusterfuzz-<name of test case>

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Development

No branches or pull requests

2 participants