diff --git a/libcxx/utils/ci/run-buildbot b/libcxx/utils/ci/run-buildbot index e664ac8173bcf4..23708e680893fa 100755 --- a/libcxx/utils/ci/run-buildbot +++ b/libcxx/utils/ci/run-buildbot @@ -193,78 +193,67 @@ check-generated-output) ;; generic-cxx03) clean - generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx03.cmake" \ - -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in" + generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx03.cmake" check-runtimes check-abi-list ;; generic-cxx11) clean - generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx11.cmake" \ - -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in" + generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx11.cmake" check-runtimes check-abi-list ;; generic-cxx14) clean - generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx14.cmake" \ - -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in" + generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx14.cmake" check-runtimes check-abi-list ;; generic-cxx17) clean - generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx17.cmake" \ - -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in" + generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx17.cmake" check-runtimes check-abi-list ;; generic-cxx20) clean - generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx20.cmake" \ - -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in" + generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx20.cmake" check-runtimes check-abi-list ;; generic-cxx2b) clean - generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx2b.cmake" \ - -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in" + generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx2b.cmake" check-runtimes check-abi-list ;; generic-assertions) clean - generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-assertions.cmake" \ - -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in" + generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-assertions.cmake" check-runtimes check-abi-list ;; generic-debug-iterators) clean - generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-debug-iterators.cmake" \ - -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in" + generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-debug-iterators.cmake" check-runtimes check-abi-list ;; generic-noexceptions) clean - generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-noexceptions.cmake" \ - -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in" + generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-noexceptions.cmake" check-runtimes check-abi-list ;; generic-modules) clean - generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-modules.cmake" \ - -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in" + generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-modules.cmake" check-runtimes check-abi-list ;; generic-static) clean - generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-static.cmake" \ - -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-static.cfg.in" + generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-static.cmake" check-runtimes ;; generic-merged) @@ -279,7 +268,7 @@ generic-clang-13) export CC=clang-13 export CXX=clang++-13 clean - generate-cmake -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in" + generate-cmake check-runtimes check-abi-list ;; @@ -287,7 +276,7 @@ generic-clang-14) export CC=clang-14 export CXX=clang++-14 clean - generate-cmake -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in" + generate-cmake check-runtimes check-abi-list ;; @@ -295,8 +284,7 @@ generic-gcc) export CC=gcc-11 export CXX=g++-11 clean - generate-cmake -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in" \ - -DLIBCXX_ENABLE_WERROR=NO \ + generate-cmake -DLIBCXX_ENABLE_WERROR=NO \ -DLIBCXXABI_ENABLE_WERROR=NO \ -DLIBUNWIND_ENABLE_WERROR=NO check-runtimes @@ -306,7 +294,6 @@ generic-gcc-cxx11) export CXX=g++-11 clean generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx11.cmake" \ - -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in" \ -DLIBCXX_ENABLE_WERROR=NO \ -DLIBCXXABI_ENABLE_WERROR=NO \ -DLIBUNWIND_ENABLE_WERROR=NO @@ -314,88 +301,74 @@ generic-gcc-cxx11) ;; generic-asan) clean - generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-asan.cmake" \ - -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in" + generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-asan.cmake" check-runtimes ;; generic-msan) clean - generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-msan.cmake" \ - -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in" + generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-msan.cmake" check-runtimes ;; generic-tsan) clean - generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-tsan.cmake" \ - -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in" + generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-tsan.cmake" check-runtimes ;; generic-ubsan) clean - generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-ubsan.cmake" \ - -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in" + generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-ubsan.cmake" check-runtimes ;; generic-with_llvm_unwinder) clean - generate-cmake -DLIBCXXABI_USE_LLVM_UNWINDER=ON \ - -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in" + generate-cmake -DLIBCXXABI_USE_LLVM_UNWINDER=ON check-runtimes ;; generic-no-threads) clean - generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-threads.cmake" \ - -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in" + generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-threads.cmake" check-runtimes ;; generic-no-debug) clean - generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-debug.cmake" \ - -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in" + generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-debug.cmake" check-runtimes check-abi-list ;; generic-no-filesystem) clean - generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-filesystem.cmake" \ - -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in" + generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-filesystem.cmake" check-runtimes ;; generic-no-random_device) clean - generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-random_device.cmake" \ - -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in" + generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-random_device.cmake" check-runtimes ;; generic-no-localization) clean - generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-localization.cmake" \ - -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in" + generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-localization.cmake" check-runtimes ;; generic-no-unicode) clean - generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-unicode.cmake" \ - -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in" + generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-unicode.cmake" check-runtimes ;; generic-no-wide-characters) clean - generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-wide-characters.cmake" \ - -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in" + generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-wide-characters.cmake" check-runtimes ;; generic-no-experimental) clean - generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-experimental.cmake" \ - -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in" + generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-experimental.cmake" check-runtimes check-abi-list ;; generic-abi-unstable) clean - generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-abi-unstable.cmake" \ - -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in" + generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-abi-unstable.cmake" check-runtimes ;; apple-system) @@ -427,10 +400,13 @@ apple-system-backdeployment-*) DEPLOYMENT_TARGET="${BUILDER#apple-system-backdeployment-}" - # TODO: On Apple platforms, we never produce libc++abi.1.dylib, always libc++abi.dylib. - # Fix that in the build so that the tests stop searching for @rpath/libc++abi.1.dylib. + # TODO: On Apple platforms, we never produce libc++abi.1.dylib or libunwind.1.dylib, + # only libc++abi.dylib and libunwind.dylib. Fix that in the build so that the + # tests stop searching for @rpath/libc++abi.1.dylib and @rpath/libunwind.1.dylib. cp "${OSX_ROOTS}/macOS/libc++abi/${DEPLOYMENT_TARGET}/libc++abi.dylib" \ "${OSX_ROOTS}/macOS/libc++abi/${DEPLOYMENT_TARGET}/libc++abi.1.dylib" + cp "${OSX_ROOTS}/macOS/libunwind/${DEPLOYMENT_TARGET}/libunwind.dylib" \ + "${OSX_ROOTS}/macOS/libunwind/${DEPLOYMENT_TARGET}/libunwind.1.dylib" arch="$(uname -m)" PARAMS="target_triple=${arch}-apple-macosx${DEPLOYMENT_TARGET}" @@ -439,18 +415,19 @@ apple-system-backdeployment-*) PARAMS+=";unwind_runtime_root=${OSX_ROOTS}/macOS/libunwind/${DEPLOYMENT_TARGET}" PARAMS+=";use_system_cxx_lib=True" - # TODO: We should run the libunwind tests using the back-deployment dylibs too. generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Apple.cmake" \ -DLIBCXX_TEST_CONFIG="apple-libc++-backdeployment.cfg.in" \ -DLIBCXXABI_TEST_CONFIG="apple-libc++abi-backdeployment.cfg.in" \ + -DLIBUNWIND_TEST_CONFIG="apple-libunwind-backdeployment.cfg.in" \ -DLIBCXX_TEST_PARAMS="${PARAMS}" \ - -DLIBCXXABI_TEST_PARAMS="${PARAMS}" + -DLIBCXXABI_TEST_PARAMS="${PARAMS}" \ + -DLIBUNWIND_TEST_PARAMS="${PARAMS}" check-runtimes ;; benchmarks) clean - generate-cmake -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in" + generate-cmake check-cxx-benchmarks ;; documentation) @@ -475,8 +452,7 @@ bootstrapping-build) -DLLVM_RUNTIME_TARGETS="$(c++ --print-target-triple)" \ -DLLVM_TARGETS_TO_BUILD="host" \ -DRUNTIMES_BUILD_ALLOW_DARWIN=ON \ - -DLLVM_ENABLE_ASSERTIONS=ON \ - -DRUNTIMES_LIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in" + -DLLVM_ENABLE_ASSERTIONS=ON echo "+++ Running the libc++ and libc++abi tests" ${NINJA} -C "${BUILD_DIR}" check-runtimes @@ -506,42 +482,36 @@ legacy-project-build) ;; aarch64) clean - generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/AArch64.cmake" \ - -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in" + generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/AArch64.cmake" check-runtimes ;; aarch64-noexceptions) clean generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/AArch64.cmake" \ -DLIBCXX_ENABLE_EXCEPTIONS=OFF \ - -DLIBCXXABI_ENABLE_EXCEPTIONS=OFF \ - -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in" + -DLIBCXXABI_ENABLE_EXCEPTIONS=OFF check-runtimes ;; # Aka Armv8 32 bit armv8) clean - generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Armv8Arm.cmake" \ - -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in" + generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Armv8Arm.cmake" check-runtimes ;; armv8-noexceptions) clean - generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Armv8Thumb-noexceptions.cmake" \ - -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in" + generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Armv8Thumb-noexceptions.cmake" check-runtimes ;; # Armv7 32 bit. One building Arm only one Thumb only code. armv7) clean - generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Armv7Arm.cmake" \ - -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in" + generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Armv7Arm.cmake" check-runtimes ;; armv7-noexceptions) clean - generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Armv7Thumb-noexceptions.cmake" \ - -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in" + generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Armv7Thumb-noexceptions.cmake" check-runtimes ;; clang-cl-dll) diff --git a/libunwind/test/configs/apple-libunwind-backdeployment.cfg.in b/libunwind/test/configs/apple-libunwind-backdeployment.cfg.in new file mode 100644 index 00000000000000..d4777e2f6917a7 --- /dev/null +++ b/libunwind/test/configs/apple-libunwind-backdeployment.cfg.in @@ -0,0 +1,64 @@ +# Testing configuration for back-deployment against older Apple system libunwind. +# +# Under this configuration, we compile and link all the test suite against the latest libunwind, +# however we run against the libunwind on a different platform. This emulates the workflow of +# a developer building their application using recent tools but with the goal of deploying +# on existing devices running an older OS (and hence an older dylib). + +import os, site +site.addsitedir(os.path.join('@LIBUNWIND_LIBCXX_PATH@', 'utils')) +import libcxx.test.params, libcxx.test.newconfig, libcxx.test.dsl + +lit_config.load_config(config, '@CMAKE_CURRENT_BINARY_DIR@/cmake-bridge.cfg') + +BACKDEPLOYMENT_PARAMETERS = [ + libcxx.test.dsl.Parameter(name='cxx_runtime_root', type=str, + actions=lambda root: [libcxx.test.dsl.AddSubstitution('%{cxx-runtime-root}', root)], + help=""" + The simulated root of the system (for libc++) when running tests. + + This should be a directory hierarchy under which the libc++ dylib can be found. + The dylib in that hierarchy is the one that will be used at runtime when running + the tests. + """), + libcxx.test.dsl.Parameter(name='abi_runtime_root', type=str, + actions=lambda root: [libcxx.test.dsl.AddSubstitution('%{abi-runtime-root}', root)], + help=""" + The simulated root of the system (for libc++abi) when running tests. + + This should be a directory hierarchy under which the libc++abi dylib can be found. + The dylib in that hierarchy is the one that will be used at runtime when running + the tests. + """), + libcxx.test.dsl.Parameter(name='unwind_runtime_root', type=str, + actions=lambda root: [libcxx.test.dsl.AddSubstitution('%{unwind-runtime-root}', root)], + help=""" + The simulated root of the system (for libunwind) when running tests. + + This should be a directory hierarchy under which the libunwind dylib can be found. + The dylib in that hierarchy is the one that will be used at runtime when running + the tests. + """), +] + +config.substitutions.append(('%{flags}', + '-isysroot {}'.format('@CMAKE_OSX_SYSROOT@') if '@CMAKE_OSX_SYSROOT@' else '' +)) +config.substitutions.append(('%{compile_flags}', + '-nostdinc++ -I %{include}' +)) +config.substitutions.append(('%{link_flags}', + '-nostdlib++ -L %{lib} -lc++ -lc++abi -lunwind' +)) +config.substitutions.append(('%{exec}', + '%{executor} --execdir %T --env DYLD_LIBRARY_PATH="%{cxx-runtime-root}:%{abi-runtime-root}:%{unwind-runtime-root}" -- ' +)) + +import os, site +import libcxx.test.params, libcxx.test.newconfig, libcxx.test.newconfig +libcxx.test.newconfig.configure( + libcxx.test.params.DEFAULT_PARAMETERS + BACKDEPLOYMENT_PARAMETERS, + libcxx.test.features.DEFAULT_FEATURES, + config, + lit_config +) diff --git a/libunwind/test/libunwind_01.pass.cpp b/libunwind/test/libunwind_01.pass.cpp index 8b4825ac30dca8..bbfaffd153cc28 100644 --- a/libunwind/test/libunwind_01.pass.cpp +++ b/libunwind/test/libunwind_01.pass.cpp @@ -7,8 +7,8 @@ // //===----------------------------------------------------------------------===// -// TODO: Investigate these failures on x86_64 macOS back deployment -// UNSUPPORTED: target=x86_64-apple-darwin{{.+}} +// TODO: Investigate this failure on x86_64 macOS back deployment +// XFAIL: use_system_cxx_lib && target=x86_64-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0|12.0}} // TODO: Figure out why this fails with Memory Sanitizer. // XFAIL: msan diff --git a/libunwind/test/signal_frame.pass.cpp b/libunwind/test/signal_frame.pass.cpp index d9fb439cd1e7f4..b17804efa08c8e 100644 --- a/libunwind/test/signal_frame.pass.cpp +++ b/libunwind/test/signal_frame.pass.cpp @@ -9,8 +9,8 @@ // Ensure that functions marked as signal frames are reported as such. -// TODO: Investigate this failure on macOS -// XFAIL: target={{.+}}-apple-darwin{{.+}} +// TODO: Investigate this failure on Apple +// XFAIL: target={{.+}}-apple-{{.+}} // TODO: Figure out why this fails with Memory Sanitizer. // XFAIL: msan