File signal-webrtc-disable-compiler-configs.patch of Package nodejs-signal-ringrtc

From f4d0b0eb899005b4b8b6388e1d8bb82cc0018fc8 Mon Sep 17 00:00:00 2001
From: Mike Gilbert <floppym@gentoo.org>
Date: Thu, 20 Aug 2020 19:12:21 +0000
Subject: [PATCH] Disable various compiler configs

---
 build/config/compiler/BUILD.gn | 52 +++++++++++-----------------------
 1 file changed, 17 insertions(+), 35 deletions(-)

Index: webrtc-4896/build/config/compiler/BUILD.gn
===================================================================
--- webrtc-4896.orig/build/config/compiler/BUILD.gn	2022-05-09 07:39:54.745996731 +0200
+++ webrtc-4896/build/config/compiler/BUILD.gn	2022-05-09 07:40:12.090033874 +0200
@@ -880,7 +853,8 @@
 # without using everything that "compiler" brings in.  Options that
 # tweak code generation for a particular CPU do not belong here!
 # See "compiler_codegen", below.
-config("compiler_cpu_abi") {
+config("compiler_cpu_abi") { }
+config("xcompiler_cpu_abi") {
   cflags = []
   ldflags = []
   defines = []
@@ -1619,7 +1619,7 @@ config("chromium_code") {
       defines = [ "_HAS_NODISCARD" ]
     }
   } else {
-    cflags = [ "-Wall" ]
+    cflags = []
     if (treat_warnings_as_errors) {
       cflags += [ "-Werror" ]
 
@@ -1628,10 +1628,6 @@ config("chromium_code") {
       # 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
     # C99 macros on Mac and Linux.
@@ -1640,15 +1636,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" ]
@@ -2055,7 +2042,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.
@@ -2093,7 +2081,8 @@ config("optimize") {
 }
 
 # Turn off optimizations.
-config("no_optimize") {
+config("no_optimize") { }
+config("xno_optimize") {
   if (is_win) {
     cflags = [
       "/Od",  # Disable optimization.
@@ -2133,7 +2122,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:
@@ -2166,7 +2156,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:
@@ -2192,7 +2183,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
@@ -2311,7 +2303,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.
@@ -2439,7 +2432,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 = []
@@ -2512,7 +2506,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" ]
 
Index: webrtc-4896/build_overrides/build.gni
===================================================================
--- webrtc-4896.orig/build_overrides/build.gni	2022-05-05 14:49:25.856557651 +0200
+++ webrtc-4896/build_overrides/build.gni	2022-05-09 07:40:12.090033874 +0200
@@ -32,19 +32,6 @@ ubsan_vptr_ignorelist_path =
 # so we just ignore that assert. See https://crbug.com/648948 for more info.
 ignore_elf32_limitations = true
 
-# Use bundled hermetic Xcode installation maintainted by Chromium,
-# except for local iOS builds where it's unsupported.
-# Allow for mac cross compile on linux machines.
-if (host_os == "mac" || host_os == "linux") {
-  _result = exec_script("//build/mac/should_use_hermetic_xcode.py",
-                        [ target_os ],
-                        "value")
-  assert(_result != 2,
-         "Do not allow building targets with the default " +
-             "hermetic toolchain if the minimum OS version is not met.")
-  use_system_xcode = _result == 0
-}
-
 declare_args() {
   # WebRTC doesn't depend on //base from production code but only for testing
   # purposes. In any case, it doesn't depend on //third_party/perfetto which
openSUSE Build Service is sponsored by