Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2323)

Unified Diff: build/config/BUILDCONFIG.gn

Issue 1324623005: Move sanitizer and symbol flags out of BUILDCONFIG (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « breakpad/BUILD.gn ('k') | build/config/compiler/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/config/BUILDCONFIG.gn
diff --git a/build/config/BUILDCONFIG.gn b/build/config/BUILDCONFIG.gn
index 4630b2f3bdb8a1f0b470ae788adaa5d64548cc76..71161b086acea93df649bbdedb8d299845338d5a 100644
--- a/build/config/BUILDCONFIG.gn
+++ b/build/config/BUILDCONFIG.gn
@@ -111,14 +111,6 @@ if (current_os == "") {
# even if the value is overridden, which is wasteful. See first bullet.
declare_args() {
- # How many symbols to include in the build. This affects the performance of
- # the build since the symbols are large and dealing with them is slow.
- # 2 means regular build with symbols.
- # 1 means minimal symbols, usually enough for backtraces only.
- # 0 means no symbols.
- # -1 means auto-set (off in release, regular in debug).
- symbol_level = -1
-
# Component build.
is_component_build = false
@@ -133,18 +125,6 @@ declare_args() {
is_clang = current_os == "mac" || current_os == "ios" ||
current_os == "linux" || current_os == "chromeos"
- # Compile for Address Sanitizer to find memory bugs.
- is_asan = false
-
- # Compile for Leak Sanitizer to find leaks.
- is_lsan = false
-
- # Compile for Memory Sanitizer to find uninitialized reads.
- is_msan = false
-
- # Compile for Thread Sanitizer to find threading bugs.
- is_tsan = false
-
if (current_os == "chromeos") {
# Allows the target toolchain to be injected as arguments. This is needed
# to support the CrOS build system which supports per-build-configuration
@@ -176,7 +156,15 @@ declare_args() {
# and there's only one config to remove that's the same in all cases for
# targets that want to override it. It also means that the associated flags can
# be non-global.
-using_new_global_compiler_configs = false
+using_new_global_compiler_configs = true
+
+# To assist in a multi-sided landing of updating the default optimization
+# config. When false, this file sets up the default optimization config to be
+# either "no_optimize" (debug) or "optimize" (release). When true it will
+# always set the config "default_optimization".
+#
+# TODO(brettw) remove this when all repos are updated.
+using_new_optimization_config = true
# To assist in a multi-sided landing of updating the default optimization
# config. When false, this file sets up the default optimization config to be
@@ -184,7 +172,7 @@ using_new_global_compiler_configs = false
# always set the config "default_optimization".
#
# TODO(brettw) remove this when all repos are updated.
-using_new_optimization_config = false
+using_new_optimization_config = true
# =============================================================================
# OS DEFINITIONS
@@ -387,16 +375,6 @@ if (!is_chromeos) {
set_sources_assignment_filter(sources_assignment_filter)
# =============================================================================
-# BUILD OPTIONS
-# =============================================================================
-
-# These Sanitizers all imply using the Clang compiler. On Windows they either
-# don't work or work differently.
-if (!is_clang && (is_asan || is_lsan || is_tsan || is_msan)) {
- is_clang = true
-}
-
-# =============================================================================
# TARGET DEFAULTS
# =============================================================================
#
@@ -413,6 +391,8 @@ _native_compiler_configs = [
"//build/config/compiler:compiler_arm_fpu",
"//build/config/compiler:chromium_code",
"//build/config/compiler:default_include_dirs",
+ "//build/config/compiler:default_optimization",
+ "//build/config/compiler:default_symbols",
"//build/config/compiler:no_rtti",
"//build/config/compiler:runtime_library",
]
@@ -441,7 +421,6 @@ if (is_linux) {
} else if (is_mac) {
_native_compiler_configs += [ "//build/config/mac:sdk" ]
} else if (is_ios) {
- _native_compiler_configs += [ "//build/config/ios:sdk" ]
} else if (is_android) {
_native_compiler_configs += [ "//build/config/android:sdk" ]
}
@@ -453,41 +432,12 @@ if (is_clang && !is_nacl) {
]
}
-# Optimizations and debug checking.
+# Debug/release-related defines.
if (is_debug) {
_native_compiler_configs += [ "//build/config:debug" ]
- _default_optimization_config = "//build/config/compiler:no_optimize"
} else {
_native_compiler_configs += [ "//build/config:release" ]
- _default_optimization_config = "//build/config/compiler:optimize"
-}
-_native_compiler_configs += [ _default_optimization_config ]
-
-# If it wasn't manually set, set to an appropriate default.
-if (symbol_level == -1) {
- # Linux is slowed by having symbols as part of the target binary, whereas
- # Mac and Windows have them separate, so in Release Linux, default them off.
- if (is_debug || !is_linux) {
- symbol_level = 2
- } else if (is_asan || is_lsan || is_tsan || is_msan) {
- # Sanitizers require symbols for filename suppressions to work.
- symbol_level = 1
- } else {
- symbol_level = 0
- }
-}
-
-# Symbol setup.
-if (symbol_level == 2) {
- _default_symbols_config = "//build/config/compiler:symbols"
-} else if (symbol_level == 1) {
- _default_symbols_config = "//build/config/compiler:minimal_symbols"
-} else if (symbol_level == 0) {
- _default_symbols_config = "//build/config/compiler:no_symbols"
-} else {
- assert(false, "Bad value for symbol_level.")
}
-_native_compiler_configs += [ _default_symbols_config ]
# Windows linker setup for EXEs and DLLs.
if (is_win) {
« no previous file with comments | « breakpad/BUILD.gn ('k') | build/config/compiler/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698