[libc++] Take more knobs into account when generating ABI lists

This change will make it possible to track exported symbols in more
configurations, notably the Apple system one, where we disable incomplete
features and the debug mode. Also, as a fly-by fix, shorten the name for
whether new is in libc++ or not.

Differential Revision: https://reviews.llvm.org/D119764
This commit is contained in:
Louis Dionne 2022-02-14 14:39:17 -05:00
parent a650bb58c0
commit 0e628a783b
10 changed files with 11160 additions and 4 deletions

View file

@ -7,7 +7,7 @@
# Right now, this is done by using the ABI identifier as the filename containing
# the list of symbols exported by libc++ for that configuration, however we could
# make it more sophisticated if the number of ABI-affecting parameters grew.
function(cxx_abi_list_identifier result triple abi_library abi_version unstable exceptions new_delete_in_libcxx)
function(cxx_abi_list_identifier result triple abi_library abi_version unstable exceptions new_delete_in_libcxx debug_mode_enabled allow_incomplete)
set(abi_properties)
if ("${triple}" MATCHES "darwin")
@ -31,9 +31,19 @@ function(cxx_abi_list_identifier result triple abi_library abi_version unstable
list(APPEND abi_properties "noexceptions")
endif()
if (${new_delete_in_libcxx})
list(APPEND abi_properties "new_in_libcxx")
list(APPEND abi_properties "new")
else()
list(APPEND abi_properties "no_new_in_libcxx")
list(APPEND abi_properties "nonew")
endif()
if (${debug_mode_enabled})
list(APPEND abi_properties "debug")
else()
list(APPEND abi_properties "nodebug")
endif()
if (${allow_incomplete})
list(APPEND abi_properties "incomplete")
else()
list(APPEND abi_properties "noincomplete")
endif()
list(JOIN abi_properties "." tmp)
@ -47,6 +57,8 @@ cxx_abi_list_identifier(abi_list_identifier
"${LIBCXX_ABI_UNSTABLE}"
"${LIBCXX_ENABLE_EXCEPTIONS}"
"${LIBCXX_ENABLE_NEW_DELETE_DEFINITIONS}"
"${LIBCXX_ENABLE_DEBUG_MODE_SUPPORT}"
"${LIBCXX_ENABLE_INCOMPLETE_FEATURES}"
)
if (TARGET cxx_shared)

View file

@ -259,6 +259,7 @@ generic-noexceptions)
-DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
check-runtimes
check-abi-list
;;
generic-modules)
clean
@ -266,6 +267,7 @@ generic-modules)
-DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
check-runtimes
check-abi-list
;;
generic-static)
clean
@ -281,6 +283,7 @@ generic-clang-12)
generate-cmake -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
check-runtimes
check-abi-list
;;
generic-clang-13)
export CC=clang-13
@ -289,6 +292,7 @@ generic-clang-13)
generate-cmake -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
check-runtimes
check-abi-list
;;
generic-gcc)
export CC=gcc-11
@ -357,6 +361,7 @@ generic-no-debug)
-DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
check-runtimes
check-abi-list
;;
generic-no-filesystem)
clean
@ -399,6 +404,7 @@ generic-no-experimental)
-DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
check-runtimes
check-abi-list
;;
generic-abi-unstable)
clean
@ -423,7 +429,7 @@ apple-system)
--version "999.99"
# TODO: It would be better to run the tests against the fake-installed version of libc++ instead
xcrun --sdk macosx ninja -vC "${BUILD_DIR}/${arch}" check-cxx check-cxxabi
xcrun --sdk macosx ninja -vC "${BUILD_DIR}/${arch}" check-cxx check-cxxabi check-cxx-abilist
;;
apple-system-backdeployment-*)
clean