--- patch97/build/config/compiler/BUILD.gn 2021-12-31 01:57:18.000000000 +0100 +++ patch97/build/config/compiler/BUILD.gn.compiler-r4 2022-01-05 19:03:04.147980164 +0100 @@ -296,8 +296,6 @@ config("compiler") { configs += [ # See the definitions below. - ":clang_revision", - ":compiler_cpu_abi", ":compiler_codegen", ":compiler_deterministic", ] @@ -1471,9 +1469,6 @@ config("default_warnings") { # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63872 cflags += [ "-Wno-unused-local-typedefs" ] - # Don't warn about "maybe" uninitialized. Clang doesn't include this - # in -Wall but gcc does, and it gives false positives. - cflags += [ "-Wno-maybe-uninitialized" ] cflags += [ "-Wno-deprecated-declarations" ] # -Wcomment gives too many false positives in the case a @@ -1518,37 +1513,6 @@ config("default_warnings") { # Warns in ATL headers; see https://crbug.com/1208419. cflags += [ "-Wno-null-pointer-subtraction" ] } - - if (current_toolchain == host_toolchain || !use_xcode_clang) { - # Flags Xcode 9.2 (Clang clang-900.0.39.2) does not recognize. - cflags += [ - "-Wenum-compare-conditional", - - # An ABI compat warning we don't care about, https://crbug.com/1102157 - # TODO(thakis): Push this to the (few) targets that need it, - # instead of having a global flag. - "-Wno-psabi", - - # Ignore warnings about MSVC optimization pragmas. - # TODO(thakis): Only for no_chromium_code? http://crbug.com/912662 - "-Wno-ignored-pragma-optimize", - ] - - if (is_chromeos || - default_toolchain == "//build/toolchain/cros:target") { - # TODO(https://crbug.com/1016945): Re-enable once ChromeOS toolchain is up to date - cflags += [ "-Wno-builtin-assume-aligned-alignment" ] - } - - if (is_fuchsia) { - # TODO(https://bugs.chromium.org/p/fuchsia/issues/detail?id=77383) - cflags += [ "-Wno-deprecated-copy" ] - } - - if (enable_wmax_tokens) { - cflags += [ "-Wmax-tokens" ] - } - } } } } @@ -1588,15 +1552,6 @@ config("chromium_code") { "__STDC_FORMAT_MACROS", ] - if (!is_debug && !using_sanitizer && current_cpu != "s390x" && - current_cpu != "s390" && current_cpu != "ppc64" && - current_cpu != "mips" && current_cpu != "mips64") { - # Non-chromium code is not guaranteed to compile cleanly with - # _FORTIFY_SOURCE. Also, fortified build may fail when optimizations are - # disabled, so only do that for Release build. - defines += [ "_FORTIFY_SOURCE=2" ] - } - if (is_mac) { cflags_objc = [ "-Wobjc-missing-property-synthesis" ] cflags_objcc = [ "-Wobjc-missing-property-synthesis" ] @@ -1964,7 +1919,8 @@ config("default_stack_frames") { } # Default "optimization on" config. -config("optimize") { +config("optimize") { } +config("xoptimize") { if (is_win) { if (chrome_pgo_phase != 2) { # Favor size over speed, /O1 must be before the common flags. @@ -2004,7 +1960,8 @@ config("optimize") { } # Turn off optimizations. -config("no_optimize") { +config("no_optimize") { } +config("xno_optimize") { if (is_win) { cflags = [ "/Od", # Disable optimization. @@ -2044,7 +2001,8 @@ config("no_optimize") { # Turns up the optimization level. On Windows, this implies whole program # optimization and link-time code generation which is very expensive and should # be used sparingly. -config("optimize_max") { +config("optimize_max") { } +config("xoptimize_max") { if (is_nacl && is_nacl_irt) { # The NaCl IRT is a special case and always wants its own config. # Various components do: @@ -2077,7 +2035,8 @@ config("optimize_max") { # # TODO(crbug.com/621335) - rework how all of these configs are related # so that we don't need this disclaimer. -config("optimize_speed") { +config("optimize_speed") { } +config("xoptimize_speed") { if (is_nacl && is_nacl_irt) { # The NaCl IRT is a special case and always wants its own config. # Various components do: @@ -2103,7 +2062,8 @@ config("optimize_speed") { } } -config("optimize_fuzzing") { +config("optimize_fuzzing") { } +config("xoptimize_fuzzing") { cflags = [ "-O1" ] + common_optimize_on_cflags rustflags = [ "-Copt-level=1" ] ldflags = common_optimize_on_ldflags @@ -2223,7 +2183,8 @@ config("win_pdbaltpath") { } # Full symbols. -config("symbols") { +config("symbols") { } +config("xsymbols") { if (is_win) { if (is_clang) { cflags = [ "/Z7" ] # Debug information in the .obj files. @@ -2348,7 +2309,8 @@ config("symbols") { # Minimal symbols. # This config guarantees to hold symbol for stack trace which are shown to user # when crash happens in unittests running on buildbot. -config("minimal_symbols") { +config("minimal_symbols") { } +config("xminimal_symbols") { if (is_win) { # Functions, files, and line tables only. cflags = [] @@ -2418,7 +2380,8 @@ config("minimal_symbols") { # This configuration contains function names only. That is, the compiler is # told to not generate debug information and the linker then just puts function # names in the final debug information. -config("no_symbols") { +config("no_symbols") { } +config("xno_symbols") { if (is_win) { ldflags = [ "/DEBUG" ]