Index: build/config/win/BUILD.gn |
diff --git a/build/config/win/BUILD.gn b/build/config/win/BUILD.gn |
index 2b9f7bf77373532e5cca7d033bdd5459d460279f..562c85640d6783a990bd81cd17e2bd88bbdf383d 100644 |
--- a/build/config/win/BUILD.gn |
+++ b/build/config/win/BUILD.gn |
@@ -92,9 +92,21 @@ config("compiler") { |
# release image. It is enabled for syzyasan builds and opportunistically for |
# other builds where it is not prohibited (not supported when incrementally |
# linking, using /debug:fastlink, or building with clang). |
- if (is_syzyasan || |
- (!is_debug && !is_component_build && !is_win_fastlink && !is_clang)) { |
- ldflags = [ "/PROFILE" ] |
+ if (is_syzyasan || (!is_debug && !is_component_build && !is_clang)) { |
+ if (is_win_fastlink) { |
scottmg
2016/11/10 21:56:27
I think this changes the behaviour for is_syzyasan
brucedawson
2016/11/10 22:04:06
Good catch. Logic is hard. Agreed that it probably
brucedawson
2016/11/14 21:34:55
Done.
|
+ # /PROFILE implies the following linker flags. Therefore if we are |
+ # skipping /PROFILE because it is incompatible with /DEBUG:FASTLINK |
+ # we should explicitly add these flags in order to avoid unintended |
+ # consequences such as larger binaries. |
+ ldflags = [ |
+ "/OPT:REF", |
+ "/OPT:ICF", |
+ "/INCREMENTAL:NO", |
+ "/FIXED:NO", |
+ ] |
+ } else { |
+ ldflags = [ "/PROFILE" ] |
+ } |
} |
# arflags apply only to static_libraries. The normal linker configs are only |