Files
chromium-dev/gcc-enable-lto.patch

71 lines
2.2 KiB
Diff
Raw Normal View History

Index: chromium-143.0.7489.0/build/config/BUILDCONFIG.gn
===================================================================
--- chromium-143.0.7489.0.orig/build/config/BUILDCONFIG.gn
+++ chromium-143.0.7489.0/build/config/BUILDCONFIG.gn
@@ -135,6 +135,8 @@ declare_args() {
# set "is_official_build" to true for any build intended to ship to end-users.
is_official_build = false
+ gcc_lto = false
+
# Set to true when compiling with the Clang compiler.
is_clang = current_os != "linux" ||
(current_cpu != "s390x" && current_cpu != "s390" &&
@@ -372,6 +374,12 @@ default_compiler_configs = [
2025-07-24 14:20:47 +02:00
"//build/config:feature_flags",
]
+if (gcc_lto) {
+ default_compiler_configs += [
+ "//build/config/compiler:gcc_lto",
+ ]
+}
+
if (is_win) {
default_compiler_configs += [
"//build/config/win:default_cfg_compiler",
Index: chromium-143.0.7489.0/build/config/compiler/BUILD.gn
===================================================================
--- chromium-143.0.7489.0.orig/build/config/compiler/BUILD.gn
+++ chromium-143.0.7489.0/build/config/compiler/BUILD.gn
@@ -2739,6 +2739,10 @@ if (is_win) {
2025-07-24 14:20:47 +02:00
}
}
+config("gcc_lto") {
+ cflags = [ "-flto" ]
+}
+
config("default_stack_frames") {
if (!is_win) {
if (enable_frame_pointers) {
Index: chromium-143.0.7489.0/sandbox/linux/BUILD.gn
===================================================================
--- chromium-143.0.7489.0.orig/sandbox/linux/BUILD.gn
+++ chromium-143.0.7489.0/sandbox/linux/BUILD.gn
@@ -255,6 +255,9 @@ component("seccomp_bpf") {
"//base",
"//sandbox:sandbox_buildflags",
]
+ if (gcc_lto) {
+ configs -= [ "//build/config/compiler:gcc_lto" ]
+ }
if (is_android) {
sources += [
Index: chromium-143.0.7489.0/base/BUILD.gn
===================================================================
--- chromium-143.0.7489.0.orig/base/BUILD.gn
+++ chromium-143.0.7489.0/base/BUILD.gn
@@ -3749,6 +3749,10 @@ test("base_unittests") {
sources += [ "immediate_crash_unittest.cc" ]
}
+ if (gcc_lto) {
+ configs -= [ "//build/config/compiler:gcc_lto" ]
+ }
+
2025-06-27 00:31:18 +02:00
sources += [
"containers/span_rust_unittest.cc",
"strings/string_piece_rust_unittest.cc",