Author: Saleem Abdulrasool Date: 2019-11-06T15:42:09-08:00 New Revision: e74e61ff297e81c0a9bda54037033fc40fc76e1d
URL: https://github.com/llvm/llvm-project/commit/e74e61ff297e81c0a9bda54037033fc40fc76e1d DIFF: https://github.com/llvm/llvm-project/commit/e74e61ff297e81c0a9bda54037033fc40fc76e1d.diff LOG: unwind: restore the LINKER_LANGUAGE Have CMake treat the unwind libraries as C libraries rather than C++. There is no C++ runtime dependency at runtime. This ensures that we do not accidentally end up with a link against the C++ runtime. We need to explicitly reset the implicitly linked libraries for C++ to ensure that we do not have CMake force the link against the C++ runtime. This adjustment should enable the NetBSD bots to be happy with this change. Added: Modified: libunwind/src/CMakeLists.txt Removed: ################################################################################ diff --git a/libunwind/src/CMakeLists.txt b/libunwind/src/CMakeLists.txt index eaa8ae6ca980..d02f8a21dd48 100644 --- a/libunwind/src/CMakeLists.txt +++ b/libunwind/src/CMakeLists.txt @@ -108,6 +108,10 @@ set_property(SOURCE ${LIBUNWIND_CXX_SOURCES} set_property(SOURCE ${LIBUNWIND_C_SOURCES} APPEND_STRING PROPERTY COMPILE_FLAGS " ${LIBUNWIND_C_FLAGS}") +# NOTE: avoid implicit dependencies on C++ runtimes. libunwind uses C++ for +# ease, but does not rely on C++ at runtime. +set(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "") + # Build the shared library. if (LIBUNWIND_ENABLE_SHARED) add_library(unwind_shared SHARED ${LIBUNWIND_SOURCES} ${LIBUNWIND_HEADERS}) @@ -126,6 +130,7 @@ if (LIBUNWIND_ENABLE_SHARED) CXX_STANDARD_REQUIRED ON COMPILE_FLAGS "${LIBUNWIND_COMPILE_FLAGS}" LINK_FLAGS "${LIBUNWIND_LINK_FLAGS}" + LINKER_LANGUAGE C OUTPUT_NAME "unwind" VERSION "1.0" SOVERSION "1") @@ -150,6 +155,7 @@ if (LIBUNWIND_ENABLE_STATIC) CXX_STANDARD_REQUIRED ON COMPILE_FLAGS "${LIBUNWIND_COMPILE_FLAGS}" LINK_FLAGS "${LIBUNWIND_LINK_FLAGS}" + LINKER_LANGUAGE C OUTPUT_NAME "unwind") if(LIBUNWIND_HERMETIC_STATIC_LIBRARY) _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits