Sync Windows build flags between GYP and GN
In GN, turn on omtimize:max for base targets on all platforms, not just Android (matches GYP). In GN, don't duplicate /Os twice, make standard optimize = /O1 (matches GYP). Don't specify redundant optimization flags that are included as part of /O1 or /O2 (doesn't match GYP flag-wise, but should match functionality-wise). In GN, add a min Windows version of XP to x86 architecture binaries (matches GYP). In GYP, remove /GT ("EnableFiberSafeOptimizations"). This flag is super old (pre-dates GYP) and was likely turned on because it has the word "optimization" in it. It was only specified in official builds. However, according to the docs, this is making optimizations fiber safe (i.e. slower, by not caching the TLS pointer), rather than enabling optimizations for fibers. We don't use fibers so this flag is unnecessary and may be making TLS access slightly slower. Review URL: https://codereview.chromium.org/1183613006 Cr-Original-Commit-Position: refs/heads/master@{#334742} Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src Cr-Mirrored-Commit: 67021f4d70fe838a5d78133bc6d5b305dfd70d72
This commit is contained in:
Родитель
1ab388775c
Коммит
2949f0c647
|
@ -1092,12 +1092,11 @@ config("no_size_t_to_int_warning") {
|
|||
# configs += [ "//build/config/compiler/optimize_max" ]
|
||||
|
||||
# Shared settings for both "optimize" and "optimize_max" configs.
|
||||
# IMPORTANT: On Windows "/O1" and "/O2" must go before the common flags.
|
||||
if (is_win) {
|
||||
common_optimize_on_cflags = [
|
||||
"/O2",
|
||||
"/Ob2", # both explicit and auto inlining.
|
||||
"/Oy-", # disable omitting frame pointers, must be after /o2.
|
||||
"/Os", # favor size over speed.
|
||||
"/Ob2", # Both explicit and auto inlining.
|
||||
"/Oy-", # Disable omitting frame pointers, must be after /O2.
|
||||
]
|
||||
if (!is_asan) {
|
||||
common_optimize_on_cflags += [
|
||||
|
@ -1163,15 +1162,16 @@ if (is_win) {
|
|||
|
||||
# Default "optimization on" config. On Windows, this favors size over speed.
|
||||
config("optimize") {
|
||||
cflags = common_optimize_on_cflags
|
||||
ldflags = common_optimize_on_ldflags
|
||||
if (is_win) {
|
||||
cflags += [ "/Os" ] # favor size over speed.
|
||||
# Favor size over speed, /O1 must be before the common flags. The GYP
|
||||
# build also specifies /Os and /GF but these are implied by /O1.
|
||||
cflags = [ "/O1" ] + common_optimize_on_cflags + [ "/Oi" ]
|
||||
} else if (is_android || is_ios) {
|
||||
cflags += [ "-Os" ] # Favor size over speed.
|
||||
cflags = [ "-Os" ] + common_optimize_on_cflags # Favor size over speed.
|
||||
} else {
|
||||
cflags += [ "-O2" ]
|
||||
cflags = [ "-O2" ] + common_optimize_on_cflags
|
||||
}
|
||||
ldflags = common_optimize_on_ldflags
|
||||
}
|
||||
|
||||
# Turn off optimizations.
|
||||
|
@ -1203,11 +1203,11 @@ config("no_optimize") {
|
|||
# optimization and link-time code generation which is very expensive and should
|
||||
# be used sparingly.
|
||||
config("optimize_max") {
|
||||
cflags = common_optimize_on_cflags
|
||||
ldflags = common_optimize_on_ldflags
|
||||
if (is_win) {
|
||||
cflags -= [ "/Os" ]
|
||||
cflags += [ "/Ot" ] # Favor speed over size.
|
||||
# Favor speed over size, /O2 must be before the common flags. The GYP
|
||||
# build also specifies /Ot, /Oi, and /GF, but these are implied by /O2.
|
||||
cflags = [ "/O2" ] + common_optimize_on_cflags
|
||||
if (is_official_build) {
|
||||
# TODO(GYP): TODO(dpranke): Should these only be on in an official
|
||||
# build, or on all the time? For now we'll require official build so
|
||||
|
@ -1224,7 +1224,7 @@ config("optimize_max") {
|
|||
ldflags += [ "/LTCG" ]
|
||||
}
|
||||
} else {
|
||||
cflags += [ "-O2" ]
|
||||
cflags = [ "-O2" ] + common_optimize_on_cflags
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -103,8 +103,8 @@ if (current_cpu == "x64") {
|
|||
# 5.02 = Windows Server 2003.
|
||||
subsystem_version_suffix = ",5.02"
|
||||
} else {
|
||||
# Don't specify a min version on x86.
|
||||
subsystem_version_suffix = ""
|
||||
# 5.01 = Windows XP.
|
||||
subsystem_version_suffix = ",5.01"
|
||||
}
|
||||
|
||||
config("console") {
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
'VCCLCompilerTool': {
|
||||
'InlineFunctionExpansion': '2',
|
||||
'EnableIntrinsicFunctions': 'true',
|
||||
'EnableFiberSafeOptimizations': 'true',
|
||||
'OmitFramePointers': 'false',
|
||||
# The above is not sufficient (http://crbug.com/106711): it
|
||||
# simply eliminates an explicit "/Oy", but both /O2 and /Ox
|
||||
|
|
Загрузка…
Ссылка в новой задаче