diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn index a064291c87d..a4614c2a23d 100644 --- a/build/config/compiler/BUILD.gn +++ b/build/config/compiler/BUILD.gn @@ -698,7 +698,10 @@ if (is_win) { ] } common_optimize_on_ldflags = [ + # Linker GC. "/OPT:REF", + # Identical code folding to reduce size. + # Warning: This changes C/C++ semantics of function pointer comparison. "/OPT:ICF", ] } else { @@ -729,7 +732,7 @@ if (is_win) { common_optimize_on_ldflags += [ # Specifically tell the linker to perform optimizations. # See http://lwn.net/Articles/192624/ . - "-Wl,-O1", + "-Wl,-O2", "-Wl,--gc-sections", ]