-
Notifications
You must be signed in to change notification settings - Fork 627
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
Link libc++ statically to reduce runtime dependency of wamrc #3331
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -387,6 +387,12 @@ if (NOT MSVC) | |
target_link_libraries (wamrc ssp.a ws2_32) | ||
else() | ||
target_link_libraries (wamrc -ldl) | ||
# Link libc++ statically to reduce the runtime dependency | ||
target_link_libraries (wamrc -static-libstdc++) | ||
# If not on macOS, link libgcc statically | ||
if (NOT APPLE) | ||
target_link_libraries (wamrc -static-libgcc) | ||
endif() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. which instance of these libraries are used by shared libraries loaded by There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure which copy will be used in the native lib, but it seems OK since I have used a cxx based custom compiler plugin with prebuilt wasi-sdk, it works fine without special action, please refer to: https://clang.llvm.org/docs/ClangPlugins.html I guess it use the dynamic libc++ from system instead of the static version in the clang/wamrc |
||
endif() | ||
else() | ||
target_link_libraries (wamrc aotclib vmlib ${lib_lldb} ${WAMRC_LINK_LLVM_LIBS} ${lib_ubsan} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we make this configurable?
I think static link such libraries is not a very common requirement.