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
@@ -317,7 +317,6 @@
if (!is_win) {
# Common POSIX compiler flags setup.
# --------------------------------
- cflags += [ "-fno-strict-aliasing" ] # See http://crbug.com/32204
# Stack protection.
if (is_mac) {
@@ -427,9 +426,6 @@
# Linux/Android/Fuchsia common flags setup.
# ---------------------------------
if (is_linux || is_chromeos || is_android || is_fuchsia) {
- asmflags += [ "-fPIC" ]
- cflags += [ "-fPIC" ]
- ldflags += [ "-fPIC" ]
if (!is_clang) {
# Use pipes for communicating between sub-processes. Faster.
@@ -880,7 +876,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 = []
@@ -1405,7 +1402,8 @@
# 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 = []
@@ -1614,7 +1612,7 @@
defines = [ "_HAS_NODISCARD" ]
}
} else {
- cflags = [ "-Wall" ]
+ cflags = []
if (treat_warnings_as_errors) {
cflags += [ "-Werror" ]
@@ -1623,10 +1621,6 @@
# 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.
@@ -1635,15 +1629,6 @@
"__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" ]
@@ -1904,7 +1889,8 @@
# 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" ]
@@ -2007,7 +1993,8 @@
}
}
-config("default_stack_frames") {
+config("default_stack_frames") { }
+config("xdefault_stack_frames") {
if (is_posix || is_fuchsia) {
if (enable_frame_pointers) {
cflags = [ "-fno-omit-frame-pointer" ]
@@ -2034,7 +2021,8 @@
}
# 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.
@@ -2072,7 +2060,8 @@
}
# Turn off optimizations.
-config("no_optimize") {
+config("no_optimize") { }
+config("xno_optimize") {
if (is_win) {
cflags = [
"/Od", # Disable optimization.
@@ -2112,7 +2101,8 @@
# 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:
@@ -2145,7 +2135,8 @@
#
# 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:
@@ -2171,7 +2162,8 @@
}
}
-config("optimize_fuzzing") {
+config("optimize_fuzzing") { }
+config("xoptimize_fuzzing") {
cflags = [ "-O1" ] + common_optimize_on_cflags
rustflags = [ "-Copt-level=1" ]
ldflags = common_optimize_on_ldflags
@@ -2290,7 +2282,8 @@
}
# Full symbols.
-config("symbols") {
+config("symbols") { }
+config("xsymbols") {
if (is_win) {
if (is_clang) {
cflags = [ "/Z7" ] # Debug information in the .obj files.
@@ -2418,7 +2411,8 @@
# 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 = []
@@ -2491,7 +2485,8 @@
# 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-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