Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: add "--partly-static" options to generate with libgcc and libstdc++ #4152

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 19 additions & 6 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,13 @@ parser.add_option("--fully-static",
action="store_true",
dest="fully_static",
help="Generate an executable without external dynamic libraries. This "
"will not work on OSX when using default compilation environment")
"will not work on OSX when using the default compilation environment")

parser.add_option("--partly-static",
action="store_true",
dest="partly_static",
help="Generate an executable with libgcc and libstdc++ libraries. This "
"will not work on OSX when using the default compilation environment")

parser.add_option("--enable-vtune-profiling",
action="store_true",
Expand Down Expand Up @@ -816,12 +822,19 @@ def configure_openssl(o):
configure_library('openssl', o)


def configure_fullystatic(o):
if options.fully_static:
o['libraries'] += ['-static']
def configure_static(o):
if options.fully_static or options.partly_static:
if flavor == 'mac':
print("Generation of static executable will not work on OSX "
"when using default compilation environment")
"when using the default compilation environment")
return

if options.fully_static:
o['libraries'] += ['-static']
elif options.partly_static:
o['libraries'] += ['-static-libgcc', '-static-libstdc++']
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you're also going to need -static-libasan when options.enable_asan is on.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

if options.enable_asan:
o['libraries'] += ['-static-libasan']


def configure_winsdk(o):
Expand Down Expand Up @@ -1119,7 +1132,7 @@ configure_v8(output)
configure_openssl(output)
configure_winsdk(output)
configure_intl(output)
configure_fullystatic(output)
configure_static(output)

# variables should be a root level element,
# move everything else to target_defaults
Expand Down