Skip to content

Commit

Permalink
build, tools: avoid extra debug information
Browse files Browse the repository at this point in the history
Don't build intermediate executables with debug information in order
to save some disk space during build.

Signed-off-by: Konstantin Demin <rockdrilla@gmail.com>
  • Loading branch information
rockdrilla committed Sep 16, 2023
1 parent 36da01b commit 2d7f8df
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
24 changes: 24 additions & 0 deletions node.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -1034,6 +1034,10 @@
['enable_lto=="true"', {
'ldflags': [ '-fno-lto' ],
}],
# Avoid extra debug information
['v8_enable_handle_zapping==0', {
'ldflags': [ '-s' ],
}],
],
}, # fuzz_env
{
Expand Down Expand Up @@ -1113,6 +1117,10 @@
['enable_lto=="true"', {
'ldflags': [ '-fno-lto' ],
}],
# Avoid extra debug information
['v8_enable_handle_zapping==0', {
'ldflags': [ '-s' ],
}],
],
}, # cctest

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

Expand All @@ -1192,6 +1204,10 @@
['enable_lto=="true"', {
'ldflags': [ '-fno-lto' ],
}],
# Avoid extra debug information
['v8_enable_handle_zapping==0', {
'ldflags': [ '-s' ],
}],
]
}, # overlapped-checker
{
Expand Down Expand Up @@ -1229,6 +1245,10 @@
['enable_lto=="true"', {
'ldflags': [ '-fno-lto' ],
}],
# Avoid extra debug information
['v8_enable_handle_zapping==0', {
'ldflags': [ '-s' ],
}],
]
},
{
Expand Down Expand Up @@ -1292,6 +1312,10 @@
['enable_lto=="true"', {
'ldflags': [ '-fno-lto' ],
}],
# Avoid extra debug information
['v8_enable_handle_zapping==0', {
'ldflags': [ '-s' ],
}],
],
}, # node_mksnapshot
], # end targets
Expand Down
20 changes: 20 additions & 0 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 Down

0 comments on commit 2d7f8df

Please sign in to comment.