diff --git a/libcxx/CMakeLists.txt b/libcxx/CMakeLists.txt --- a/libcxx/CMakeLists.txt +++ b/libcxx/CMakeLists.txt @@ -137,12 +137,31 @@ are new library features under development. These features don't guarantee ABI stability nor the quality of completed library features. Vendors shipping the library may want to disable this option." ON) -set(LIBCXX_TEST_CONFIG "legacy.cfg.in" CACHE STRING + +if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + set(LIBCXX_DEFAULT_TEST_CONFIG "llvm-libc++-shared-gcc.cfg.in") +elseif(MINGW) + set(LIBCXX_DEFAULT_TEST_CONFIG "llvm-libc++-mingw.cfg.in") +elseif(WIN32) # clang-cl + if (LIBCXX_ENABLE_SHARED) + set(LIBCXX_DEFAULT_TEST_CONFIG "llvm-libc++-shared-clangcl.cfg.in") + else() + set(LIBCXX_DEFAULT_TEST_CONFIG "llvm-libc++-static-clangcl.cfg.in") + endif() +else() + if (LIBCXX_ENABLE_SHARED) + set(LIBCXX_DEFAULT_TEST_CONFIG "llvm-libc++-shared.cfg.in") + else() + set(LIBCXX_DEFAULT_TEST_CONFIG "llvm-libc++-static.cfg.in") + endif() +endif() +set(LIBCXX_TEST_CONFIG "${LIBCXX_DEFAULT_TEST_CONFIG}" CACHE STRING "The path to the Lit testing configuration to use when running the tests. If a relative path is provided, it is assumed to be relative to '/libcxx/test/configs'.") if (NOT IS_ABSOLUTE "${LIBCXX_TEST_CONFIG}") set(LIBCXX_TEST_CONFIG "${CMAKE_CURRENT_SOURCE_DIR}/test/configs/${LIBCXX_TEST_CONFIG}") endif() +message(STATUS "Using libc++ testing configuration: ${LIBCXX_TEST_CONFIG}") set(LIBCXX_TEST_PARAMS "" CACHE STRING "A list of parameters to run the Lit test suite with.") diff --git a/libcxx/docs/ReleaseNotes.rst b/libcxx/docs/ReleaseNotes.rst --- a/libcxx/docs/ReleaseNotes.rst +++ b/libcxx/docs/ReleaseNotes.rst @@ -98,3 +98,9 @@ library should set ``LIBCXXABI_HERMETIC_STATIC_LIBRARY=ON`` when configuring CMake. The current behavior, which tries to guess the correct dll-export semantics based on whether we're building the libc++ shared library, will be removed in LLVM 16. + +- The legacy testing configuration is now deprecated and will be removed in the next release. For + most users, this should not have any impact. However, if you are testing libc++ in a configuration + or on a platform that used to be supported by the legacy testing configuration and isn't supported + by one of the configurations in ``libcxx/test/configs``, please reach out to the libc++ developers + to get your configuration supported officially. diff --git a/libcxx/utils/ci/run-buildbot b/libcxx/utils/ci/run-buildbot --- a/libcxx/utils/ci/run-buildbot +++ b/libcxx/utils/ci/run-buildbot @@ -192,7 +192,6 @@ generic-cxx03) clean generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx03.cmake" \ - -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \ -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in" check-runtimes check-abi-list @@ -200,7 +199,6 @@ generic-cxx11) clean generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx11.cmake" \ - -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \ -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in" check-runtimes check-abi-list @@ -208,7 +206,6 @@ generic-cxx14) clean generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx14.cmake" \ - -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \ -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in" check-runtimes check-abi-list @@ -216,7 +213,6 @@ generic-cxx17) clean generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx17.cmake" \ - -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \ -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in" check-runtimes check-abi-list @@ -224,7 +220,6 @@ generic-cxx20) clean generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx20.cmake" \ - -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \ -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in" check-runtimes check-abi-list @@ -232,7 +227,6 @@ generic-cxx2b) clean generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx2b.cmake" \ - -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \ -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in" check-runtimes check-abi-list @@ -240,7 +234,6 @@ generic-assertions) clean generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-assertions.cmake" \ - -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \ -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in" check-runtimes check-abi-list @@ -248,7 +241,6 @@ generic-debug-iterators) clean generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-debug-iterators.cmake" \ - -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \ -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in" check-runtimes check-abi-list @@ -256,7 +248,6 @@ generic-noexceptions) clean generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-noexceptions.cmake" \ - -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \ -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in" check-runtimes check-abi-list @@ -264,7 +255,6 @@ generic-modules) clean generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-modules.cmake" \ - -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \ -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in" check-runtimes check-abi-list @@ -272,7 +262,6 @@ generic-static) clean generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-static.cmake" \ - -DLIBCXX_TEST_CONFIG="llvm-libc++-static.cfg.in" \ -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-static.cfg.in" check-runtimes ;; @@ -280,8 +269,7 @@ export CC=clang-13 export CXX=clang++-13 clean - generate-cmake -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \ - -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in" + generate-cmake -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in" check-runtimes check-abi-list ;; @@ -289,8 +277,7 @@ export CC=clang-14 export CXX=clang++-14 clean - generate-cmake -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \ - -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in" + generate-cmake -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in" check-runtimes check-abi-list ;; @@ -298,8 +285,7 @@ export CC=gcc-11 export CXX=g++-11 clean - generate-cmake -DLIBCXX_TEST_CONFIG="llvm-libc++-shared-gcc.cfg.in" \ - -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in" \ + generate-cmake -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in" \ -DLIBCXX_ENABLE_WERROR=NO check-runtimes ;; @@ -308,7 +294,6 @@ export CXX=g++-11 clean generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx11.cmake" \ - -DLIBCXX_TEST_CONFIG="llvm-libc++-shared-gcc.cfg.in" \ -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in" \ -DLIBCXX_ENABLE_WERROR=NO check-runtimes @@ -316,49 +301,42 @@ generic-asan) clean generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-asan.cmake" \ - -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \ -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in" check-runtimes ;; generic-msan) clean generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-msan.cmake" \ - -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \ -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in" check-runtimes ;; generic-tsan) clean generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-tsan.cmake" \ - -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \ -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in" check-runtimes ;; generic-ubsan) clean generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-ubsan.cmake" \ - -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \ -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in" check-runtimes ;; generic-with_llvm_unwinder) clean generate-cmake -DLIBCXXABI_USE_LLVM_UNWINDER=ON \ - -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \ -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in" check-runtimes ;; generic-singlethreaded) clean generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-singlethreaded.cmake" \ - -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \ -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in" check-runtimes ;; generic-no-debug) clean generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-debug.cmake" \ - -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \ -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in" check-runtimes check-abi-list @@ -366,42 +344,36 @@ generic-no-filesystem) clean generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-filesystem.cmake" \ - -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \ -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in" check-runtimes ;; generic-no-random_device) clean generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-random_device.cmake" \ - -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \ -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in" check-runtimes ;; generic-no-localization) clean generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-localization.cmake" \ - -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \ -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in" check-runtimes ;; generic-no-unicode) clean generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-unicode.cmake" \ - -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \ -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in" check-runtimes ;; generic-no-wide-characters) clean generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-wide-characters.cmake" \ - -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \ -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in" check-runtimes ;; generic-no-experimental) clean generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-experimental.cmake" \ - -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \ -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in" check-runtimes check-abi-list @@ -409,7 +381,6 @@ generic-abi-unstable) clean generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-abi-unstable.cmake" \ - -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \ -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in" check-runtimes ;; @@ -465,8 +436,7 @@ ;; benchmarks) clean - generate-cmake -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \ - -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in" + generate-cmake -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in" check-cxx-benchmarks ;; documentation) @@ -497,7 +467,6 @@ -DRUNTIMES_BUILD_ALLOW_DARWIN=ON \ -DLLVM_ENABLE_ASSERTIONS=ON \ -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-modules.cmake" \ - -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \ -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in" echo "+++ Running the libc++ and libc++abi tests" @@ -529,7 +498,6 @@ aarch64) clean generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/AArch64.cmake" \ - -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \ -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in" check-runtimes ;; @@ -538,7 +506,6 @@ generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/AArch64.cmake" \ -DLIBCXX_ENABLE_EXCEPTIONS=OFF \ -DLIBCXXABI_ENABLE_EXCEPTIONS=OFF \ - -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \ -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in" check-runtimes ;; @@ -546,14 +513,12 @@ armv8) clean generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Armv8Arm.cmake" \ - -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \ -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in" check-runtimes ;; armv8-noexceptions) clean generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Armv8Thumb-noexceptions.cmake" \ - -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \ -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in" check-runtimes ;; @@ -561,14 +526,12 @@ armv7) clean generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Armv7Arm.cmake" \ - -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \ -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in" check-runtimes ;; armv7-noexceptions) clean generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Armv7Thumb-noexceptions.cmake" \ - -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \ -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in" check-runtimes ;; @@ -580,15 +543,13 @@ # correctly when libc++ visibility attributes indicate dllimport linkage # anyway), thus just disable the experimental library. Remove this # setting when cmake and the test driver does the right thing automatically. - generate-cmake-libcxx-win -DLIBCXX_ENABLE_EXPERIMENTAL_LIBRARY=OFF \ - -DLIBCXX_TEST_CONFIG="llvm-libc++-shared-clangcl.cfg.in" + generate-cmake-libcxx-win -DLIBCXX_ENABLE_EXPERIMENTAL_LIBRARY=OFF echo "+++ Running the libc++ tests" ${NINJA} -vC "${BUILD_DIR}" check-cxx ;; clang-cl-static) clean - generate-cmake-libcxx-win -DLIBCXX_ENABLE_SHARED=OFF \ - -DLIBCXX_TEST_CONFIG="llvm-libc++-static-clangcl.cfg.in" + generate-cmake-libcxx-win -DLIBCXX_ENABLE_SHARED=OFF echo "+++ Running the libc++ tests" ${NINJA} -vC "${BUILD_DIR}" check-cxx ;; @@ -602,7 +563,6 @@ generate-cmake \ -DCMAKE_C_COMPILER=x86_64-w64-mingw32-clang \ -DCMAKE_CXX_COMPILER=x86_64-w64-mingw32-clang++ \ - -DLIBCXX_TEST_CONFIG="llvm-libc++-mingw.cfg.in" \ -C "${MONOREPO_ROOT}/libcxx/cmake/caches/MinGW.cmake" echo "+++ Running the libc++ tests" ${NINJA} -vC "${BUILD_DIR}" check-cxx @@ -612,7 +572,6 @@ generate-cmake \ -DCMAKE_C_COMPILER=x86_64-w64-mingw32-clang \ -DCMAKE_CXX_COMPILER=x86_64-w64-mingw32-clang++ \ - -DLIBCXX_TEST_CONFIG="llvm-libc++-mingw.cfg.in" \ -C "${MONOREPO_ROOT}/libcxx/cmake/caches/MinGW.cmake" \ -DLIBCXX_ENABLE_SHARED=OFF \ -DLIBUNWIND_ENABLE_SHARED=OFF