Skip to content

Commit 0e628a7

Browse files
committed
[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
1 parent a650bb5 commit 0e628a7

10 files changed

+11160
-4
lines changed

libcxx/lib/abi/CMakeLists.txt

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# Right now, this is done by using the ABI identifier as the filename containing
88
# the list of symbols exported by libc++ for that configuration, however we could
99
# make it more sophisticated if the number of ABI-affecting parameters grew.
10-
function(cxx_abi_list_identifier result triple abi_library abi_version unstable exceptions new_delete_in_libcxx)
10+
function(cxx_abi_list_identifier result triple abi_library abi_version unstable exceptions new_delete_in_libcxx debug_mode_enabled allow_incomplete)
1111
set(abi_properties)
1212

1313
if ("${triple}" MATCHES "darwin")
@@ -31,9 +31,19 @@ function(cxx_abi_list_identifier result triple abi_library abi_version unstable
3131
list(APPEND abi_properties "noexceptions")
3232
endif()
3333
if (${new_delete_in_libcxx})
34-
list(APPEND abi_properties "new_in_libcxx")
34+
list(APPEND abi_properties "new")
3535
else()
36-
list(APPEND abi_properties "no_new_in_libcxx")
36+
list(APPEND abi_properties "nonew")
37+
endif()
38+
if (${debug_mode_enabled})
39+
list(APPEND abi_properties "debug")
40+
else()
41+
list(APPEND abi_properties "nodebug")
42+
endif()
43+
if (${allow_incomplete})
44+
list(APPEND abi_properties "incomplete")
45+
else()
46+
list(APPEND abi_properties "noincomplete")
3747
endif()
3848

3949
list(JOIN abi_properties "." tmp)
@@ -47,6 +57,8 @@ cxx_abi_list_identifier(abi_list_identifier
4757
"${LIBCXX_ABI_UNSTABLE}"
4858
"${LIBCXX_ENABLE_EXCEPTIONS}"
4959
"${LIBCXX_ENABLE_NEW_DELETE_DEFINITIONS}"
60+
"${LIBCXX_ENABLE_DEBUG_MODE_SUPPORT}"
61+
"${LIBCXX_ENABLE_INCOMPLETE_FEATURES}"
5062
)
5163

5264
if (TARGET cxx_shared)

libcxx/lib/abi/arm64-apple-darwin.libcxxabi.v1.stable.exceptions.nonew.nodebug.noincomplete.abilist

Lines changed: 2514 additions & 0 deletions
Large diffs are not rendered by default.

libcxx/lib/abi/x86_64-apple-darwin.libcxxabi.v1.stable.exceptions.nonew.nodebug.noincomplete.abilist

Lines changed: 2544 additions & 0 deletions
Large diffs are not rendered by default.

libcxx/lib/abi/x86_64-unknown-linux-gnu.libcxxabi.v1.stable.exceptions.nonew.debug.noincomplete.abilist

Lines changed: 2044 additions & 0 deletions
Large diffs are not rendered by default.

libcxx/lib/abi/x86_64-unknown-linux-gnu.libcxxabi.v1.stable.exceptions.nonew.nodebug.incomplete.abilist

Lines changed: 2014 additions & 0 deletions
Large diffs are not rendered by default.

libcxx/lib/abi/x86_64-unknown-linux-gnu.libcxxabi.v1.stable.noexceptions.nonew.debug.incomplete.abilist

Lines changed: 2022 additions & 0 deletions
Large diffs are not rendered by default.

libcxx/utils/ci/run-buildbot

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,13 +259,15 @@ generic-noexceptions)
259259
-DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
260260
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
261261
check-runtimes
262+
check-abi-list
262263
;;
263264
generic-modules)
264265
clean
265266
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-modules.cmake" \
266267
-DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
267268
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
268269
check-runtimes
270+
check-abi-list
269271
;;
270272
generic-static)
271273
clean
@@ -281,6 +283,7 @@ generic-clang-12)
281283
generate-cmake -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
282284
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
283285
check-runtimes
286+
check-abi-list
284287
;;
285288
generic-clang-13)
286289
export CC=clang-13
@@ -289,6 +292,7 @@ generic-clang-13)
289292
generate-cmake -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
290293
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
291294
check-runtimes
295+
check-abi-list
292296
;;
293297
generic-gcc)
294298
export CC=gcc-11
@@ -357,6 +361,7 @@ generic-no-debug)
357361
-DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
358362
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
359363
check-runtimes
364+
check-abi-list
360365
;;
361366
generic-no-filesystem)
362367
clean
@@ -399,6 +404,7 @@ generic-no-experimental)
399404
-DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
400405
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
401406
check-runtimes
407+
check-abi-list
402408
;;
403409
generic-abi-unstable)
404410
clean
@@ -423,7 +429,7 @@ apple-system)
423429
--version "999.99"
424430

425431
# TODO: It would be better to run the tests against the fake-installed version of libc++ instead
426-
xcrun --sdk macosx ninja -vC "${BUILD_DIR}/${arch}" check-cxx check-cxxabi
432+
xcrun --sdk macosx ninja -vC "${BUILD_DIR}/${arch}" check-cxx check-cxxabi check-cxx-abilist
427433
;;
428434
apple-system-backdeployment-*)
429435
clean

0 commit comments

Comments
 (0)