summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Demin <rockdrilla@gmail.com>2023-04-06 03:24:58 +0300
committerGitHub <noreply@github.com>2023-04-06 00:24:58 +0000
commitc3cd75d10ba116dff3dd839cbc5a034cf39a0095 (patch)
tree640b9eb6436ab5c2bda0de522124220954e78b6b
parent5c86f223aec046d6dd37b5ff22907e30be7315ee (diff)
downloadnode-new-c3cd75d10ba116dff3dd839cbc5a034cf39a0095.tar.gz
build, deps, tools: avoid excessive LTO
Don't link intermediate executables with LTO in order to speed up overall build time. Signed-off-by: Konstantin Demin <rockdrilla@gmail.com> PR-URL: https://github.com/nodejs/node/pull/47313 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michael Dawson <midawson@redhat.com> Reviewed-By: Richard Lau <rlau@redhat.com>
-rw-r--r--deps/openssl/openssl-cli.gypi4
-rw-r--r--deps/openssl/openssl.gyp4
-rw-r--r--node.gyp20
-rw-r--r--tools/icu/icu-generic.gyp24
-rw-r--r--tools/v8_gypfiles/d8.gyp4
-rw-r--r--tools/v8_gypfiles/v8.gyp24
6 files changed, 80 insertions, 0 deletions
diff --git a/deps/openssl/openssl-cli.gypi b/deps/openssl/openssl-cli.gypi
index 1209d64e46..b4c278b4fe 100644
--- a/deps/openssl/openssl-cli.gypi
+++ b/deps/openssl/openssl-cli.gypi
@@ -21,5 +21,9 @@
],
},
}],
+ # Avoid excessive LTO
+ ['enable_lto=="true"', {
+ 'ldflags': [ '-fno-lto' ],
+ }],
],
}
diff --git a/deps/openssl/openssl.gyp b/deps/openssl/openssl.gyp
index 861bbc5844..f6b157f8d6 100644
--- a/deps/openssl/openssl.gyp
+++ b/deps/openssl/openssl.gyp
@@ -79,6 +79,10 @@
}, {
'includes': ['./openssl-cl_asm.gypi'],
}],
+ # Avoid excessive LTO
+ ['enable_lto=="true"', {
+ 'ldflags': [ '-fno-lto' ],
+ }],
]
}, {
# openssl-fipsmodule target
diff --git a/node.gyp b/node.gyp
index 394fba5729..601c458421 100644
--- a/node.gyp
+++ b/node.gyp
@@ -969,6 +969,10 @@
[ 'OS!="linux" or ossfuzz!="true"', {
'type': 'none',
}],
+ # Avoid excessive LTO
+ ['enable_lto=="true"', {
+ 'ldflags': [ '-fno-lto' ],
+ }],
],
}, # fuzz_env
{
@@ -1071,6 +1075,10 @@
'Ws2_32.lib',
],
}],
+ # Avoid excessive LTO
+ ['enable_lto=="true"', {
+ 'ldflags': [ '-fno-lto' ],
+ }],
],
}, # cctest
@@ -1124,6 +1132,10 @@
'Ws2_32.lib',
],
}],
+ # Avoid excessive LTO
+ ['enable_lto=="true"', {
+ 'ldflags': [ '-fno-lto' ],
+ }],
],
}, # embedtest
@@ -1142,6 +1154,10 @@
'test/overlapped-checker/main_unix.c'
],
}],
+ # Avoid excessive LTO
+ ['enable_lto=="true"', {
+ 'ldflags': [ '-fno-lto' ],
+ }],
]
}, # overlapped-checker
{
@@ -1198,6 +1214,10 @@
'Ws2_32.lib',
],
}],
+ # Avoid excessive LTO
+ ['enable_lto=="true"', {
+ 'ldflags': [ '-fno-lto' ],
+ }],
],
}, # node_mksnapshot
], # end targets
diff --git a/tools/icu/icu-generic.gyp b/tools/icu/icu-generic.gyp
index db45e6fbdf..2655b9e694 100644
--- a/tools/icu/icu-generic.gyp
+++ b/tools/icu/icu-generic.gyp
@@ -428,6 +428,12 @@
'<@(icu_src_derb)',
'no-op.cc',
],
+ 'conditions': [
+ # Avoid excessive LTO
+ ['enable_lto=="true"', {
+ 'ldflags': [ '-fno-lto' ],
+ }],
+ ],
},
# This tool is used to rebuild res_index.res manifests
{
@@ -439,6 +445,12 @@
'iculslocs.cc',
'no-op.cc',
],
+ 'conditions': [
+ # Avoid excessive LTO
+ ['enable_lto=="true"', {
+ 'ldflags': [ '-fno-lto' ],
+ }],
+ ],
},
# This tool is used to package, unpackage, repackage .dat files
# and convert endianesses
@@ -451,6 +463,12 @@
'<@(icu_src_icupkg)',
'no-op.cc',
],
+ 'conditions': [
+ # Avoid excessive LTO
+ ['enable_lto=="true"', {
+ 'ldflags': [ '-fno-lto' ],
+ }],
+ ],
},
# this is used to convert .dat directly into .obj
{
@@ -462,6 +480,12 @@
'<@(icu_src_genccode)',
'no-op.cc',
],
+ 'conditions': [
+ # Avoid excessive LTO
+ ['enable_lto=="true"', {
+ 'ldflags': [ '-fno-lto' ],
+ }],
+ ],
},
],
}
diff --git a/tools/v8_gypfiles/d8.gyp b/tools/v8_gypfiles/d8.gyp
index 656e5dffd3..ba79ebcba7 100644
--- a/tools/v8_gypfiles/d8.gyp
+++ b/tools/v8_gypfiles/d8.gyp
@@ -69,6 +69,10 @@
'<(icu_gyp_path):icudata',
],
}],
+ # Avoid excessive LTO
+ ['enable_lto=="true"', {
+ 'ldflags': [ '-fno-lto' ],
+ }],
],
},
],
diff --git a/tools/v8_gypfiles/v8.gyp b/tools/v8_gypfiles/v8.gyp
index e6651b89fb..4ed217616f 100644
--- a/tools/v8_gypfiles/v8.gyp
+++ b/tools/v8_gypfiles/v8.gyp
@@ -1511,6 +1511,10 @@
['want_separate_host_toolset', {
'toolsets': ['host'],
}],
+ # Avoid excessive LTO
+ ['enable_lto=="true"', {
+ 'ldflags': [ '-fno-lto' ],
+ }],
],
'defines!': [
'BUILDING_V8_SHARED=1',
@@ -1556,6 +1560,10 @@
'<(_msvs_precompiled_source)',
],
}],
+ # Avoid excessive LTO
+ ['enable_lto=="true"', {
+ 'ldflags': [ '-fno-lto' ],
+ }],
],
}, # mksnapshot
{
@@ -1569,6 +1577,10 @@
['want_separate_host_toolset', {
'toolsets': ['host'],
}],
+ # Avoid excessive LTO
+ ['enable_lto=="true"', {
+ 'ldflags': [ '-fno-lto' ],
+ }],
],
'defines!': [
'_HAS_EXCEPTIONS=0',
@@ -1603,6 +1615,10 @@
['want_separate_host_toolset', {
'toolsets': ['host'],
}],
+ # Avoid excessive LTO
+ ['enable_lto=="true"', {
+ 'ldflags': [ '-fno-lto' ],
+ }],
],
'dependencies': [
'torque_base',
@@ -1635,6 +1651,10 @@
['want_separate_host_toolset', {
'toolsets': ['host'],
}],
+ # Avoid excessive LTO
+ ['enable_lto=="true"', {
+ 'ldflags': [ '-fno-lto' ],
+ }],
],
'sources': [
"<(V8_ROOT)/src/regexp/gen-regexp-special-case.cc",
@@ -1651,6 +1671,10 @@
}, {
'dependencies': ['gen-regexp-special-case#target'],
}],
+ # Avoid excessive LTO
+ ['enable_lto=="true"', {
+ 'ldflags': [ '-fno-lto' ],
+ }],
],
'actions': [
{