Index: build/config/compiler/BUILD.gn |
diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn |
index 6beb8496992dc912eafacae6f7312d59cfcdfc67..212192e6167ef285faa26989d35c3c1c2d2c6402 100644 |
--- a/build/config/compiler/BUILD.gn |
+++ b/build/config/compiler/BUILD.gn |
@@ -898,7 +898,17 @@ if (is_win) { |
"/Oy-", # disable omitting frame pointers, must be after /o2. |
"/Os", # favor size over speed. |
] |
- common_optimize_on_ldflags = [] |
+ if (!is_asan) { |
+ common_optimize_on_cflags += [ |
+ # Put data in separate COMDATs. This allows the linker |
+ # to put bit-identical constants at the same address even if |
+ # they're unrelated constants, which saves binary size. |
+ # This optimization can't be used when ASan is enabled because |
+ # it is not compatible with the ASan ODR checker. |
+ "/Gw", |
+ ] |
+ } |
+ common_optimize_on_ldflags = [ "/OPT:REF" ] |
} else { |
common_optimize_on_cflags = [ |
# Don't emit the GCC version ident directives, they just end up in the |