Improve mini installer and official build GN flags
I went through and did some flag auditing to try to get GN's official build mini_installer target as small as GYP's. It's still 512 bytes too large. Adds the custom mini_installer flags to the "lib" target as well as the main mini_installer target. This removes some imports around exception handling. Sync some official build flags: LTCG should go on all optimized targets in official builds, not just "optimize max" ones. Doing this on optimize max has no effect because we only set optimize_max on individual libraries that need to be fast, rather than anything that gets linked. Convert /OPT:REF to /OPT:ICF. GYP specifies both, but ICF seems to imply REF according to MSDN. Added some missing release mode flags "/d2Zi+", "/Zc:inline", and "/cgthreads:8", which I found missing from GN. Removed a dependency on "setup" from mini installer, this is captured by the dependency on ":archive" (which already includes the setup dependency). Review URL: https://codereview.chromium.org/1329833002 Cr-Original-Commit-Position: refs/heads/master@{#347447} Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src Cr-Mirrored-Commit: 7cb45ce734f09f358e62fd982c8fa288673b2ab5
This commit is contained in:
Родитель
e85fbd4398
Коммит
c1b2bea949
|
@ -1172,6 +1172,8 @@ if (is_win) {
|
|||
common_optimize_on_cflags = [
|
||||
"/Ob2", # Both explicit and auto inlining.
|
||||
"/Oy-", # Disable omitting frame pointers, must be after /O2.
|
||||
"/d2Zi+", # Improve debugging of optimized code.
|
||||
"/Zc:inline", # Remove unreferenced COMDAT (faster links).
|
||||
]
|
||||
if (!is_asan) {
|
||||
common_optimize_on_cflags += [
|
||||
|
@ -1183,7 +1185,17 @@ if (is_win) {
|
|||
"/Gw",
|
||||
]
|
||||
}
|
||||
common_optimize_on_ldflags = [ "/OPT:REF" ]
|
||||
common_optimize_on_ldflags = [ "/OPT:ICF" ]
|
||||
if (is_official_build) {
|
||||
common_optimize_on_ldflags += [
|
||||
# Link-time code generation.
|
||||
"/LTCG",
|
||||
|
||||
# Set the number of LTCG code-gen threads to eight. The default is four.
|
||||
# This gives a 5-10% link speedup.
|
||||
"/cgthreads:8",
|
||||
]
|
||||
}
|
||||
} else {
|
||||
common_optimize_on_cflags = [
|
||||
# Don't emit the GCC version ident directives, they just end up in the
|
||||
|
@ -1296,7 +1308,6 @@ config("optimize_max") {
|
|||
# value of C4702 for PGO builds is likely very small.
|
||||
"/wd4702",
|
||||
]
|
||||
ldflags += [ "/LTCG" ]
|
||||
}
|
||||
} else {
|
||||
cflags = [ "-O2" ] + common_optimize_on_cflags
|
||||
|
|
Загрузка…
Ссылка в новой задаче