1--- src/3rdparty/chromium/build/config/compiler/BUILD.gn.orig	2025-03-06 09:26:10 UTC
2+++ src/3rdparty/chromium/build/config/compiler/BUILD.gn
3@@ -134,7 +134,7 @@ declare_args() {
4   #
5   # TODO(crbug.com/977230): Enabling this when 'use_xcode_clang' is true may
6   # call an old clang that doesn't support auto-init.
7-  init_stack_vars = !is_android && !use_xcode_clang
8+  init_stack_vars = !is_android && !use_xcode_clang && !is_bsd
9
10   # This argument is to control whether enabling text section splitting in the
11   # final binary. When enabled, the separated text sections with prefix
12@@ -297,7 +297,7 @@ config("compiler") {
13     }
14
15     # Linker warnings.
16-    if (fatal_linker_warnings && !is_apple && current_os != "aix") {
17+    if (fatal_linker_warnings && !is_apple && !is_bsd && current_os != "aix") {
18       ldflags += [ "-Wl,--fatal-warnings" ]
19     }
20     if (fatal_linker_warnings && is_apple &&
21@@ -310,6 +310,7 @@ config("compiler") {
22
23   if (use_qt && is_clang) {
24     cflags += [
25+      "-Wno-enum-constexpr-conversion",
26       "-Wno-unknown-attributes",
27       "-Wno-unknown-pragmas",
28       "-Wno-unknown-warning-option"
29@@ -408,7 +409,7 @@ config("compiler") {
30
31     # Compiler instrumentation can introduce dependencies in DSOs to symbols in
32     # the executable they are loaded into, so they are unresolved at link-time.
33-    if (!using_sanitizer) {
34+    if (!using_sanitizer && !is_bsd) {
35       ldflags += [
36         "-Wl,-z,defs",
37         "-Wl,--as-needed",
38@@ -566,7 +567,7 @@ config("compiler") {
39       # Override Chromium's default for projects that wish to stay on C++11.
40       cflags_cc += [ "-std=${standard_prefix}++11" ]
41     } else {
42-      cflags_cc += [ "-std=${standard_prefix}++14" ]
43+      cflags_cc += [ "-std=${standard_prefix}++17" ]
44     }
45   } else if (!is_win && !is_nacl) {
46     if (target_os == "android") {
47@@ -583,7 +584,7 @@ config("compiler") {
48     if (cxx11_override) {
49       cflags_cc += [ "-std=c++11" ]
50     } else {
51-      cflags_cc += [ "-std=c++14" ]
52+      cflags_cc += [ "-std=c++17" ]
53     }
54   }
55
56@@ -782,10 +783,6 @@ config("compiler_cpu_abi") {
57         ]
58       }
59     } else if (current_cpu == "arm") {
60-      if (is_clang && !is_android && !is_nacl) {
61-        cflags += [ "--target=arm-linux-gnueabihf" ]
62-        ldflags += [ "--target=arm-linux-gnueabihf" ]
63-      }
64       if (!is_nacl) {
65         cflags += [
66           "-march=$arm_arch",
67@@ -796,7 +793,7 @@ config("compiler_cpu_abi") {
68         cflags += [ "-mtune=$arm_tune" ]
69       }
70     } else if (current_cpu == "arm64") {
71-      if (is_clang && !is_android && !is_nacl && !is_fuchsia) {
72+      if (is_clang && !is_android && !is_nacl && !is_fuchsia && !is_bsd) {
73         cflags += [ "--target=aarch64-linux-gnu" ]
74         ldflags += [ "--target=aarch64-linux-gnu" ]
75       }
76@@ -1149,7 +1146,7 @@ config("compiler_deterministic") {
77       "-Xclang",
78       ".",
79     ]
80-    if (!is_win) {
81+    if (!is_win && !is_bsd) {
82       # We don't use clang -cc1as on Windows (yet? https://crbug.com/762167)
83       asmflags = [ "-Wa,-fdebug-compilation-dir,." ]
84     }
85@@ -1535,6 +1532,10 @@ config("default_warnings") {
86       # which we no longer use. Check if it makes sense to remove
87       # this as well. http://crbug.com/316352
88       "-Wno-unneeded-internal-declaration",
89+
90+      # Reduce build log bloat by about 20MB
91+      "-Wno-deprecated-copy",
92+      "-Wno-implicit-float-conversion",
93     ]
94
95     # use_xcode_clang only refers to the iOS toolchain, host binaries use
96@@ -1551,7 +1552,7 @@ config("default_warnings") {
97         cflags += [ "-Wno-nonportable-include-path" ]
98       }
99
100-      if (current_toolchain == host_toolchain || !use_xcode_clang) {
101+      if ((current_toolchain == host_toolchain || !use_xcode_clang) && !is_bsd) {
102         # Flags NaCl (Clang 3.7) and Xcode 9.2 (Clang clang-900.0.39.2) do not
103         # recognize.
104         cflags += [
105@@ -1725,7 +1726,7 @@ config("no_chromium_code") {
106       # suppressing them individually, we just blanket suppress them here.
107       "-Wno-unused-variable",
108     ]
109-    if (!is_nacl && (current_toolchain == host_toolchain || !use_xcode_clang)) {
110+    if (!is_nacl && (current_toolchain == host_toolchain || !use_xcode_clang) && !is_bsd) {
111       cflags += [
112         # TODO(https://crbug.com/1031169): Clean up and enable.
113         "-Wno-misleading-indentation",
114@@ -1803,7 +1804,7 @@ config("thin_archive") {
115   # Mac and iOS use the mac-specific "libtool" command, not ar, which doesn't
116   # have a "thin archive" mode (it does accept -T, but it means truncating
117   # archive names to 16 characters, which is not what we want).
118-  if ((is_posix && !is_nacl && !is_apple) || is_fuchsia) {
119+  if ((is_posix && !is_nacl && !is_apple && !is_bsd) || is_fuchsia) {
120     arflags = [ "-T" ]
121   } else if (is_win && use_lld) {
122     arflags = [ "/llvmlibthin" ]
123@@ -2344,7 +2345,7 @@ config("symbols") {
124     # flag, so we can use use -g1 for pnacl and nacl-clang compiles.
125     # gcc nacl is is_nacl && !is_clang, pnacl and nacl-clang are && is_clang.
126     if (!is_nacl || is_clang) {
127-      cflags += [ "-g2" ]
128+      cflags += [ "-g0" ]
129     }
130
131     # TODO(https://crbug.com/1050118): Investigate missing debug info on mac.
132@@ -2386,7 +2387,7 @@ config("symbols") {
133     # DWARF info may be corrupt; offsets in a range list entry are in different
134     # sections" there.  Maybe just a bug in nacl_switch_32.S.
135     if (!is_apple && !is_nacl && current_cpu != "x86" &&
136-        (use_gold || use_lld)) {
137+        (use_gold || use_lld) && !is_bsd) {
138       if (is_clang) {
139         # This flag enables the GNU-format pubnames and pubtypes sections,
140         # which lld needs in order to generate a correct GDB index.
141