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 12649f4

Browse filesBrowse files
mednsrvagg
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 8a60aa1 commit 12649f4
Copy full SHA for 12649f4

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("--enable-vtune-profiling",
9096
action="store_true",
@@ -816,12 +822,19 @@ def configure_openssl(o):
816822
configure_library('openssl', o)
817823

818824

819-
def configure_fullystatic(o):
820-
if options.fully_static:
821-
o['libraries'] += ['-static']
825+
def configure_static(o):
826+
if options.fully_static or options.partly_static:
822827
if flavor == 'mac':
823828
print("Generation of static executable will not work on OSX "
824-
"when using default compilation environment")
829+
"when using the default compilation environment")
830+
return
831+
832+
if options.fully_static:
833+
o['libraries'] += ['-static']
834+
elif options.partly_static:
835+
o['libraries'] += ['-static-libgcc', '-static-libstdc++']
836+
if options.enable_asan:
837+
o['libraries'] += ['-static-libasan']
825838

826839

827840
def configure_winsdk(o):
@@ -1119,7 +1132,7 @@ configure_v8(output)
11191132
configure_openssl(output)
11201133
configure_winsdk(output)
11211134
configure_intl(output)
1122-
configure_fullystatic(output)
1135+
configure_static(output)
11231136

11241137
# variables should be a root level element,
11251138
# 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.