Skip to content

Commit db910dd

Browse files
rockdrillaMoLow
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 <rockdrilla@gmail.com> PR-URL: #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>
1 parent 7f2bccc commit db910dd

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
@@ -1202,6 +1202,10 @@
12021202
[ 'OS!="linux" or ossfuzz!="true"', {
12031203
'type': 'none',
12041204
}],
1205+
# Avoid excessive LTO
1206+
['enable_lto=="true"', {
1207+
'ldflags': [ '-fno-lto' ],
1208+
}],
12051209
],
12061210
}, # fuzz_env
12071211
{
@@ -1304,6 +1308,10 @@
13041308
'Ws2_32.lib',
13051309
],
13061310
}],
1311+
# Avoid excessive LTO
1312+
['enable_lto=="true"', {
1313+
'ldflags': [ '-fno-lto' ],
1314+
}],
13071315
],
13081316
}, # cctest
13091317

@@ -1360,6 +1368,10 @@
13601368
'Ws2_32.lib',
13611369
],
13621370
}],
1371+
# Avoid excessive LTO
1372+
['enable_lto=="true"', {
1373+
'ldflags': [ '-fno-lto' ],
1374+
}],
13631375
],
13641376
}, # embedtest
13651377

@@ -1378,6 +1390,10 @@
13781390
'test/overlapped-checker/main_unix.c'
13791391
],
13801392
}],
1393+
# Avoid excessive LTO
1394+
['enable_lto=="true"', {
1395+
'ldflags': [ '-fno-lto' ],
1396+
}],
13811397
]
13821398
}, # overlapped-checker
13831399
{
@@ -1434,6 +1450,10 @@
14341450
'Ws2_32.lib',
14351451
],
14361452
}],
1453+
# Avoid excessive LTO
1454+
['enable_lto=="true"', {
1455+
'ldflags': [ '-fno-lto' ],
1456+
}],
14371457
],
14381458
}, # node_mksnapshot
14391459
], # 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
@@ -1401,6 +1401,10 @@
14011401
['want_separate_host_toolset', {
14021402
'toolsets': ['host'],
14031403
}],
1404+
# Avoid excessive LTO
1405+
['enable_lto=="true"', {
1406+
'ldflags': [ '-fno-lto' ],
1407+
}],
14041408
],
14051409
'defines!': [
14061410
'BUILDING_V8_SHARED=1',
@@ -1445,6 +1449,10 @@
14451449
'<(_msvs_precompiled_source)',
14461450
],
14471451
}],
1452+
# Avoid excessive LTO
1453+
['enable_lto=="true"', {
1454+
'ldflags': [ '-fno-lto' ],
1455+
}],
14481456
],
14491457
}, # mksnapshot
14501458
{
@@ -1458,6 +1466,10 @@
14581466
['want_separate_host_toolset', {
14591467
'toolsets': ['host'],
14601468
}],
1469+
# Avoid excessive LTO
1470+
['enable_lto=="true"', {
1471+
'ldflags': [ '-fno-lto' ],
1472+
}],
14611473
],
14621474
'defines!': [
14631475
'_HAS_EXCEPTIONS=0',
@@ -1492,6 +1504,10 @@
14921504
['want_separate_host_toolset', {
14931505
'toolsets': ['host'],
14941506
}],
1507+
# Avoid excessive LTO
1508+
['enable_lto=="true"', {
1509+
'ldflags': [ '-fno-lto' ],
1510+
}],
14951511
],
14961512
'dependencies': [
14971513
'torque_base',
@@ -1524,6 +1540,10 @@
15241540
['want_separate_host_toolset', {
15251541
'toolsets': ['host'],
15261542
}],
1543+
# Avoid excessive LTO
1544+
['enable_lto=="true"', {
1545+
'ldflags': [ '-fno-lto' ],
1546+
}],
15271547
],
15281548
'sources': [
15291549
"<(V8_ROOT)/src/regexp/gen-regexp-special-case.cc",
@@ -1540,6 +1560,10 @@
15401560
}, {
15411561
'dependencies': ['gen-regexp-special-case#target'],
15421562
}],
1563+
# Avoid excessive LTO
1564+
['enable_lto=="true"', {
1565+
'ldflags': [ '-fno-lto' ],
1566+
}],
15431567
],
15441568
'actions': [
15451569
{

0 commit comments

Comments
 (0)