From b0906d20f69d25b7bcff77ad49f86b90c5590945 Mon Sep 17 00:00:00 2001 From: Konstantin Demin Date: Tue, 8 Aug 2023 09:54:16 +0300 Subject: [PATCH 1/3] 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 --- deps/openssl/openssl-cli.gypi | 4 ++++ deps/openssl/openssl.gyp | 4 ++++ node.gyp | 24 ++++++++++++++++++++++++ tools/icu/icu-generic.gyp | 24 ++++++++++++++++++++++++ tools/v8_gypfiles/d8.gyp | 4 ++++ tools/v8_gypfiles/v8.gyp | 20 ++++++++++++++++++++ 6 files changed, 80 insertions(+) diff --git a/deps/openssl/openssl-cli.gypi b/deps/openssl/openssl-cli.gypi index 1209d64e46dbc2..b4c278b4fe8f9f 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 4609d83baabac1..9a11a84dc07f4c 100644 --- a/deps/openssl/openssl.gyp +++ b/deps/openssl/openssl.gyp @@ -49,6 +49,10 @@ }, { 'includes': ['./openssl-cl_asm.gypi'], }], + # Avoid excessive LTO + ['enable_lto=="true"', { + 'ldflags': [ '-fno-lto' ], + }], ], }, ], diff --git a/node.gyp b/node.gyp index de409a31f388fc..07c604993ec4f2 100644 --- a/node.gyp +++ b/node.gyp @@ -1122,6 +1122,10 @@ [ 'OS!="linux" or ossfuzz!="true"', { 'type': 'none', }], + # Avoid excessive LTO + ['enable_lto=="true"', { + 'ldflags': [ '-fno-lto' ], + }], ], }, # fuzz_env { @@ -1225,6 +1229,10 @@ 'Ws2_32.lib', ], }], + # Avoid excessive LTO + ['enable_lto=="true"', { + 'ldflags': [ '-fno-lto' ], + }], ], }, # cctest @@ -1281,6 +1289,10 @@ 'Ws2_32.lib', ], }], + # Avoid excessive LTO + ['enable_lto=="true"', { + 'ldflags': [ '-fno-lto' ], + }], ], }, # embedtest @@ -1299,6 +1311,10 @@ 'test/overlapped-checker/main_unix.c' ], }], + # Avoid excessive LTO + ['enable_lto=="true"', { + 'ldflags': [ '-fno-lto' ], + }], ] }, # overlapped-checker @@ -1361,6 +1377,10 @@ 'Ws2_32.lib', ], }], + # Avoid excessive LTO + ['enable_lto=="true"', { + 'ldflags': [ '-fno-lto' ], + }], ], }, # mkcodecache { @@ -1412,6 +1432,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 3e830aa097e570..5afd6f61d5e5a0 100644 --- a/tools/icu/icu-generic.gyp +++ b/tools/icu/icu-generic.gyp @@ -429,6 +429,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 { @@ -440,6 +446,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 @@ -452,6 +464,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 { @@ -463,6 +481,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 46b415c2ed93f5..fa6d2be4f0599d 100644 --- a/tools/v8_gypfiles/d8.gyp +++ b/tools/v8_gypfiles/d8.gyp @@ -63,6 +63,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 ed042f88296186..caeee267d656a9 100644 --- a/tools/v8_gypfiles/v8.gyp +++ b/tools/v8_gypfiles/v8.gyp @@ -1377,6 +1377,10 @@ ['want_separate_host_toolset', { 'toolsets': ['host'], }], + # Avoid excessive LTO + ['enable_lto=="true"', { + 'ldflags': [ '-fno-lto' ], + }], ], 'defines!': [ 'BUILDING_V8_SHARED=1', @@ -1413,6 +1417,10 @@ ['want_separate_host_toolset', { 'toolsets': ['host'], }], + # Avoid excessive LTO + ['enable_lto=="true"', { + 'ldflags': [ '-fno-lto' ], + }], ], }, # mksnapshot { @@ -1426,6 +1434,10 @@ ['want_separate_host_toolset', { 'toolsets': ['host'], }], + # Avoid excessive LTO + ['enable_lto=="true"', { + 'ldflags': [ '-fno-lto' ], + }], ], 'defines!': [ '_HAS_EXCEPTIONS=0', @@ -1460,6 +1472,10 @@ ['want_separate_host_toolset', { 'toolsets': ['host'], }], + # Avoid excessive LTO + ['enable_lto=="true"', { + 'ldflags': [ '-fno-lto' ], + }], ], 'dependencies': [ 'torque_base', @@ -1492,6 +1508,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", From a9d391dd9e977401ed999b886ba86e1e76e821a6 Mon Sep 17 00:00:00 2001 From: Konstantin Demin Date: Tue, 8 Aug 2023 09:54:16 +0300 Subject: [PATCH 2/3] build, deps, tools: avoid excessive PGO Don't build intermediate executables with PGO in order to speed up overall build time. Signed-off-by: Konstantin Demin --- deps/openssl/openssl-cli.gypi | 13 ++++++ deps/openssl/openssl.gyp | 13 ++++++ node.gyp | 78 +++++++++++++++++++++++++++++++++++ tools/icu/icu-generic.gyp | 52 +++++++++++++++++++++++ tools/v8_gypfiles/d8.gyp | 13 ++++++ tools/v8_gypfiles/v8.gyp | 65 +++++++++++++++++++++++++++++ 6 files changed, 234 insertions(+) diff --git a/deps/openssl/openssl-cli.gypi b/deps/openssl/openssl-cli.gypi index b4c278b4fe8f9f..e10a6078349db8 100644 --- a/deps/openssl/openssl-cli.gypi +++ b/deps/openssl/openssl-cli.gypi @@ -25,5 +25,18 @@ ['enable_lto=="true"', { 'ldflags': [ '-fno-lto' ], }], + # Avoid excessive PGO + ['enable_pgo_generate=="true"', { + 'cflags': [ '-fno-profile' ], + 'cflags!': [ '-fprofile-generate' ], + 'ldflags': [ '-fno-profile' ], + 'ldflags!': [ '-fprofile-generate' ], + }, ], + ['enable_pgo_use=="true"', { + 'cflags': [ '-fno-profile' ], + 'cflags!': [ '-fprofile-use -fprofile-correction' ], + 'ldflags': [ '-fno-profile' ], + 'ldflags!': [ '-fprofile-use -fprofile-correction' ], + }, ], ], } diff --git a/deps/openssl/openssl.gyp b/deps/openssl/openssl.gyp index 9a11a84dc07f4c..4c5636be6a6784 100644 --- a/deps/openssl/openssl.gyp +++ b/deps/openssl/openssl.gyp @@ -53,6 +53,19 @@ ['enable_lto=="true"', { 'ldflags': [ '-fno-lto' ], }], + # Avoid excessive PGO + ['enable_pgo_generate=="true"', { + 'cflags': [ '-fno-profile' ], + 'cflags!': [ '-fprofile-generate' ], + 'ldflags': [ '-fno-profile' ], + 'ldflags!': [ '-fprofile-generate' ], + }, ], + ['enable_pgo_use=="true"', { + 'cflags': [ '-fno-profile' ], + 'cflags!': [ '-fprofile-use -fprofile-correction' ], + 'ldflags': [ '-fno-profile' ], + 'ldflags!': [ '-fprofile-use -fprofile-correction' ], + }, ], ], }, ], diff --git a/node.gyp b/node.gyp index 07c604993ec4f2..ed8a75fe69e226 100644 --- a/node.gyp +++ b/node.gyp @@ -1126,6 +1126,19 @@ ['enable_lto=="true"', { 'ldflags': [ '-fno-lto' ], }], + # Avoid excessive PGO + ['enable_pgo_generate=="true"', { + 'cflags': [ '-fno-profile' ], + 'cflags!': [ '-fprofile-generate' ], + 'ldflags': [ '-fno-profile' ], + 'ldflags!': [ '-fprofile-generate' ], + }, ], + ['enable_pgo_use=="true"', { + 'cflags': [ '-fno-profile' ], + 'cflags!': [ '-fprofile-use -fprofile-correction' ], + 'ldflags': [ '-fno-profile' ], + 'ldflags!': [ '-fprofile-use -fprofile-correction' ], + }, ], ], }, # fuzz_env { @@ -1233,6 +1246,19 @@ ['enable_lto=="true"', { 'ldflags': [ '-fno-lto' ], }], + # Avoid excessive PGO + ['enable_pgo_generate=="true"', { + 'cflags': [ '-fno-profile' ], + 'cflags!': [ '-fprofile-generate' ], + 'ldflags': [ '-fno-profile' ], + 'ldflags!': [ '-fprofile-generate' ], + }, ], + ['enable_pgo_use=="true"', { + 'cflags': [ '-fno-profile' ], + 'cflags!': [ '-fprofile-use -fprofile-correction' ], + 'ldflags': [ '-fno-profile' ], + 'ldflags!': [ '-fprofile-use -fprofile-correction' ], + }, ], ], }, # cctest @@ -1293,6 +1319,19 @@ ['enable_lto=="true"', { 'ldflags': [ '-fno-lto' ], }], + # Avoid excessive PGO + ['enable_pgo_generate=="true"', { + 'cflags': [ '-fno-profile' ], + 'cflags!': [ '-fprofile-generate' ], + 'ldflags': [ '-fno-profile' ], + 'ldflags!': [ '-fprofile-generate' ], + }, ], + ['enable_pgo_use=="true"', { + 'cflags': [ '-fno-profile' ], + 'cflags!': [ '-fprofile-use -fprofile-correction' ], + 'ldflags': [ '-fno-profile' ], + 'ldflags!': [ '-fprofile-use -fprofile-correction' ], + }, ], ], }, # embedtest @@ -1315,6 +1354,19 @@ ['enable_lto=="true"', { 'ldflags': [ '-fno-lto' ], }], + # Avoid excessive PGO + ['enable_pgo_generate=="true"', { + 'cflags': [ '-fno-profile' ], + 'cflags!': [ '-fprofile-generate' ], + 'ldflags': [ '-fno-profile' ], + 'ldflags!': [ '-fprofile-generate' ], + }, ], + ['enable_pgo_use=="true"', { + 'cflags': [ '-fno-profile' ], + 'cflags!': [ '-fprofile-use -fprofile-correction' ], + 'ldflags': [ '-fno-profile' ], + 'ldflags!': [ '-fprofile-use -fprofile-correction' ], + }, ], ] }, # overlapped-checker @@ -1381,6 +1433,19 @@ ['enable_lto=="true"', { 'ldflags': [ '-fno-lto' ], }], + # Avoid excessive PGO + ['enable_pgo_generate=="true"', { + 'cflags': [ '-fno-profile' ], + 'cflags!': [ '-fprofile-generate' ], + 'ldflags': [ '-fno-profile' ], + 'ldflags!': [ '-fprofile-generate' ], + }, ], + ['enable_pgo_use=="true"', { + 'cflags': [ '-fno-profile' ], + 'cflags!': [ '-fprofile-use -fprofile-correction' ], + 'ldflags': [ '-fno-profile' ], + 'ldflags!': [ '-fprofile-use -fprofile-correction' ], + }, ], ], }, # mkcodecache { @@ -1436,6 +1501,19 @@ ['enable_lto=="true"', { 'ldflags': [ '-fno-lto' ], }], + # Avoid excessive PGO + ['enable_pgo_generate=="true"', { + 'cflags': [ '-fno-profile' ], + 'cflags!': [ '-fprofile-generate' ], + 'ldflags': [ '-fno-profile' ], + 'ldflags!': [ '-fprofile-generate' ], + }, ], + ['enable_pgo_use=="true"', { + 'cflags': [ '-fno-profile' ], + 'cflags!': [ '-fprofile-use -fprofile-correction' ], + 'ldflags': [ '-fno-profile' ], + 'ldflags!': [ '-fprofile-use -fprofile-correction' ], + }, ], ], }, # node_mksnapshot ], # end targets diff --git a/tools/icu/icu-generic.gyp b/tools/icu/icu-generic.gyp index 5afd6f61d5e5a0..5c97d69415fac6 100644 --- a/tools/icu/icu-generic.gyp +++ b/tools/icu/icu-generic.gyp @@ -434,6 +434,19 @@ ['enable_lto=="true"', { 'ldflags': [ '-fno-lto' ], }], + # Avoid excessive PGO + ['enable_pgo_generate=="true"', { + 'cflags': [ '-fno-profile' ], + 'cflags!': [ '-fprofile-generate' ], + 'ldflags': [ '-fno-profile' ], + 'ldflags!': [ '-fprofile-generate' ], + }, ], + ['enable_pgo_use=="true"', { + 'cflags': [ '-fno-profile' ], + 'cflags!': [ '-fprofile-use -fprofile-correction' ], + 'ldflags': [ '-fno-profile' ], + 'ldflags!': [ '-fprofile-use -fprofile-correction' ], + }, ], ], }, # This tool is used to rebuild res_index.res manifests @@ -451,6 +464,19 @@ ['enable_lto=="true"', { 'ldflags': [ '-fno-lto' ], }], + # Avoid excessive PGO + ['enable_pgo_generate=="true"', { + 'cflags': [ '-fno-profile' ], + 'cflags!': [ '-fprofile-generate' ], + 'ldflags': [ '-fno-profile' ], + 'ldflags!': [ '-fprofile-generate' ], + }, ], + ['enable_pgo_use=="true"', { + 'cflags': [ '-fno-profile' ], + 'cflags!': [ '-fprofile-use -fprofile-correction' ], + 'ldflags': [ '-fno-profile' ], + 'ldflags!': [ '-fprofile-use -fprofile-correction' ], + }, ], ], }, # This tool is used to package, unpackage, repackage .dat files @@ -469,6 +495,19 @@ ['enable_lto=="true"', { 'ldflags': [ '-fno-lto' ], }], + # Avoid excessive PGO + ['enable_pgo_generate=="true"', { + 'cflags': [ '-fno-profile' ], + 'cflags!': [ '-fprofile-generate' ], + 'ldflags': [ '-fno-profile' ], + 'ldflags!': [ '-fprofile-generate' ], + }, ], + ['enable_pgo_use=="true"', { + 'cflags': [ '-fno-profile' ], + 'cflags!': [ '-fprofile-use -fprofile-correction' ], + 'ldflags': [ '-fno-profile' ], + 'ldflags!': [ '-fprofile-use -fprofile-correction' ], + }, ], ], }, # this is used to convert .dat directly into .obj @@ -486,6 +525,19 @@ ['enable_lto=="true"', { 'ldflags': [ '-fno-lto' ], }], + # Avoid excessive PGO + ['enable_pgo_generate=="true"', { + 'cflags': [ '-fno-profile' ], + 'cflags!': [ '-fprofile-generate' ], + 'ldflags': [ '-fno-profile' ], + 'ldflags!': [ '-fprofile-generate' ], + }, ], + ['enable_pgo_use=="true"', { + 'cflags': [ '-fno-profile' ], + 'cflags!': [ '-fprofile-use -fprofile-correction' ], + 'ldflags': [ '-fno-profile' ], + 'ldflags!': [ '-fprofile-use -fprofile-correction' ], + }, ], ], }, ], diff --git a/tools/v8_gypfiles/d8.gyp b/tools/v8_gypfiles/d8.gyp index fa6d2be4f0599d..1c923431e52ad9 100644 --- a/tools/v8_gypfiles/d8.gyp +++ b/tools/v8_gypfiles/d8.gyp @@ -67,6 +67,19 @@ ['enable_lto=="true"', { 'ldflags': [ '-fno-lto' ], }], + # Avoid excessive PGO + ['enable_pgo_generate=="true"', { + 'cflags': [ '-fno-profile' ], + 'cflags!': [ '-fprofile-generate' ], + 'ldflags': [ '-fno-profile' ], + 'ldflags!': [ '-fprofile-generate' ], + }, ], + ['enable_pgo_use=="true"', { + 'cflags': [ '-fno-profile' ], + 'cflags!': [ '-fprofile-use -fprofile-correction' ], + 'ldflags': [ '-fno-profile' ], + 'ldflags!': [ '-fprofile-use -fprofile-correction' ], + }, ], ], }, ], diff --git a/tools/v8_gypfiles/v8.gyp b/tools/v8_gypfiles/v8.gyp index caeee267d656a9..0d7fe95251eed5 100644 --- a/tools/v8_gypfiles/v8.gyp +++ b/tools/v8_gypfiles/v8.gyp @@ -1381,6 +1381,19 @@ ['enable_lto=="true"', { 'ldflags': [ '-fno-lto' ], }], + # Avoid excessive PGO + ['enable_pgo_generate=="true"', { + 'cflags': [ '-fno-profile' ], + 'cflags!': [ '-fprofile-generate' ], + 'ldflags': [ '-fno-profile' ], + 'ldflags!': [ '-fprofile-generate' ], + }, ], + ['enable_pgo_use=="true"', { + 'cflags': [ '-fno-profile' ], + 'cflags!': [ '-fprofile-use -fprofile-correction' ], + 'ldflags': [ '-fno-profile' ], + 'ldflags!': [ '-fprofile-use -fprofile-correction' ], + }, ], ], 'defines!': [ 'BUILDING_V8_SHARED=1', @@ -1421,6 +1434,19 @@ ['enable_lto=="true"', { 'ldflags': [ '-fno-lto' ], }], + # Avoid excessive PGO + ['enable_pgo_generate=="true"', { + 'cflags': [ '-fno-profile' ], + 'cflags!': [ '-fprofile-generate' ], + 'ldflags': [ '-fno-profile' ], + 'ldflags!': [ '-fprofile-generate' ], + }, ], + ['enable_pgo_use=="true"', { + 'cflags': [ '-fno-profile' ], + 'cflags!': [ '-fprofile-use -fprofile-correction' ], + 'ldflags': [ '-fno-profile' ], + 'ldflags!': [ '-fprofile-use -fprofile-correction' ], + }, ], ], }, # mksnapshot { @@ -1438,6 +1464,19 @@ ['enable_lto=="true"', { 'ldflags': [ '-fno-lto' ], }], + # Avoid excessive PGO + ['enable_pgo_generate=="true"', { + 'cflags': [ '-fno-profile' ], + 'cflags!': [ '-fprofile-generate' ], + 'ldflags': [ '-fno-profile' ], + 'ldflags!': [ '-fprofile-generate' ], + }, ], + ['enable_pgo_use=="true"', { + 'cflags': [ '-fno-profile' ], + 'cflags!': [ '-fprofile-use -fprofile-correction' ], + 'ldflags': [ '-fno-profile' ], + 'ldflags!': [ '-fprofile-use -fprofile-correction' ], + }, ], ], 'defines!': [ '_HAS_EXCEPTIONS=0', @@ -1476,6 +1515,19 @@ ['enable_lto=="true"', { 'ldflags': [ '-fno-lto' ], }], + # Avoid excessive PGO + ['enable_pgo_generate=="true"', { + 'cflags': [ '-fno-profile' ], + 'cflags!': [ '-fprofile-generate' ], + 'ldflags': [ '-fno-profile' ], + 'ldflags!': [ '-fprofile-generate' ], + }, ], + ['enable_pgo_use=="true"', { + 'cflags': [ '-fno-profile' ], + 'cflags!': [ '-fprofile-use -fprofile-correction' ], + 'ldflags': [ '-fno-profile' ], + 'ldflags!': [ '-fprofile-use -fprofile-correction' ], + }, ], ], 'dependencies': [ 'torque_base', @@ -1512,6 +1564,19 @@ ['enable_lto=="true"', { 'ldflags': [ '-fno-lto' ], }], + # Avoid excessive PGO + ['enable_pgo_generate=="true"', { + 'cflags': [ '-fno-profile' ], + 'cflags!': [ '-fprofile-generate' ], + 'ldflags': [ '-fno-profile' ], + 'ldflags!': [ '-fprofile-generate' ], + }, ], + ['enable_pgo_use=="true"', { + 'cflags': [ '-fno-profile' ], + 'cflags!': [ '-fprofile-use -fprofile-correction' ], + 'ldflags': [ '-fno-profile' ], + 'ldflags!': [ '-fprofile-use -fprofile-correction' ], + }, ], ], 'sources': [ "<(V8_ROOT)/src/regexp/gen-regexp-special-case.cc", From c481224934236e6b3f016d4447e3ea0c122c905a Mon Sep 17 00:00:00 2001 From: Konstantin Demin Date: Tue, 8 Aug 2023 09:54:16 +0300 Subject: [PATCH 3/3] build, tools: avoid extra debug information Don't build intermediate executables with debug information in order to save some disk space during build. Signed-off-by: Konstantin Demin --- node.gyp | 25 +++++++++++++++++++++++++ tools/v8_gypfiles/v8.gyp | 25 +++++++++++++++++++++++++ 2 files changed, 50 insertions(+) diff --git a/node.gyp b/node.gyp index ed8a75fe69e226..037582e567b1da 100644 --- a/node.gyp +++ b/node.gyp @@ -1139,6 +1139,11 @@ 'ldflags': [ '-fno-profile' ], 'ldflags!': [ '-fprofile-use -fprofile-correction' ], }, ], + # Avoid extra debug information + ['v8_enable_handle_zapping==0', { + 'cflags': [ '-g0' ], + 'ldflags': [ '-s' ], + }], ], }, # fuzz_env { @@ -1259,6 +1264,11 @@ 'ldflags': [ '-fno-profile' ], 'ldflags!': [ '-fprofile-use -fprofile-correction' ], }, ], + # Avoid extra debug information + ['v8_enable_handle_zapping==0', { + 'cflags': [ '-g0' ], + 'ldflags': [ '-s' ], + }], ], }, # cctest @@ -1332,6 +1342,11 @@ 'ldflags': [ '-fno-profile' ], 'ldflags!': [ '-fprofile-use -fprofile-correction' ], }, ], + # Avoid extra debug information + ['v8_enable_handle_zapping==0', { + 'cflags': [ '-g0' ], + 'ldflags': [ '-s' ], + }], ], }, # embedtest @@ -1367,6 +1382,11 @@ 'ldflags': [ '-fno-profile' ], 'ldflags!': [ '-fprofile-use -fprofile-correction' ], }, ], + # Avoid extra debug information + ['v8_enable_handle_zapping==0', { + 'cflags': [ '-g0' ], + 'ldflags': [ '-s' ], + }], ] }, # overlapped-checker @@ -1514,6 +1534,11 @@ 'ldflags': [ '-fno-profile' ], 'ldflags!': [ '-fprofile-use -fprofile-correction' ], }, ], + # Avoid extra debug information + ['v8_enable_handle_zapping==0', { + 'cflags': [ '-g0' ], + 'ldflags': [ '-s' ], + }], ], }, # node_mksnapshot ], # end targets diff --git a/tools/v8_gypfiles/v8.gyp b/tools/v8_gypfiles/v8.gyp index 0d7fe95251eed5..36486a329a57e4 100644 --- a/tools/v8_gypfiles/v8.gyp +++ b/tools/v8_gypfiles/v8.gyp @@ -1394,6 +1394,11 @@ 'ldflags': [ '-fno-profile' ], 'ldflags!': [ '-fprofile-use -fprofile-correction' ], }, ], + # Avoid extra debug information + ['v8_enable_handle_zapping==0', { + 'cflags': [ '-g0' ], + 'ldflags': [ '-s' ], + }], ], 'defines!': [ 'BUILDING_V8_SHARED=1', @@ -1447,6 +1452,11 @@ 'ldflags': [ '-fno-profile' ], 'ldflags!': [ '-fprofile-use -fprofile-correction' ], }, ], + # Avoid extra debug information + ['v8_enable_handle_zapping==0', { + 'cflags': [ '-g0' ], + 'ldflags': [ '-s' ], + }], ], }, # mksnapshot { @@ -1477,6 +1487,11 @@ 'ldflags': [ '-fno-profile' ], 'ldflags!': [ '-fprofile-use -fprofile-correction' ], }, ], + # Avoid extra debug information + ['v8_enable_handle_zapping==0', { + 'cflags': [ '-g0' ], + 'ldflags': [ '-s' ], + }], ], 'defines!': [ '_HAS_EXCEPTIONS=0', @@ -1528,6 +1543,11 @@ 'ldflags': [ '-fno-profile' ], 'ldflags!': [ '-fprofile-use -fprofile-correction' ], }, ], + # Avoid extra debug information + ['v8_enable_handle_zapping==0', { + 'cflags': [ '-g0' ], + 'ldflags': [ '-s' ], + }], ], 'dependencies': [ 'torque_base', @@ -1577,6 +1597,11 @@ 'ldflags': [ '-fno-profile' ], 'ldflags!': [ '-fprofile-use -fprofile-correction' ], }, ], + # Avoid extra debug information + ['v8_enable_handle_zapping==0', { + 'cflags': [ '-g0' ], + 'ldflags': [ '-s' ], + }], ], 'sources': [ "<(V8_ROOT)/src/regexp/gen-regexp-special-case.cc",