Skip to content

Commit e74e61f

Browse files
committed
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.
1 parent aa582e3 commit e74e61f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

libunwind/src/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,10 @@ set_property(SOURCE ${LIBUNWIND_CXX_SOURCES}
108108
set_property(SOURCE ${LIBUNWIND_C_SOURCES}
109109
APPEND_STRING PROPERTY COMPILE_FLAGS " ${LIBUNWIND_C_FLAGS}")
110110

111+
# NOTE: avoid implicit dependencies on C++ runtimes. libunwind uses C++ for
112+
# ease, but does not rely on C++ at runtime.
113+
set(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "")
114+
111115
# Build the shared library.
112116
if (LIBUNWIND_ENABLE_SHARED)
113117
add_library(unwind_shared SHARED ${LIBUNWIND_SOURCES} ${LIBUNWIND_HEADERS})
@@ -126,6 +130,7 @@ if (LIBUNWIND_ENABLE_SHARED)
126130
CXX_STANDARD_REQUIRED ON
127131
COMPILE_FLAGS "${LIBUNWIND_COMPILE_FLAGS}"
128132
LINK_FLAGS "${LIBUNWIND_LINK_FLAGS}"
133+
LINKER_LANGUAGE C
129134
OUTPUT_NAME "unwind"
130135
VERSION "1.0"
131136
SOVERSION "1")
@@ -150,6 +155,7 @@ if (LIBUNWIND_ENABLE_STATIC)
150155
CXX_STANDARD_REQUIRED ON
151156
COMPILE_FLAGS "${LIBUNWIND_COMPILE_FLAGS}"
152157
LINK_FLAGS "${LIBUNWIND_LINK_FLAGS}"
158+
LINKER_LANGUAGE C
153159
OUTPUT_NAME "unwind")
154160

155161
if(LIBUNWIND_HERMETIC_STATIC_LIBRARY)

0 commit comments

Comments
 (0)