Commit f9eb31bb authored by Max Moroz's avatar Max Moroz Committed by Commit Bot

[fuzzer] Declare LLVMFuzzerInitialize with attributes only if V8_OS_MACOSX.

R=ahaas@chromium.org, clemensh@chromium.org, mathias@chromium.org

Bug: chromium:754124, chromium:787723
Change-Id: I7eafee50a47ca0ad56a5458f1f232e3ed07c1cca
Reviewed-on: https://chromium-review.googlesource.com/834457Reviewed-by: 's avatarClemens Hammacher <clemensh@chromium.org>
Commit-Queue: Max Moroz <mmoroz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50217}
parent 52cc5fe0
......@@ -89,7 +89,14 @@ bool FuzzerSupport::PumpMessageLoop(
} // namespace v8_fuzzer
extern "C" int LLVMFuzzerInitialize(int* argc, char*** argv) {
// Explicitly specify some attributes to avoid issues with the linker dead-
// stripping the following function on macOS, as it is not called directly
// by fuzz target. LibFuzzer runtime uses dlsym() to resolve that function.
#if V8_OS_MACOSX
__attribute__((used)) __attribute__((visibility("default")))
#endif // V8_OS_MACOSX
extern "C" int
LLVMFuzzerInitialize(int* argc, char*** argv) {
v8_fuzzer::FuzzerSupport::InitializeFuzzerSupport(argc, argv);
return 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment