]> git.armaanb.net Git - asd-repo.git/blob - extra/chromium/patches/wyverkiss-optional-clang-plugins.patch
Switch browser to Chromium
[asd-repo.git] / extra / chromium / patches / wyverkiss-optional-clang-plugins.patch
1 --- a/build/config/clang/clang.gni
2 +++ b/build/config/clang/clang.gni
3 @@ -7,12 +7,18 @@
4  default_clang_base_path = "//third_party/llvm-build/Release+Asserts"
5  
6  declare_args() {
7 +    # Enable clang plugins (-Xclang)
8 +    clang_use_plugins = true
9 +}
10 +
11 +declare_args() {
12    # Indicates if the build should use the Chrome-specific plugins for enforcing
13    # coding guidelines, etc. Only used when compiling with Chrome's Clang, not
14    # Chrome OS's.
15    clang_use_chrome_plugins =
16        is_clang && !is_nacl && !use_xcode_clang &&
17 -      default_toolchain != "//build/toolchain/cros:target"
18 +      default_toolchain != "//build/toolchain/cros:target" &&
19 +      clang_use_plugins
20  
21    clang_base_path = default_clang_base_path
22  }
23 --- a/build/config/compiler/BUILD.gn
24 +++ b/build/config/compiler/BUILD.gn
25 @@ -474,7 +474,7 @@
26  
27    # Enable text section splitting only on linux when using lld for now. Other
28    # platforms can be added later if needed.
29 -  if ((is_linux || is_chromeos) && use_lld && use_text_section_splitting) {
30 +  if ((is_linux || is_chromeos) && use_lld && use_text_section_splitting && clang_use_plugins) {
31      ldflags += [ "-Wl,-z,keep-text-section-prefix" ]
32    }
33  
34 @@ -1115,7 +1115,7 @@
35    }
36  
37    # Makes builds independent of absolute file path.
38 -  if (is_clang && strip_absolute_paths_from_debug_symbols) {
39 +  if (is_clang && strip_absolute_paths_from_debug_symbols && clang_use_plugins) {
40      # If debug option is given, clang includes $cwd in debug info by default.
41      # For such build, this flag generates reproducible obj files even we use
42      # different build directory like "out/feature_a" and "out/feature_b" if
43 @@ -2285,7 +2285,7 @@
44      # All configs using /DEBUG should include this:
45      configs = [ ":win_pdbaltpath" ]
46  
47 -    if (is_clang) {
48 +    if (is_clang && clang_use_plugins) {
49        # Use constructor debug mode. This option reduces debug info more than
50        # -fno-standalone-debug by emitting class type information only when
51        # constructors are emitted.
52 @@ -2321,7 +2321,7 @@
53      }
54  
55      # TODO(https://crbug.com/1050118): Investigate missing debug info on mac.
56 -    if (is_clang && !is_nacl && !use_xcode_clang && !is_apple) {
57 +    if (is_clang && !is_nacl && !use_xcode_clang && !is_apple && clang_use_plugins) {
58        cflags += [
59          "-Xclang",
60          "-debug-info-kind=constructor",