Closed sylvestre closed 2 years ago
Adding -lpthread -ldl
manually fixes the issue
I fixed this with an ugly patch to force the link to pthread & dl (as I am targeting only debian & ubuntu)
Index: llvm-toolchain-snapshot-15~++20220521115334+295d032762ad/libunwind/CMakeLists.txt
===================================================================
--- llvm-toolchain-snapshot-15~++20220521115334+295d032762ad.orig/libunwind/CMakeLists.txt
+++ llvm-toolchain-snapshot-15~++20220521115334+295d032762ad/libunwind/CMakeLists.txt
@@ -309,14 +309,17 @@ if (MSVC)
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
endif()
-if (C_SUPPORTS_COMMENT_LIB_PRAGMA)
- if (LIBUNWIND_HAS_DL_LIB)
+list(APPEND LIBUNWIND_LINK_FLAGS "-ldl")
+list(APPEND LIBUNWIND_LINK_FLAGS "-lpthread")
+
+#if (C_SUPPORTS_COMMENT_LIB_PRAGMA)
+# if (LIBUNWIND_HAS_DL_LIB)
add_definitions(-D_LIBUNWIND_LINK_DL_LIB)
- endif()
- if (LIBUNWIND_HAS_PTHREAD_LIB)
+# endif()
+# if (LIBUNWIND_HAS_PTHREAD_LIB)
add_definitions(-D_LIBUNWIND_LINK_PTHREAD_LIB)
- endif()
-endif()
+# endif()
+#endif()
#===============================================================================
# Setup Source Code
I could not make it work with
-DLIBUNWIND_LINK_FLAGS="-ldl -lpthread"
Seem like a cmake bug, upgrading the cmake version solves this issue for me.
Fails on arm64 & amd64