Commit 6376140d authored by Jonathan Metzman's avatar Jonathan Metzman Committed by Commit Bot

[libFuzzer][Windows]Temporarily disable /OPT:REF in fuzzer builds

/OPT:REF is currently stripping the constructors needed by sancov
clients (such as libFuzzer). Disable it for fuzzing builds until
this issue is resolved on the Clang/libFuzzer side.

Bug: 884545
Change-Id: I9c12295020e6a2efc2ade268b25a555975e71c85
Reviewed-on: https://chromium-review.googlesource.com/1249151
Commit-Queue: Jonathan Metzman <metzman@chromium.org>
Reviewed-by: default avatarNico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#594927}
parent e4485f20
......@@ -136,13 +136,18 @@ config("compiler") {
ldflags += [ "/TIMESTAMP:" + build_timestamp ]
}
if (!is_debug && !is_component_build) {
if (!is_debug && !is_component_build && !use_libfuzzer) {
# Enable standard linker optimizations like GC (/OPT:REF) and ICF in static
# release builds. These are implied by /PROFILE below, but /PROFILE is
# incompatible with /debug:fastlink and LLD ignores it as of this writing.
# Release builds always want these optimizations, so enable them explicitly.
# TODO(crbug.com/884545): Remove the checks for use_libfuzzer when
# libFuzzer's issues with /OPT:REF are resolved upstream.
if (!use_libfuzzer) {
ldflags += [ "/OPT:REF" ]
}
ldflags += [
"/OPT:REF",
"/OPT:ICF",
"/INCREMENTAL:NO",
"/FIXED:NO",
......@@ -159,7 +164,9 @@ config("compiler") {
# PDB file by about 5%) but does not otherwise alter the output binary. It
# is enabled opportunistically for builds where it is not prohibited (not
# supported when incrementally linking, or using /debug:fastlink).
if (!is_win_fastlink) {
# /PROFILE implies /OPT:REF. Don't use it with libFuzzer while /OPT:REF
# can't be used with libFuzzer. See crbug.com/884545 for more details.
if (!is_win_fastlink && !use_libfuzzer) {
ldflags += [ "/PROFILE" ]
}
}
......
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