Skip to content

Commit 6ed4ea8

Browse files
bnoordhuiscjihrig
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 ccbb463 commit 6ed4ea8

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

common.gypi

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,8 +244,9 @@
244244
'cflags_cc': [ '-fno-rtti', '-fno-exceptions', '-std=gnu++0x' ],
245245
'ldflags': [ '-rdynamic' ],
246246
'target_conditions': [
247-
['_type=="static_library"', {
248-
'standalone_static_library': 1, # disable thin archive which needs binutils >= 2.19
247+
# The 1990s toolchain on SmartOS can't handle thin archives.
248+
['_type=="static_library" and OS=="solaris"', {
249+
'standalone_static_library': 1,
249250
}],
250251
],
251252
'conditions': [

node.gyp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,9 @@
368368
'conditions': [
369369
['OS in "linux freebsd" and node_shared=="false"', {
370370
'ldflags': [
371-
'-Wl,--whole-archive <(PRODUCT_DIR)/<(OPENSSL_PRODUCT)',
371+
'-Wl,--whole-archive,'
372+
'<(PRODUCT_DIR)/obj.target/deps/openssl/'
373+
'<(OPENSSL_PRODUCT)',
372374
'-Wl,--no-whole-archive',
373375
],
374376
}],

0 commit comments

Comments
 (0)