File gcc-enable-lto.patch of Package nodejs-electron39
--- src/build/config/BUILDCONFIG.gn.orig 2025-11-23 13:57:36.944429497 +0100
+++ src/build/config/BUILDCONFIG.gn 2025-11-23 14:10:16.756356128 +0100
@@ -138,6 +138,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" &&
@@ -376,6 +378,12 @@ default_compiler_configs = [
"//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",
--- src/build/config/compiler/BUILD.gn.orig 2025-11-23 13:48:01.864485011 +0100
+++ src/build/config/compiler/BUILD.gn 2025-11-23 14:10:50.128352843 +0100
@@ -2730,6 +2730,11 @@ if (is_win) {
}
}
+config("gcc_lto") {
+ cflags = [ "-flto=auto" ]
+}
+
+
config("default_stack_frames") { }
config("xdefault_stack_frames") {
if (!is_win) {