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-6723a/build/config/compiler/BUILD.gn.orig	2024-11-07 10:11:48.271869495 +0100
+++ webrtc-6723a/build/config/compiler/BUILD.gn	2024-11-07 10:25:15.101723318 +0100
@@ -343,7 +343,6 @@ config("compiler") {
   if (!is_win) {
     # Common POSIX compiler flags setup.
     # --------------------------------
-    cflags += [ "-fno-strict-aliasing" ]  # See http://crbug.com/32204
 
     # Stack protection. ShadowCallStack and Stack protector address the same
     # problems. Therefore, we only enable one or the other. Clang advertises SCS as
@@ -488,10 +487,6 @@ config("compiler") {
   # Linux/Android/Fuchsia common flags setup.
   # ---------------------------------
   if (is_linux || is_chromeos || is_android || is_fuchsia) {
-    asmflags += [ "-fPIC" ]
-    cflags += [ "-fPIC" ]
-    ldflags += [ "-fPIC" ]
-    rustflags += [ "-Crelocation-model=pic" ]
 
     if (!is_clang) {
       # Use pipes for communicating between sub-processes. Faster.
@@ -1178,7 +1173,8 @@ config("thinlto_optimize_max") {
 # 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 = []
@@ -1812,7 +1808,8 @@ config("treat_warnings_as_errors") {
 # Collects all warning flags that are used by default.  This is used as a
 # subconfig of both chromium_code and no_chromium_code.  This way these
 # flags are guaranteed to appear on the compile command line after -Wall.
-config("default_warnings") {
+config("default_warnings") { }
+config("xdefault_warnings") {
   cflags = []
   cflags_c = []
   cflags_cc = []
@@ -2068,11 +2065,7 @@ config("chromium_code") {
       defines = [ "_HAS_NODISCARD" ]
     }
   } else {
-    cflags = [ "-Wall" ]
-    if (is_clang) {
-      # Enable extra warnings for chromium_code when we control the compiler.
-      cflags += [ "-Wextra" ]
-    }
+    cflags = []
 
     # In Chromium code, we define __STDC_foo_MACROS in order to get the
     # C99 macros on Mac and Linux.
@@ -2081,24 +2074,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" &&
-        current_cpu != "riscv64" && current_cpu != "loong64") {
-      # 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.
-      fortify_level = "2"
-
-      # ChromeOS's toolchain supports a high-quality _FORTIFY_SOURCE=3
-      # implementation with a few custom glibc patches. Use that if it's
-      # available.
-      if (is_chromeos_device && !lacros_use_chromium_toolchain) {
-        fortify_level = "3"
-      }
-      defines += [ "_FORTIFY_SOURCE=" + fortify_level ]
-    }
-
     if (is_apple) {
       cflags_objc = [ "-Wimplicit-retain-self" ]
       cflags_objcc = [ "-Wimplicit-retain-self" ]
@@ -2249,7 +2224,6 @@ config("no_rtti") {
 config("export_dynamic") {
   # TODO(crbug.com/40118868): Revisit after target_os flip is completed.
   if (is_linux || is_chromeos_lacros || export_libcxxabi_from_executables) {
-    ldflags = [ "-rdynamic" ]
   }
 }
 
@@ -2337,7 +2311,8 @@ config("wexit_time_destructors") {
 # gcc 4.9 and earlier had no way of suppressing this warning without
 # suppressing the rest of them.  Here we centralize the identification of
 # the gcc 4.9 toolchains.
-config("no_incompatible_pointer_warnings") {
+config("no_incompatible_pointer_warnings") { }
+config("xno_incompatible_pointer_warnings") {
   cflags = []
   if (is_clang) {
     cflags += [ "-Wno-incompatible-pointer-types" ]
@@ -2455,7 +2430,8 @@ if (is_win) {
   common_optimize_on_cflags += [ "-fno-math-errno" ]
 }
 
-config("default_stack_frames") {
+config("default_stack_frames") { }
+config("xdefault_stack_frames") {
   if (!is_win) {
     if (enable_frame_pointers) {
       cflags = [ "-fno-omit-frame-pointer" ]
@@ -2496,7 +2472,8 @@ config("default_stack_frames") {
 # [0]: https://pinpoint-dot-chromeperf.appspot.com/job/147634a8be0000
 # [1]: https://pinpoint-dot-chromeperf.appspot.com/job/132bc772be0000
 # [2]: https://crrev.com/c/5447532
-config("optimize") {
+config("optimize") { }
+config("xoptimize") {
   if (is_win) {
     # clang-cl's /O2 corresponds to clang's -O3, and really want -O2 for
     # consistency with the other platforms.
@@ -2545,7 +2522,8 @@ config("optimize") {
 }
 
 # Turn off optimizations.
-config("no_optimize") {
+config("no_optimize") { }
+config("xno_optimize") {
   if (is_win) {
     cflags = [
       "/Od",  # Disable optimization.
@@ -2585,7 +2563,8 @@ config("no_optimize") {
 # Turns up the optimization level. Used to explicitly enable -O2 instead of
 # -Os for select targets on platforms that use optimize_for_size. No-op
 # elsewhere.
-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:
@@ -2618,7 +2597,8 @@ config("optimize_max") {
 #
 # TODO(crbug.com/41259697) - 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:
@@ -2647,7 +2627,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
@@ -2778,7 +2759,8 @@ config("win_pdbaltpath") {
 }
 
 # Full symbols.
-config("symbols") {
+config("symbols") { }
+config("xsymbols") {
   rustflags = []
   configs = []
   if (is_win) {
@@ -2940,7 +2922,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") {
   rustflags = []
   if (is_win) {
     # Functions, files, and line tables only.
@@ -3025,7 +3008,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" ]
 
--- webrtc-6478b/build_overrides/build.gni.orig	2024-07-03 22:33:28.898523839 +0200
+++ webrtc-6478b/build_overrides/build.gni	2024-07-04 17:52:24.806746119 +0200
@@ -37,19 +37,6 @@ ignore_elf32_limitations = true
 perfetto_build_with_embedder = true
 enable_perfetto_trace_processor = 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