[libunwind] [runtimes] Fix link order of system librarires on Apple platforms (PR #66940)

via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 20 14:14:10 PDT 2023


================
@@ -659,24 +659,22 @@ function(cxx_link_system_libraries target)
     target_add_link_flags_if_supported(${target} PRIVATE "--unwindlib=none")
   endif()
 
-  if (LIBCXX_HAS_SYSTEM_LIB)
-    target_link_libraries(${target} PRIVATE System)
-  endif()
-
-  if (LIBCXX_HAS_PTHREAD_LIB)
-    target_link_libraries(${target} PRIVATE pthread)
-  endif()
+  if (NOT APPLE) # On Apple platforms, we always use -nostdlib++ so we don't need to re-add other libraries
+    if (LIBCXX_HAS_PTHREAD_LIB)
----------------
EricWF wrote:

But pthread isn't linked by default. So doesn't it still need to be added?

https://github.com/llvm/llvm-project/pull/66940


More information about the cfe-commits mailing list