Commit 837e304b authored by Jonathan Metzman's avatar Jonathan Metzman Committed by Commit Bot

[libFuzzer][Windows]Enable building fuzz targets on Windows.

Bug: 888363
Change-Id: Idfb7c644fa3294ad11327609b4b39eacfd3f5dd2
Reviewed-on: https://chromium-review.googlesource.com/1238917Reviewed-by: default avatarDirk Pranke <dpranke@chromium.org>
Reviewed-by: default avatarMax Moroz <mmoroz@chromium.org>
Commit-Queue: Jonathan Metzman <metzman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#594525}
parent 73942166
......@@ -690,8 +690,8 @@ group("gn_all") {
}
}
if ((is_linux && !is_chromeos && !is_chromecast) || (is_win && use_drfuzz) ||
(use_libfuzzer && is_mac)) {
if ((is_linux && !is_chromeos && !is_chromecast) ||
(is_win && (use_drfuzz || use_libfuzzer)) || (use_libfuzzer && is_mac)) {
deps += [
"//testing/libfuzzer/fuzzers",
"//testing/libfuzzer/tests:libfuzzer_tests",
......
......@@ -227,29 +227,38 @@ config("default_sanitizer_ldflags") {
}
}
}
} else if (is_win && is_asan) {
} else if (is_win) {
# Windows directly calls link.exe instead of the compiler driver when
# linking. Hence, pass the runtime libraries instead of -fsanitize=address.
# In the static-library build, libraries are different for executables
# and dlls, see link_executable and link_shared_library below.
# This here handles only the component build.
if (target_cpu == "x64") {
# Windows 64-bit.
if (is_component_build) {
# linking. Hence, pass the runtime libraries instead of -fsanitize=address
# or -fsanitize=fuzzer.
if (is_asan && is_component_build) {
# In the static-library build, ASan libraries are different for
# executables and dlls, see link_executable and link_shared_library below.
# This here handles only the component build.
if (target_cpu == "x64") {
# Windows 64-bit.
libs = [
"clang_rt.asan_dynamic-x86_64.lib",
"clang_rt.asan_dynamic_runtime_thunk-x86_64.lib",
]
}
} else {
assert(target_cpu == "x86", "WinASan unsupported architecture")
if (is_component_build) {
} else {
assert(target_cpu == "x86", "WinASan unsupported architecture")
libs = [
"clang_rt.asan_dynamic-i386.lib",
"clang_rt.asan_dynamic_runtime_thunk-i386.lib",
]
}
}
if (use_libfuzzer) {
assert(target_cpu == "x64", "LibFuzzer unsupported architecture")
assert(!is_component_build,
"LibFuzzer only supports non-component builds on Windows")
# Incremental linking causes padding that messes up SanitizerCoverage.
# Don't do it.
ldflags = [ "/INCREMENTAL:NO" ]
libs = [ "clang_rt.fuzzer_no_main-x86_64.lib" ]
}
}
}
......
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