[llvm-branch-commits] [libcxx] 4327d39 - [libcxx] Add an explicit option to build against system-libcxxabi
Louis Dionne via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Tue Mar 1 10:45:57 PST 2022
Author: Michał Górny
Date: 2022-03-01T13:45:45-05:00
New Revision: 4327d39b15b22b9ee23582e5455df5b2a093fe8d
URL: https://github.com/llvm/llvm-project/commit/4327d39b15b22b9ee23582e5455df5b2a093fe8d
DIFF: https://github.com/llvm/llvm-project/commit/4327d39b15b22b9ee23582e5455df5b2a093fe8d.diff
LOG: [libcxx] Add an explicit option to build against system-libcxxabi
Add an explicit LIBCXX_CXX_ABI=system-libcxxabi option for linking to
system-installed libc++abi. This fixes the ability to link against one
when building libcxx via the runtimes build, as otherwise the build
system insists on linking into in-tree targets.
Differential Revision: https://reviews.llvm.org/D119539
(cherry picked from commit ba4f1e44e480d661d99973007a39dc642f5d79a4)
Added:
Modified:
libcxx/cmake/Modules/HandleLibCXXABI.cmake
libcxx/docs/BuildingLibcxx.rst
libcxx/utils/libcxx/test/config.py
Removed:
################################################################################
diff --git a/libcxx/cmake/Modules/HandleLibCXXABI.cmake b/libcxx/cmake/Modules/HandleLibCXXABI.cmake
index d69405ddeeacf..9b5df6e015b35 100644
--- a/libcxx/cmake/Modules/HandleLibCXXABI.cmake
+++ b/libcxx/cmake/Modules/HandleLibCXXABI.cmake
@@ -118,6 +118,10 @@ elseif ("${LIBCXX_CXX_ABI_LIBNAME}" STREQUAL "libcxxabi")
setup_abi_lib(
"-DLIBCXX_BUILDING_LIBCXXABI"
"${shared}" "${static}" "cxxabi.h;__cxxabi_config.h" "")
+elseif ("${LIBCXX_CXX_ABI_LIBNAME}" STREQUAL "system-libcxxabi")
+ setup_abi_lib(
+ "-DLIBCXX_BUILDING_LIBCXXABI"
+ "c++abi" "c++abi" "cxxabi.h;__cxxabi_config.h" "")
elseif ("${LIBCXX_CXX_ABI_LIBNAME}" STREQUAL "libcxxrt")
if(NOT LIBCXX_CXX_ABI_INCLUDE_PATHS)
set(LIBCXX_CXX_ABI_INCLUDE_PATHS "/usr/include/c++/v1")
diff --git a/libcxx/docs/BuildingLibcxx.rst b/libcxx/docs/BuildingLibcxx.rst
index a0c7672ff7717..544d06cc8c424 100644
--- a/libcxx/docs/BuildingLibcxx.rst
+++ b/libcxx/docs/BuildingLibcxx.rst
@@ -318,7 +318,7 @@ ABI Library Specific Options
.. option:: LIBCXX_CXX_ABI:STRING
- **Values**: ``none``, ``libcxxabi``, ``libcxxrt``, ``libstdc++``, ``libsupc++``.
+ **Values**: ``none``, ``libcxxabi``, ``system-libcxxabi``, ``libcxxrt``, ``libstdc++``, ``libsupc++``.
Select the ABI library to build libc++ against.
diff --git a/libcxx/utils/libcxx/test/config.py b/libcxx/utils/libcxx/test/config.py
index fdc1ff4f714ab..152a9755206e1 100644
--- a/libcxx/utils/libcxx/test/config.py
+++ b/libcxx/utils/libcxx/test/config.py
@@ -410,6 +410,8 @@ def configure_link_flags_abi_library(self):
self.cxx.link_flags += [abs_path]
else:
self.cxx.link_flags += ['-lc++abi']
+ elif cxx_abi == 'system-libcxxabi':
+ self.cxx.link_flags += ['-lc++abi']
elif cxx_abi == 'libcxxrt':
self.cxx.link_flags += ['-lcxxrt']
elif cxx_abi == 'vcruntime':
More information about the llvm-branch-commits
mailing list