Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v20.x] build, deps, test, tools: avoid excessive LTO, debug information #49064

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions deps/openssl/openssl.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,10 @@
}, {
'includes': ['./openssl-fips_asm_avx2.gypi'],
}],
# Avoid excessive LTO
['enable_lto=="true"', {
'ldflags': [ '-fno-lto' ],
}],
],
'direct_dependent_settings': {
'include_dirs': [ 'openssl/include', 'openssl/crypto/include']
Expand Down
28 changes: 28 additions & 0 deletions node.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -993,6 +993,10 @@
['enable_lto=="true"', {
'ldflags': [ '-fno-lto' ],
}],
# Avoid extra debug information
['v8_enable_handle_zapping==0', {
'ldflags': [ '-s' ],
}],
],
}, # fuzz_env
{
Expand Down Expand Up @@ -1101,6 +1105,10 @@
['enable_lto=="true"', {
'ldflags': [ '-fno-lto' ],
}],
# Avoid extra debug information
['v8_enable_handle_zapping==0', {
'ldflags': [ '-s' ],
}],
],
}, # cctest

Expand Down Expand Up @@ -1158,6 +1166,10 @@
['enable_lto=="true"', {
'ldflags': [ '-fno-lto' ],
}],
# Avoid extra debug information
['v8_enable_handle_zapping==0', {
'ldflags': [ '-s' ],
}],
],
}, # embedtest

Expand All @@ -1180,6 +1192,10 @@
['enable_lto=="true"', {
'ldflags': [ '-fno-lto' ],
}],
# Avoid extra debug information
['v8_enable_handle_zapping==0', {
'ldflags': [ '-s' ],
}],
]
}, # overlapped-checker
{
Expand Down Expand Up @@ -1213,6 +1229,14 @@
],
},
}],
# Avoid excessive LTO
['enable_lto=="true"', {
'ldflags': [ '-fno-lto' ],
}],
# Avoid extra debug information
['v8_enable_handle_zapping==0', {
'ldflags': [ '-s' ],
}],
]
},
{
Expand Down Expand Up @@ -1276,6 +1300,10 @@
['enable_lto=="true"', {
'ldflags': [ '-fno-lto' ],
}],
# Avoid extra debug information
['v8_enable_handle_zapping==0', {
'ldflags': [ '-s' ],
}],
],
}, # node_mksnapshot
], # end targets
Expand Down
7 changes: 6 additions & 1 deletion test/addons/dlopen-ping-pong/binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@
# Enable the shared object to be linked by runtime linker
['OS in "aix os400"', {
'ldflags': [ '-Wl,-G' ]
}]],
}],
# Avoid excessive LTO
['enable_lto=="true"', {
'ldflags': [ '-fno-lto' ],
}],
],
},
{
'target_name': 'binding',
Expand Down
4 changes: 4 additions & 0 deletions test/addons/openssl-client-cert-engine/binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
]
},
}],
# Avoid excessive LTO
['enable_lto=="true"', {
'ldflags': [ '-fno-lto' ],
}],
]
}
]
Expand Down
4 changes: 4 additions & 0 deletions test/addons/openssl-key-engine/binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
]
},
}],
# Avoid excessive LTO
['enable_lto=="true"', {
'ldflags': [ '-fno-lto' ],
}],
]
}
]
Expand Down
4 changes: 4 additions & 0 deletions test/addons/openssl-test-engine/binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@
'-Wno-deprecated-declarations',
],
}],
# Avoid excessive LTO
['enable_lto=="true"', {
'ldflags': [ '-fno-lto' ],
}],
],
}],
],
Expand Down
24 changes: 20 additions & 4 deletions tools/v8_gypfiles/v8.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -1502,6 +1502,10 @@
['enable_lto=="true"', {
'ldflags': [ '-fno-lto' ],
}],
# Avoid extra debug information
['v8_enable_handle_zapping==0', {
'ldflags': [ '-s' ],
}],
],
'defines!': [
'BUILDING_V8_SHARED=1',
Expand Down Expand Up @@ -1544,6 +1548,10 @@
['enable_lto=="true"', {
'ldflags': [ '-fno-lto' ],
}],
# Avoid extra debug information
['v8_enable_handle_zapping==0', {
'ldflags': [ '-s' ],
}],
],
}, # mksnapshot
{
Expand All @@ -1561,6 +1569,10 @@
['enable_lto=="true"', {
'ldflags': [ '-fno-lto' ],
}],
# Avoid extra debug information
['v8_enable_handle_zapping==0', {
'ldflags': [ '-s' ],
}],
],
'defines!': [
'_HAS_EXCEPTIONS=0',
Expand Down Expand Up @@ -1599,6 +1611,10 @@
['enable_lto=="true"', {
'ldflags': [ '-fno-lto' ],
}],
# Avoid extra debug information
['v8_enable_handle_zapping==0', {
'ldflags': [ '-s' ],
}],
],
'dependencies': [
'torque_base',
Expand Down Expand Up @@ -1635,6 +1651,10 @@
['enable_lto=="true"', {
'ldflags': [ '-fno-lto' ],
}],
# Avoid extra debug information
['v8_enable_handle_zapping==0', {
'ldflags': [ '-s' ],
}],
],
'sources': [
"<(V8_ROOT)/src/regexp/gen-regexp-special-case.cc",
Expand All @@ -1651,10 +1671,6 @@
}, {
'dependencies': ['gen-regexp-special-case#target'],
}],
# Avoid excessive LTO
['enable_lto=="true"', {
'ldflags': [ '-fno-lto' ],
}],
],
'actions': [
{
Expand Down