Skip to content

Commit

Permalink
Link libc++ statically to reduce runtime dependency of wamrc
Browse files Browse the repository at this point in the history
  • Loading branch information
no1wudi committed Apr 18, 2024
1 parent d39d2ba commit a2528d0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions wamr-compiler/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
endif()
else()
target_link_libraries (wamrc aotclib vmlib ${lib_lldb} ${WAMRC_LINK_LLVM_LIBS} ${lib_ubsan}
Expand Down

0 comments on commit a2528d0

Please sign in to comment.