From 34a3b24a90c6f1886968a8bf6159329995696c77 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 llvm-svn: 374510 --- libcxx/cmake/Modules/DefineLinkerScript.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libcxx/cmake/Modules/DefineLinkerScript.cmake b/libcxx/cmake/Modules/DefineLinkerScript.cmake index 213ab5d47a69..2e68121f6187 100644 --- a/libcxx/cmake/Modules/DefineLinkerScript.cmake +++ b/libcxx/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}")