From 0162eb0566bceaa9deb4d4dbbc6d269ca7d05d7b Mon Sep 17 00:00:00 2001 From: Carmelo Messina Date: Wed, 6 Jul 2022 13:35:31 +0200 Subject: [PATCH 1/2] Add kill switch for no-unqualified-std-cast-call --- ...tch-for-no-unqualified-std-cast-call.patch | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 build/patches/Add-kill-switch-for-no-unqualified-std-cast-call.patch diff --git a/build/patches/Add-kill-switch-for-no-unqualified-std-cast-call.patch b/build/patches/Add-kill-switch-for-no-unqualified-std-cast-call.patch new file mode 100644 index 00000000..dcf23922 --- /dev/null +++ b/build/patches/Add-kill-switch-for-no-unqualified-std-cast-call.patch @@ -0,0 +1,36 @@ +From: uazo +Date: Wed, 6 Jul 2022 11:29:24 +0000 +Subject: Add kill switch for no-unqualified-std-cast-call + +Adds a new gn flag to disable the no-unqualified-std-cast-call option during build since it is not compatible +--- + build/config/compiler/BUILD.gn | 2 +- + build_overrides/build.gni | 2 ++ + 2 files changed, 3 insertions(+), 1 deletion(-) + +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 +@@ -1531,7 +1531,7 @@ config("default_warnings") { + "-Wno-ignored-pragma-optimize", + ] + +- if (!is_nacl) { ++ if (!is_nacl && !compile_clangd_index) { + # TODO(https://crbug.com/1300731) Clean up and enable. + cflags += [ "-Wno-unqualified-std-cast-call" ] + } +diff --git a/build_overrides/build.gni b/build_overrides/build.gni +--- a/build_overrides/build.gni ++++ b/build_overrides/build.gni +@@ -42,6 +42,8 @@ declare_args() { + # Allows googletest to pretty-print various absl types. Disabled for nacl due + # to lack of toolchain support. + gtest_enable_absl_printers = !is_nacl ++ ++ compile_clangd_index = false + } + + # Allows different projects to specify their own suppression/ignore lists for +-- +2.25.1 From 506d1a51b838c5c3d73bb69127dcc5d6dd12b22b Mon Sep 17 00:00:00 2001 From: Carmelo Messina Date: Wed, 13 Jul 2022 13:46:04 +0200 Subject: [PATCH 2/2] rename to skip_clangd_unsupported_options --- ...tch-for-no-unqualified-std-cast-call.patch | 34 ++++++++++++++----- 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/build/patches/Add-kill-switch-for-no-unqualified-std-cast-call.patch b/build/patches/Add-kill-switch-for-no-unqualified-std-cast-call.patch index dcf23922..ee0638df 100644 --- a/build/patches/Add-kill-switch-for-no-unqualified-std-cast-call.patch +++ b/build/patches/Add-kill-switch-for-no-unqualified-std-cast-call.patch @@ -1,12 +1,15 @@ From: uazo -Date: Wed, 6 Jul 2022 11:29:24 +0000 +Date: Wed, 13 Jul 2022 09:45:07 +0000 Subject: Add kill switch for no-unqualified-std-cast-call -Adds a new gn flag to disable the no-unqualified-std-cast-call option during build since it is not compatible +Allows build with clangd by suppressing unsupported parameters + +Original License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html +License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html --- - build/config/compiler/BUILD.gn | 2 +- - build_overrides/build.gni | 2 ++ - 2 files changed, 3 insertions(+), 1 deletion(-) + build/config/compiler/BUILD.gn | 8 ++++++-- + build_overrides/build.gni | 3 +++ + 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn --- a/build/config/compiler/BUILD.gn @@ -16,19 +19,34 @@ diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn ] - if (!is_nacl) { -+ if (!is_nacl && !compile_clangd_index) { ++ if (!is_nacl && !skip_clangd_unsupported_options) { # TODO(https://crbug.com/1300731) Clean up and enable. cflags += [ "-Wno-unqualified-std-cast-call" ] } +@@ -1541,8 +1541,12 @@ config("default_warnings") { + # TODO(https://crbug.com/1316298): Re-enable once test failure is figured out + cflags += [ + "-Xclang", +- "-no-opaque-pointers", + ] ++ if (!skip_clangd_unsupported_options) { ++ cflags += [ ++ "-no-opaque-pointers", ++ ] ++ } + } + + if (is_fuchsia) { diff --git a/build_overrides/build.gni b/build_overrides/build.gni --- a/build_overrides/build.gni +++ b/build_overrides/build.gni -@@ -42,6 +42,8 @@ declare_args() { +@@ -42,6 +42,9 @@ declare_args() { # Allows googletest to pretty-print various absl types. Disabled for nacl due # to lack of toolchain support. gtest_enable_absl_printers = !is_nacl + -+ compile_clangd_index = false ++ # Allows clangd builds by suppressing unsupported parameters ++ skip_clangd_unsupported_options = false } # Allows different projects to specify their own suppression/ignore lists for