Skip to content

Commit 1b5f35f

Browse files
bnoordhuisMylesBorins
authored andcommitted
build: turn on thin static archives
Thin archives were disabled in 2012 as a workaround (IIRC) for obsolete tooling on one of Joyent's platforms. The last binutils versions that didn't support them was released in 2007 so I think it's safe to assume we can drop support for that now - except on SmartOS, where the tooling still has a distinctive vintage feel to it. Thin archives save space - it shrinks the size of PRODUCT_DIR by 30% - and speed up the final linking step because it doesn't have to assemble 50 MB of static archives (twice! - first to create the archive, then to copy it to PRODUCT_DIR). The archives are just 3.5 MB now and no longer copied around. PR-URL: #7957 Reviewed-By: Johan Bergström <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 36b3ff0 commit 1b5f35f

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

common.gypi

+3-2
Original file line numberDiff line numberDiff line change
@@ -239,8 +239,9 @@
239239
'cflags_cc': [ '-fno-rtti', '-fno-exceptions', '-std=gnu++0x' ],
240240
'ldflags': [ '-rdynamic' ],
241241
'target_conditions': [
242-
['_type=="static_library"', {
243-
'standalone_static_library': 1, # disable thin archive which needs binutils >= 2.19
242+
# The 1990s toolchain on SmartOS can't handle thin archives.
243+
['_type=="static_library" and OS=="solaris"', {
244+
'standalone_static_library': 1,
244245
}],
245246
],
246247
'conditions': [

node.gyp

+3-1
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,9 @@
285285
'conditions': [
286286
['OS in "linux freebsd"', {
287287
'ldflags': [
288-
'-Wl,--whole-archive <(PRODUCT_DIR)/<(OPENSSL_PRODUCT)',
288+
'-Wl,--whole-archive,'
289+
'<(PRODUCT_DIR)/obj.target/deps/openssl/'
290+
'<(OPENSSL_PRODUCT)',
289291
'-Wl,--no-whole-archive',
290292
],
291293
}],

0 commit comments

Comments
 (0)