summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorphoglund <phoglund@chromium.org>2015-06-17 02:08:28 -0700
committerCommit bot <commit-bot@chromium.org>2015-06-17 09:09:26 +0000
commit6a18ffd1f1e656bba0d905c30fad6b46ec4ffcff (patch)
treed179efcf1f48e56042157ee990dada607ab73fb1
parentf4f00c7a28bb5786f5dce52acf4e8bd2d39df6a2 (diff)
downloadchromium_src-6a18ffd1f1e656bba0d905c30fad6b46ec4ffcff.zip
chromium_src-6a18ffd1f1e656bba0d905c30fad6b46ec4ffcff.tar.gz
chromium_src-6a18ffd1f1e656bba0d905c30fad6b46ec4ffcff.tar.bz2
Revert of Revert of Sync Windows build flags between GYP and GN (patchset #1 id:1 of https://codereview.chromium.org/1185963004/)
Reason for revert: Appears this was innocent after all. Original issue's description: > Revert of Sync Windows build flags between GYP and GN (patchset #4 id:60001 of https://codereview.chromium.org/1183613006/) > > Reason for revert: > Speculative revert for Linux GN clobber compile failure: > > FAILED: python ../../remoting/webapp/build-webapp.py ... > Traceback (most recent call last): > File "../../remoting/webapp/build-webapp.py", line 487, in <module> > sys.exit(main()) > File "../../remoting/webapp/build-webapp.py", line 483, in main > return buildWebApp(**vars(args)) > File "../../remoting/webapp/build-webapp.py", line 257, in buildWebApp > + buildtype + ': ' + service_environment) > Exception: Invalid service_environment targeted for Release: > ninja: build stopped: subcommand failed. > > Original issue's description: > > 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. > > > > Committed: https://crrev.com/67021f4d70fe838a5d78133bc6d5b305dfd70d72 > > Cr-Commit-Position: refs/heads/master@{#334742} > > TBR=scottmg@chromium.org,brettw@chromium.org > NOPRESUBMIT=true > NOTREECHECKS=true > NOTRY=true > > Committed: https://crrev.com/1becf72a2d1b5eec4468cc950142b083e9b24fbe > Cr-Commit-Position: refs/heads/master@{#334782} TBR=scottmg@chromium.org,brettw@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Review URL: https://codereview.chromium.org/1184953004 Cr-Commit-Position: refs/heads/master@{#334795}
-rw-r--r--base/BUILD.gn8
-rw-r--r--build/config/compiler/BUILD.gn26
-rw-r--r--build/config/win/BUILD.gn4
-rw-r--r--build/internal/release_impl_official.gypi1
4 files changed, 19 insertions, 20 deletions
diff --git a/base/BUILD.gn b/base/BUILD.gn
index 4a8a193..d5245f3 100644
--- a/base/BUILD.gn
+++ b/base/BUILD.gn
@@ -871,7 +871,7 @@ component("base") {
}
configs += [ "//build/config/compiler:wexit_time_destructors" ]
- if (is_android && !is_debug) {
+ if (!is_debug) {
configs -= [ "//build/config/compiler:optimize" ]
configs += [ "//build/config/compiler:optimize_max" ]
}
@@ -890,7 +890,7 @@ source_set("base_static") {
"win/pe_image.h",
]
- if (is_android && !is_debug) {
+ if (!is_debug) {
configs -= [ "//build/config/compiler:optimize" ]
configs += [ "//build/config/compiler:optimize_max" ]
}
@@ -943,7 +943,7 @@ component("i18n") {
"//third_party/icu",
]
- if (is_android && !is_debug) {
+ if (!is_debug) {
configs -= [ "//build/config/compiler:optimize" ]
configs += [ "//build/config/compiler:optimize_max" ]
}
@@ -1055,7 +1055,7 @@ component("prefs") {
":base",
]
- if (is_android && !is_debug) {
+ if (!is_debug) {
configs -= [ "//build/config/compiler:optimize" ]
configs += [ "//build/config/compiler:optimize_max" ]
}
diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn
index fbf6db6..466b2b9 100644
--- a/build/config/compiler/BUILD.gn
+++ b/build/config/compiler/BUILD.gn
@@ -1091,12 +1091,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 += [
@@ -1162,15 +1161,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.
@@ -1202,11 +1202,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
@@ -1223,7 +1223,7 @@ config("optimize_max") {
ldflags += [ "/LTCG" ]
}
} else {
- cflags += [ "-O2" ]
+ cflags = [ "-O2" ] + common_optimize_on_cflags
}
}
diff --git a/build/config/win/BUILD.gn b/build/config/win/BUILD.gn
index 8b0910f..261a1ac4 100644
--- a/build/config/win/BUILD.gn
+++ b/build/config/win/BUILD.gn
@@ -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") {
diff --git a/build/internal/release_impl_official.gypi b/build/internal/release_impl_official.gypi
index d0729a9..36d5d787 100644
--- a/build/internal/release_impl_official.gypi
+++ b/build/internal/release_impl_official.gypi
@@ -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