From a1207cc75454e653030716948d27ec27412f6fe8 Mon Sep 17 00:00:00 2001 From: Mike Gilbert Date: Sat, 16 Jun 2019 15:43:27 +0100 Subject: [PATCH] Disable various compiler configs --- build/config/compiler/BUILD.gn | 64 +++++++++++++--------------------- 1 file changed, 25 insertions(+), 39 deletions(-) diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn --- a/build/config/compiler/BUILD.gn +++ b/build/config/compiler/BUILD.gn @@ -258,8 +258,6 @@ configs += [ # See the definitions below. - ":clang_revision", - ":compiler_cpu_abi", ":compiler_codegen", ":compiler_deterministic", ] @@ -478,36 +478,6 @@ # platforms can be added later if needed. if ((is_linux || is_chromeos) && use_lld && use_text_section_splitting) { ldflags += [ "-Wl,-z,keep-text-section-prefix" ] - } - - if (is_clang && !is_nacl && !use_xcode_clang) { - cflags += [ "-fcrash-diagnostics-dir=" + clang_diagnostic_dir ] - - cflags += [ - # TODO(hans): Remove this once Clang generates better optimized debug info - # by default. https://crbug.com/765793 - "-mllvm", - "-instcombine-lower-dbg-declare=0", - ] - - # Pinned clang has enable-dse-memoryssa enabled by default but it's broken, - # so we have to force it off. - # Trunk clang has it disabled by default but it might work, so we force it - # on so the ToT bots can check if it works now. - if (!llvm_force_head_revision) { - cflags += [ - # TODO(https://crbug.com/1127713): Investigate, remove. - "-mllvm", - "-enable-dse-memoryssa=false", - ] - } - if (llvm_force_head_revision) { - cflags += [ - # TODO(https://crbug.com/1127713): Investigate, remove. - "-mllvm", - "-enable-dse-memoryssa=true", - ] - } } # C11/C++11 compiler flags setup. @@ -1518,11 +1518,6 @@ # Flags NaCl (Clang 3.7) and Xcode 9.2 (Clang clang-900.0.39.2) do not # recognize. cflags += [ - # 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", @@ -1536,22 +1526,12 @@ # TODO(https://crbug.com/1028110): Evaluate and possible enable. "-Wno-deprecated-copy", - - # TODO(https://crbug.com/1050281): Clean up, enable. - "-Wno-non-c-typedef-for-linkage", ] cflags_c += [ # TODO(https://crbug.com/995993): Clean up and enable. "-Wno-implicit-fallthrough", ] - - if (enable_wmax_tokens) { - cflags += [ "-Wmax-tokens" ] - } else { - # TODO(https://crbug.com/1049569): Remove after Clang 87b235db. - cflags += [ "-Wno-max-tokens" ] - } } } } @@ -1576,7 +1553,7 @@ defines = [ "_HAS_NODISCARD" ] } } else { - cflags = [ "-Wall" ] + cflags = [] if (treat_warnings_as_errors) { cflags += [ "-Werror" ] @@ -1584,10 +1561,6 @@ # the actual linker. Make sure these warnings are treated as errors as # well. ldflags = [ "-Werror" ] - } - if (is_clang) { - # Enable extra warnings for chromium_code when we control the compiler. - cflags += [ "-Wextra" ] } # In Chromium code, we define __STDC_foo_MACROS in order to get the @@ -1596,15 +1569,6 @@ "__STDC_CONSTANT_MACROS", "__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" ] @@ -1691,12 +1655,6 @@ # suppressing them individually, we just blanket suppress them here. "-Wno-unused-variable", ] - if (!is_nacl && (current_toolchain == host_toolchain || !use_xcode_clang)) { - cflags += [ - # TODO(https://crbug.com/1031169): Clean up and enable. - "-Wno-misleading-indentation", - ] - } } configs = [ ":default_warnings" ]