Skip to content

Commit c5f71ac

Browse files
mednsMyles Borins
authored and
Myles Borins
committedJan 19, 2016
build: add "--partly-static" build options
A lot of machines don't upgrade libstdc++.so library for a long time, but the new version of node requires the latest GLIBCXX. Using "--fully-static" configurable options may resolve this problem, but the side effect is that the size of the executable file will be increased. Adding "--partly-static" configurable options it will only build libgcc and libstdc++ libraries into executable file, resolve the problem and control the size of file. PR-URL: #4152 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Minwoo Jung <[email protected]>
1 parent 830caeb commit c5f71ac

File tree

1 file changed

+19
-6
lines changed

1 file changed

+19
-6
lines changed
 

‎configure

+19-6
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,13 @@ parser.add_option("--fully-static",
8484
action="store_true",
8585
dest="fully_static",
8686
help="Generate an executable without external dynamic libraries. This "
87-
"will not work on OSX when using default compilation environment")
87+
"will not work on OSX when using the default compilation environment")
88+
89+
parser.add_option("--partly-static",
90+
action="store_true",
91+
dest="partly_static",
92+
help="Generate an executable with libgcc and libstdc++ libraries. This "
93+
"will not work on OSX when using the default compilation environment")
8894

8995
parser.add_option("--link-module",
9096
action="append",
@@ -794,12 +800,19 @@ def configure_openssl(o):
794800
configure_library('openssl', o)
795801

796802

797-
def configure_fullystatic(o):
798-
if options.fully_static:
799-
o['libraries'] += ['-static']
803+
def configure_static(o):
804+
if options.fully_static or options.partly_static:
800805
if flavor == 'mac':
801806
print("Generation of static executable will not work on OSX "
802-
"when using default compilation environment")
807+
"when using the default compilation environment")
808+
return
809+
810+
if options.fully_static:
811+
o['libraries'] += ['-static']
812+
elif options.partly_static:
813+
o['libraries'] += ['-static-libgcc', '-static-libstdc++']
814+
if options.enable_asan:
815+
o['libraries'] += ['-static-libasan']
803816

804817

805818
def configure_winsdk(o):
@@ -1097,7 +1110,7 @@ configure_v8(output)
10971110
configure_openssl(output)
10981111
configure_winsdk(output)
10991112
configure_intl(output)
1100-
configure_fullystatic(output)
1113+
configure_static(output)
11011114

11021115
# variables should be a root level element,
11031116
# move everything else to target_defaults

0 commit comments

Comments
 (0)
Please sign in to comment.