[libcxx-commits] [libcxx] ba4f1e4 - [libcxx] Add an explicit option to build against system-libcxxabi
Louis Dionne via libcxx-commits
libcxx-commits at lists.llvm.org
Tue Mar 1 10:45:29 PST 2022
Author: Michał Górny
Date: 2022-03-01T13:44:56-05:00
New Revision: ba4f1e44e480d661d99973007a39dc642f5d79a4
URL: https://github.com/llvm/llvm-project/commit/ba4f1e44e480d661d99973007a39dc642f5d79a4
DIFF: https://github.com/llvm/llvm-project/commit/ba4f1e44e480d661d99973007a39dc642f5d79a4.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
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 aa26a22488f91..0dd278e43708b 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 ef4e07c6fcfeb..b2f399bd26800 100644
--- a/libcxx/utils/libcxx/test/config.py
+++ b/libcxx/utils/libcxx/test/config.py
@@ -406,6 +406,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 libcxx-commits
mailing list