From 437d5a5dcfa1fd87260622d0041bea91ba636754 Mon Sep 17 00:00:00 2001 From: Petr Hosek Date: Fri, 11 Oct 2019 04:54:35 +0000 Subject: [PATCH] [libc++] Fix linker script generation Handle the case when libc++abi and libunwind are being built together with libc++ in the runtimes build. This logic was used in the previous implementation but dropped in r374116. Differential Revision: https://reviews.llvm.org/D68791 git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@374510 91177308-0d34-0410-b5e6-96231b3b80d8 --- cmake/Modules/DefineLinkerScript.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmake/Modules/DefineLinkerScript.cmake b/cmake/Modules/DefineLinkerScript.cmake index 213ab5d47..2e68121f6 100644 --- a/cmake/Modules/DefineLinkerScript.cmake +++ b/cmake/Modules/DefineLinkerScript.cmake @@ -31,7 +31,9 @@ function(define_linker_script target) set(link_libraries) if (interface_libs) foreach(lib IN LISTS interface_libs) - if (TARGET "${lib}") + if (TARGET "${lib}" OR + (${lib} MATCHES "cxxabi(_static|_shared)?" AND HAVE_LIBCXXABI) OR + (${lib} MATCHES "unwind(_static|_shared)?" AND HAVE_LIBUNWIND)) list(APPEND link_libraries "${CMAKE_LINK_LIBRARY_FLAG}$") else() list(APPEND link_libraries "${CMAKE_LINK_LIBRARY_FLAG}${lib}")