Skip to content

Commit 9a4d21d

Browse files
rockdrillaRafaelGSS
authored andcommitted
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 <[email protected]> PR-URL: #47313 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Richard Lau <[email protected]>
1 parent 8059764 commit 9a4d21d

File tree

6 files changed

+80
-0
lines changed

6 files changed

+80
-0
lines changed

deps/openssl/openssl-cli.gypi

+4
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,9 @@
2121
],
2222
},
2323
}],
24+
# Avoid excessive LTO
25+
['enable_lto=="true"', {
26+
'ldflags': [ '-fno-lto' ],
27+
}],
2428
],
2529
}

deps/openssl/openssl.gyp

+4
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,10 @@
7979
}, {
8080
'includes': ['./openssl-cl_asm.gypi'],
8181
}],
82+
# Avoid excessive LTO
83+
['enable_lto=="true"', {
84+
'ldflags': [ '-fno-lto' ],
85+
}],
8286
]
8387
}, {
8488
# openssl-fipsmodule target

node.gyp

+20
Original file line numberDiff line numberDiff line change
@@ -969,6 +969,10 @@
969969
[ 'OS!="linux" or ossfuzz!="true"', {
970970
'type': 'none',
971971
}],
972+
# Avoid excessive LTO
973+
['enable_lto=="true"', {
974+
'ldflags': [ '-fno-lto' ],
975+
}],
972976
],
973977
}, # fuzz_env
974978
{
@@ -1071,6 +1075,10 @@
10711075
'Ws2_32.lib',
10721076
],
10731077
}],
1078+
# Avoid excessive LTO
1079+
['enable_lto=="true"', {
1080+
'ldflags': [ '-fno-lto' ],
1081+
}],
10741082
],
10751083
}, # cctest
10761084

@@ -1124,6 +1132,10 @@
11241132
'Ws2_32.lib',
11251133
],
11261134
}],
1135+
# Avoid excessive LTO
1136+
['enable_lto=="true"', {
1137+
'ldflags': [ '-fno-lto' ],
1138+
}],
11271139
],
11281140
}, # embedtest
11291141

@@ -1142,6 +1154,10 @@
11421154
'test/overlapped-checker/main_unix.c'
11431155
],
11441156
}],
1157+
# Avoid excessive LTO
1158+
['enable_lto=="true"', {
1159+
'ldflags': [ '-fno-lto' ],
1160+
}],
11451161
]
11461162
}, # overlapped-checker
11471163
{
@@ -1198,6 +1214,10 @@
11981214
'Ws2_32.lib',
11991215
],
12001216
}],
1217+
# Avoid excessive LTO
1218+
['enable_lto=="true"', {
1219+
'ldflags': [ '-fno-lto' ],
1220+
}],
12011221
],
12021222
}, # node_mksnapshot
12031223
], # end targets

tools/icu/icu-generic.gyp

+24
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,12 @@
428428
'<@(icu_src_derb)',
429429
'no-op.cc',
430430
],
431+
'conditions': [
432+
# Avoid excessive LTO
433+
['enable_lto=="true"', {
434+
'ldflags': [ '-fno-lto' ],
435+
}],
436+
],
431437
},
432438
# This tool is used to rebuild res_index.res manifests
433439
{
@@ -439,6 +445,12 @@
439445
'iculslocs.cc',
440446
'no-op.cc',
441447
],
448+
'conditions': [
449+
# Avoid excessive LTO
450+
['enable_lto=="true"', {
451+
'ldflags': [ '-fno-lto' ],
452+
}],
453+
],
442454
},
443455
# This tool is used to package, unpackage, repackage .dat files
444456
# and convert endianesses
@@ -451,6 +463,12 @@
451463
'<@(icu_src_icupkg)',
452464
'no-op.cc',
453465
],
466+
'conditions': [
467+
# Avoid excessive LTO
468+
['enable_lto=="true"', {
469+
'ldflags': [ '-fno-lto' ],
470+
}],
471+
],
454472
},
455473
# this is used to convert .dat directly into .obj
456474
{
@@ -462,6 +480,12 @@
462480
'<@(icu_src_genccode)',
463481
'no-op.cc',
464482
],
483+
'conditions': [
484+
# Avoid excessive LTO
485+
['enable_lto=="true"', {
486+
'ldflags': [ '-fno-lto' ],
487+
}],
488+
],
465489
},
466490
],
467491
}

tools/v8_gypfiles/d8.gyp

+4
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@
6969
'<(icu_gyp_path):icudata',
7070
],
7171
}],
72+
# Avoid excessive LTO
73+
['enable_lto=="true"', {
74+
'ldflags': [ '-fno-lto' ],
75+
}],
7276
],
7377
},
7478
],

tools/v8_gypfiles/v8.gyp

+24
Original file line numberDiff line numberDiff line change
@@ -1511,6 +1511,10 @@
15111511
['want_separate_host_toolset', {
15121512
'toolsets': ['host'],
15131513
}],
1514+
# Avoid excessive LTO
1515+
['enable_lto=="true"', {
1516+
'ldflags': [ '-fno-lto' ],
1517+
}],
15141518
],
15151519
'defines!': [
15161520
'BUILDING_V8_SHARED=1',
@@ -1556,6 +1560,10 @@
15561560
'<(_msvs_precompiled_source)',
15571561
],
15581562
}],
1563+
# Avoid excessive LTO
1564+
['enable_lto=="true"', {
1565+
'ldflags': [ '-fno-lto' ],
1566+
}],
15591567
],
15601568
}, # mksnapshot
15611569
{
@@ -1569,6 +1577,10 @@
15691577
['want_separate_host_toolset', {
15701578
'toolsets': ['host'],
15711579
}],
1580+
# Avoid excessive LTO
1581+
['enable_lto=="true"', {
1582+
'ldflags': [ '-fno-lto' ],
1583+
}],
15721584
],
15731585
'defines!': [
15741586
'_HAS_EXCEPTIONS=0',
@@ -1603,6 +1615,10 @@
16031615
['want_separate_host_toolset', {
16041616
'toolsets': ['host'],
16051617
}],
1618+
# Avoid excessive LTO
1619+
['enable_lto=="true"', {
1620+
'ldflags': [ '-fno-lto' ],
1621+
}],
16061622
],
16071623
'dependencies': [
16081624
'torque_base',
@@ -1635,6 +1651,10 @@
16351651
['want_separate_host_toolset', {
16361652
'toolsets': ['host'],
16371653
}],
1654+
# Avoid excessive LTO
1655+
['enable_lto=="true"', {
1656+
'ldflags': [ '-fno-lto' ],
1657+
}],
16381658
],
16391659
'sources': [
16401660
"<(V8_ROOT)/src/regexp/gen-regexp-special-case.cc",
@@ -1651,6 +1671,10 @@
16511671
}, {
16521672
'dependencies': ['gen-regexp-special-case#target'],
16531673
}],
1674+
# Avoid excessive LTO
1675+
['enable_lto=="true"', {
1676+
'ldflags': [ '-fno-lto' ],
1677+
}],
16541678
],
16551679
'actions': [
16561680
{

0 commit comments

Comments
 (0)