diff --git a/deps/openssl/openssl-cli.gypi b/deps/openssl/openssl-cli.gypi index 1209d64e46dbc2..e10a6078349db8 100644 --- a/deps/openssl/openssl-cli.gypi +++ b/deps/openssl/openssl-cli.gypi @@ -21,5 +21,22 @@ ], }, }], + # Avoid excessive LTO + ['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 4609d83baabac1..4c5636be6a6784 100644 --- a/deps/openssl/openssl.gyp +++ b/deps/openssl/openssl.gyp @@ -49,6 +49,23 @@ }, { 'includes': ['./openssl-cl_asm.gypi'], }], + # Avoid excessive LTO + ['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 de409a31f388fc..037582e567b1da 100644 --- a/node.gyp +++ b/node.gyp @@ -1122,6 +1122,28 @@ [ 'OS!="linux" or ossfuzz!="true"', { 'type': 'none', }], + # Avoid excessive LTO + ['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' ], + }, ], + # Avoid extra debug information + ['v8_enable_handle_zapping==0', { + 'cflags': [ '-g0' ], + 'ldflags': [ '-s' ], + }], ], }, # fuzz_env { @@ -1225,6 +1247,28 @@ 'Ws2_32.lib', ], }], + # Avoid excessive LTO + ['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' ], + }, ], + # Avoid extra debug information + ['v8_enable_handle_zapping==0', { + 'cflags': [ '-g0' ], + 'ldflags': [ '-s' ], + }], ], }, # cctest @@ -1281,6 +1325,28 @@ 'Ws2_32.lib', ], }], + # Avoid excessive LTO + ['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' ], + }, ], + # Avoid extra debug information + ['v8_enable_handle_zapping==0', { + 'cflags': [ '-g0' ], + 'ldflags': [ '-s' ], + }], ], }, # embedtest @@ -1299,6 +1365,28 @@ 'test/overlapped-checker/main_unix.c' ], }], + # Avoid excessive LTO + ['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' ], + }, ], + # Avoid extra debug information + ['v8_enable_handle_zapping==0', { + 'cflags': [ '-g0' ], + 'ldflags': [ '-s' ], + }], ] }, # overlapped-checker @@ -1361,6 +1449,23 @@ 'Ws2_32.lib', ], }], + # Avoid excessive LTO + ['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 { @@ -1412,6 +1517,28 @@ 'Ws2_32.lib', ], }], + # Avoid excessive LTO + ['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' ], + }, ], + # Avoid extra debug information + ['v8_enable_handle_zapping==0', { + 'cflags': [ '-g0' ], + 'ldflags': [ '-s' ], + }], ], }, # node_mksnapshot ], # end targets diff --git a/tools/icu/icu-generic.gyp b/tools/icu/icu-generic.gyp index 3e830aa097e570..5c97d69415fac6 100644 --- a/tools/icu/icu-generic.gyp +++ b/tools/icu/icu-generic.gyp @@ -429,6 +429,25 @@ '<@(icu_src_derb)', 'no-op.cc', ], + 'conditions': [ + # Avoid excessive LTO + ['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 { @@ -440,6 +459,25 @@ 'iculslocs.cc', 'no-op.cc', ], + 'conditions': [ + # Avoid excessive LTO + ['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 # and convert endianesses @@ -452,6 +490,25 @@ '<@(icu_src_icupkg)', 'no-op.cc', ], + 'conditions': [ + # Avoid excessive LTO + ['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 { @@ -463,6 +520,25 @@ '<@(icu_src_genccode)', 'no-op.cc', ], + 'conditions': [ + # Avoid excessive LTO + ['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 46b415c2ed93f5..1c923431e52ad9 100644 --- a/tools/v8_gypfiles/d8.gyp +++ b/tools/v8_gypfiles/d8.gyp @@ -63,6 +63,23 @@ '<(icu_gyp_path):icudata', ], }], + # Avoid excessive LTO + ['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 ed042f88296186..36486a329a57e4 100644 --- a/tools/v8_gypfiles/v8.gyp +++ b/tools/v8_gypfiles/v8.gyp @@ -1377,6 +1377,28 @@ ['want_separate_host_toolset', { 'toolsets': ['host'], }], + # Avoid excessive LTO + ['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' ], + }, ], + # Avoid extra debug information + ['v8_enable_handle_zapping==0', { + 'cflags': [ '-g0' ], + 'ldflags': [ '-s' ], + }], ], 'defines!': [ 'BUILDING_V8_SHARED=1', @@ -1413,6 +1435,28 @@ ['want_separate_host_toolset', { 'toolsets': ['host'], }], + # Avoid excessive LTO + ['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' ], + }, ], + # Avoid extra debug information + ['v8_enable_handle_zapping==0', { + 'cflags': [ '-g0' ], + 'ldflags': [ '-s' ], + }], ], }, # mksnapshot { @@ -1426,6 +1470,28 @@ ['want_separate_host_toolset', { 'toolsets': ['host'], }], + # Avoid excessive LTO + ['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' ], + }, ], + # Avoid extra debug information + ['v8_enable_handle_zapping==0', { + 'cflags': [ '-g0' ], + 'ldflags': [ '-s' ], + }], ], 'defines!': [ '_HAS_EXCEPTIONS=0', @@ -1460,6 +1526,28 @@ ['want_separate_host_toolset', { 'toolsets': ['host'], }], + # Avoid excessive LTO + ['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' ], + }, ], + # Avoid extra debug information + ['v8_enable_handle_zapping==0', { + 'cflags': [ '-g0' ], + 'ldflags': [ '-s' ], + }], ], 'dependencies': [ 'torque_base', @@ -1492,6 +1580,28 @@ ['want_separate_host_toolset', { 'toolsets': ['host'], }], + # Avoid excessive LTO + ['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' ], + }, ], + # Avoid extra debug information + ['v8_enable_handle_zapping==0', { + 'cflags': [ '-g0' ], + 'ldflags': [ '-s' ], + }], ], 'sources': [ "<(V8_ROOT)/src/regexp/gen-regexp-special-case.cc",