Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit c5f71ac

Browse filesBrowse files
mednsMyles Borins
authored andcommitted
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 <info@bnoordhuis.nl> Reviewed-By: Minwoo Jung <jmwsoft@gmail.com>
1 parent 830caeb commit c5f71ac
Copy full SHA for c5f71ac

File tree

Expand file treeCollapse file tree

1 file changed

+19
-6
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+19
-6
lines changed
Open diff view settings
Collapse file

‎configure‎

Copy file name to clipboardExpand all lines: configure
+19-6Lines changed: 19 additions & 6 deletions
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.