Index: lib/fuzzer/FuzzerExtFunctionsDlsym.cpp =================================================================== --- lib/fuzzer/FuzzerExtFunctionsDlsym.cpp +++ lib/fuzzer/FuzzerExtFunctionsDlsym.cpp @@ -12,7 +12,7 @@ // That is a complication we don't wish to expose to clients right now. //===----------------------------------------------------------------------===// #include "FuzzerDefs.h" -#if LIBFUZZER_APPLE +#if LIBFUZZER_APPLE && !LIBFUZZER_WITH_UNDEFINED_WEAK_SYMBOLS #include "FuzzerExtFunctions.h" #include "FuzzerIO.h" Index: lib/fuzzer/FuzzerExtFunctionsWeak.cpp =================================================================== --- lib/fuzzer/FuzzerExtFunctionsWeak.cpp +++ lib/fuzzer/FuzzerExtFunctionsWeak.cpp @@ -10,10 +10,11 @@ // symbols. We don't use this approach on Apple platforms because it requires // clients of LibFuzzer to pass ``-U _`` to the linker to allow // weak symbols to be undefined. That is a complication we don't want to expose -// to clients right now. +// to clients right now. However, if someone prefers that way, they need to +// explicitly define LIBFUZZER_WITH_UNDEFINED_WEAK_SYMBOLS. //===----------------------------------------------------------------------===// #include "FuzzerDefs.h" -#if LIBFUZZER_LINUX || LIBFUZZER_NETBSD +#if LIBFUZZER_LINUX || LIBFUZZER_NETBSD || LIBFUZZER_WITH_UNDEFINED_WEAK_SYMBOLS #include "FuzzerExtFunctions.h" #include "FuzzerIO.h"