[libcxx-commits] [PATCH] D77294: [libc++] Fix linking libc++abi in standalone builds

Raul Tambre via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Apr 2 04:18:44 PDT 2020


tambre created this revision.
tambre added a reviewer: ldionne.
Herald added subscribers: libcxx-commits, dexonsmith, mgorny.
Herald added a project: libc++.
Herald added a reviewer: libc++.
tambre edited the summary of this revision.

In standalone builds the cxxabi_shared and cxxabi_static targets don't exist.
We need to link against the library itself.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D77294

Files:
  libcxx/cmake/Modules/HandleLibCXXABI.cmake


Index: libcxx/cmake/Modules/HandleLibCXXABI.cmake
===================================================================
--- libcxx/cmake/Modules/HandleLibCXXABI.cmake
+++ libcxx/cmake/Modules/HandleLibCXXABI.cmake
@@ -103,9 +103,18 @@
     )
 elseif ("${LIBCXX_CXX_ABI_LIBNAME}" STREQUAL "libcxxabi")
   set(LIBCXX_CXX_ABI_INCLUDE_PATHS "${LIBCXX_SOURCE_DIR}/../libcxxabi/include")
+
+  if(LIBCXX_STANDALONE_BUILD)
+    set(shared c++abi)
+    set(static c++abi)
+  else()
+    set(shared cxxabi_shared)
+    set(static cxxabi_static)
+  endif()
+
   setup_abi_lib(
     "-DLIBCXX_BUILDING_LIBCXXABI"
-    "cxxabi_shared" "cxxabi_static" "cxxabi.h;__cxxabi_config.h" "")
+    "${shared}" "${static}" "cxxabi.h;__cxxabi_config.h" "")
 elseif ("${LIBCXX_CXX_ABI_LIBNAME}" STREQUAL "libcxxrt")
   set(LIBCXX_CXX_ABI_INCLUDE_PATHS "/usr/include/c++/v1")
   setup_abi_lib(


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D77294.254475.patch
Type: text/x-patch
Size: 866 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20200402/1fc77bf5/attachment.bin>


More information about the libcxx-commits mailing list