diff --git a/CMakeLists.txt b/CMakeLists.txt index 3ba0c881..d93db5af 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -259,19 +259,17 @@ read_repo_version(${LLVM_TOOLCHAIN_C_LIBRARY} ${LLVM_TOOLCHAIN_C_LIBRARY}) set( llvm_project_patches ${CMAKE_CURRENT_SOURCE_DIR}/patches/llvm-project/0001-Add-ExclusiveGroup-feature-to-multilib.yaml.patch - ${CMAKE_CURRENT_SOURCE_DIR}/patches/llvm-project/0002-Add-check-for-building-with-picolibc.patch - ${CMAKE_CURRENT_SOURCE_DIR}/patches/llvm-project/0003-Run-picolibc-tests-with-qemu.patch - ${CMAKE_CURRENT_SOURCE_DIR}/patches/llvm-project/0004-xfail-two-remaining-libcxx-with-picolibc-tests.patch - ${CMAKE_CURRENT_SOURCE_DIR}/patches/llvm-project/0005-disable-large-tests.patch - ${CMAKE_CURRENT_SOURCE_DIR}/patches/llvm-project/0006-Disable-failing-compiler-rt-test.patch - ${CMAKE_CURRENT_SOURCE_DIR}/patches/llvm-project/0007-libc-tests-with-picolibc-handle-stdin.patch - ${CMAKE_CURRENT_SOURCE_DIR}/patches/llvm-project/0008-libc-tests-with-picolibc-add-has-compolete-fenv-feat.patch - ${CMAKE_CURRENT_SOURCE_DIR}/patches/llvm-project/0009-libc-tests-with-picolibc-Fix-expected-error-message.patch - ${CMAKE_CURRENT_SOURCE_DIR}/patches/llvm-project/0010-libc-tests-with-picolibc-Fix-iterator-diff_type-to-s.patch - ${CMAKE_CURRENT_SOURCE_DIR}/patches/llvm-project/0011-libc-tests-with-picolibc-mark-sort-test-as-long-one.patch - ${CMAKE_CURRENT_SOURCE_DIR}/patches/llvm-project/0012-libc-tests-with-picolibc-XFAIL-uses-of-atomics.patch - ${CMAKE_CURRENT_SOURCE_DIR}/patches/llvm-project/0013-libc-tests-with-picolibc-mark-two-more-large-tests.patch - ${CMAKE_CURRENT_SOURCE_DIR}/patches/llvm-project/0014-libc-tests-with-picolibc-xfail-test-missing-rt-libra.patch + ${CMAKE_CURRENT_SOURCE_DIR}/patches/llvm-project/0002-xfail-two-remaining-libcxx-with-picolibc-tests.patch + ${CMAKE_CURRENT_SOURCE_DIR}/patches/llvm-project/0003-libc-tests-with-picolibc-disable-large-tests.patch + ${CMAKE_CURRENT_SOURCE_DIR}/patches/llvm-project/0004-Disable-failing-compiler-rt-test.patch + ${CMAKE_CURRENT_SOURCE_DIR}/patches/llvm-project/0005-libc-tests-with-picolibc-handle-stdin.patch + ${CMAKE_CURRENT_SOURCE_DIR}/patches/llvm-project/0006-libc-tests-with-picolibc-add-has-compolete-fenv-feat.patch + ${CMAKE_CURRENT_SOURCE_DIR}/patches/llvm-project/0007-libc-tests-with-picolibc-Fix-expected-error-message.patch + ${CMAKE_CURRENT_SOURCE_DIR}/patches/llvm-project/0008-libc-tests-with-picolibc-Fix-iterator-diff_type-to-s.patch + ${CMAKE_CURRENT_SOURCE_DIR}/patches/llvm-project/0009-libc-tests-with-picolibc-mark-sort-test-as-long-one.patch + ${CMAKE_CURRENT_SOURCE_DIR}/patches/llvm-project/0010-libc-tests-with-picolibc-XFAIL-uses-of-atomics.patch + ${CMAKE_CURRENT_SOURCE_DIR}/patches/llvm-project/0011-libc-tests-with-picolibc-mark-two-more-large-tests.patch + ${CMAKE_CURRENT_SOURCE_DIR}/patches/llvm-project/0012-libc-tests-with-picolibc-xfail-test-missing-rt-libra.patch ) FetchContent_Declare(llvmproject GIT_REPOSITORY https://github.com/llvm/llvm-project.git diff --git a/patches/llvm-project/0001-Add-ExclusiveGroup-feature-to-multilib.yaml.patch b/patches/llvm-project/0001-Add-ExclusiveGroup-feature-to-multilib.yaml.patch index 60463753..a88894ac 100644 --- a/patches/llvm-project/0001-Add-ExclusiveGroup-feature-to-multilib.yaml.patch +++ b/patches/llvm-project/0001-Add-ExclusiveGroup-feature-to-multilib.yaml.patch @@ -1,4 +1,4 @@ -From 4710a6c7f72252b503d1269b774f08ab93ce7622 Mon Sep 17 00:00:00 2001 +From c401df2e493a01d4785e3135d9bbd842ce9ceb89 Mon Sep 17 00:00:00 2001 From: Simi Pallipurath Date: Tue, 21 Nov 2023 16:20:43 +0000 Subject: Add ExclusiveGroup feature to multilib.yaml. diff --git a/patches/llvm-project/0002-Add-check-for-building-with-picolibc.patch b/patches/llvm-project/0002-Add-check-for-building-with-picolibc.patch deleted file mode 100644 index cedbab71..00000000 --- a/patches/llvm-project/0002-Add-check-for-building-with-picolibc.patch +++ /dev/null @@ -1,1229 +0,0 @@ -From ec282dbf40eb250efc81db516fbc844d061e432c Mon Sep 17 00:00:00 2001 -From: Michael Platings -Date: Fri, 29 Sep 2023 09:35:52 +0100 -Subject: Add check for building with picolibc - -This is intended to identify changes that would fail to build on -embedded platforms e.g. D152382 - -Reviewed By: philnik - -Differential Revision: https://reviews.llvm.org/D154246 ---- - libcxx/cmake/caches/Armv7M-picolibc.cmake | 38 ++++++ - libcxx/docs/index.rst | 21 ++-- - .../configs/armv7m-picolibc-libc++.cfg.in | 42 +++++++ - .../atomics.types.float/lockfree.pass.cpp | 1 + - .../test/libcxx/clang_modules_include.gen.py | 3 + - libcxx/test/libcxx/selftest/dsl/dsl.sh.py | 2 + - .../selftest/pass.cpp/run-error.pass.cpp | 1 + - .../libcxx/selftest/pass.mm/run-error.pass.mm | 1 + - .../test/libcxx/system_reserved_names.gen.py | 8 +- - .../atomics.types.float/assign.pass.cpp | 1 + - .../compare_exchange_strong.pass.cpp | 1 + - .../compare_exchange_weak.pass.cpp | 1 + - .../atomics.types.float/ctor.pass.cpp | 1 + - .../atomics.types.float/exchange.pass.cpp | 1 + - .../atomics.types.float/fetch_add.pass.cpp | 1 + - .../atomics.types.float/fetch_sub.pass.cpp | 1 + - .../atomics.types.float/load.pass.cpp | 1 + - .../atomics.types.float/lockfree.pass.cpp | 1 + - .../atomics.types.float/notify_all.pass.cpp | 1 + - .../atomics.types.float/notify_one.pass.cpp | 1 + - .../operator.float.pass.cpp | 1 + - .../operator.minus_equals.pass.cpp | 1 + - .../operator.plus_equals.pass.cpp | 1 + - .../atomics.types.float/store.pass.cpp | 1 + - .../atomics.types.float/wait.pass.cpp | 1 + - .../atomics.types.generic/integral.pass.cpp | 2 + - .../atomic_fetch_add.pass.cpp | 2 + - .../atomic_fetch_add_explicit.pass.cpp | 2 + - .../atomic_fetch_and.pass.cpp | 2 + - .../atomic_fetch_and_explicit.pass.cpp | 2 + - .../atomic_fetch_or.pass.cpp | 2 + - .../atomic_fetch_or_explicit.pass.cpp | 2 + - .../atomic_fetch_sub.pass.cpp | 2 + - .../atomic_fetch_sub_explicit.pass.cpp | 2 + - .../atomic_fetch_xor.pass.cpp | 2 + - .../atomic_fetch_xor_explicit.pass.cpp | 2 + - .../ctor.pass.cpp | 2 + - .../depr.c.headers/fenv_h.compile.pass.cpp | 3 + - .../depr.c.headers/uchar_h.compile.pass.cpp | 3 + - .../reference_assignment.pass.cpp | 3 + - .../narrow.stream.objects/cerr.sh.cpp | 2 + - .../narrow.stream.objects/clog.sh.cpp | 2 + - .../narrow.stream.objects/cout.sh.cpp | 2 + - .../cxx20_iterator_traits.compile.pass.cpp | 5 + - .../sized_delete_array14.pass.cpp | 1 + - .../new.delete.single/sized_delete14.pass.cpp | 1 + - .../ctime.timespec.compile.pass.cpp | 3 + - .../numerics/cfenv/cfenv.syn/cfenv.pass.cpp | 3 + - .../strings/c.strings/cuchar.compile.pass.cpp | 3 + - .../time.clock.file/to_from_sys.pass.cpp | 3 + - .../time.clock/time.clock.hires/now.pass.cpp | 3 + - .../time.clock.system/from_time_t.pass.cpp | 3 + - .../time.clock/time.clock.system/now.pass.cpp | 3 + - .../time.clock.system/to_time_t.pass.cpp | 3 + - .../op_-duration.pass.cpp | 3 + - libcxx/utils/ci/BOT_OWNERS.txt | 2 +- - libcxx/utils/ci/build-picolibc.sh | 111 ++++++++++++++++++ - libcxx/utils/ci/buildkite-pipeline.yml | 5 + - libcxx/utils/ci/run-buildbot | 35 ++++++ - libcxx/utils/libcxx/test/features.py | 27 ++++- - .../configs/armv7m-picolibc-libc++abi.cfg.in | 33 ++++++ - libcxxabi/test/test_demangle.pass.cpp | 3 + - .../configs/armv7m-picolibc-libunwind.cfg.in | 33 ++++++ - 63 files changed, 441 insertions(+), 14 deletions(-) - create mode 100644 libcxx/cmake/caches/Armv7M-picolibc.cmake - create mode 100644 libcxx/test/configs/armv7m-picolibc-libc++.cfg.in - create mode 100755 libcxx/utils/ci/build-picolibc.sh - create mode 100644 libcxxabi/test/configs/armv7m-picolibc-libc++abi.cfg.in - create mode 100644 libunwind/test/configs/armv7m-picolibc-libunwind.cfg.in - -diff --git a/libcxx/cmake/caches/Armv7M-picolibc.cmake b/libcxx/cmake/caches/Armv7M-picolibc.cmake -new file mode 100644 -index 000000000000..6ed1866a5084 ---- /dev/null -+++ b/libcxx/cmake/caches/Armv7M-picolibc.cmake -@@ -0,0 +1,38 @@ -+set(CMAKE_ASM_COMPILER_TARGET "armv7m-none-eabi" CACHE STRING "") -+set(CMAKE_CXX_COMPILER_TARGET "armv7m-none-eabi" CACHE STRING "") -+set(CMAKE_CXX_FLAGS "-mfloat-abi=soft" CACHE STRING "") -+set(CMAKE_C_COMPILER_TARGET "armv7m-none-eabi" CACHE STRING "") -+set(CMAKE_C_FLAGS "-mfloat-abi=soft" CACHE STRING "") -+set(CMAKE_SYSTEM_NAME Generic CACHE STRING "") -+set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY CACHE STRING "") -+set(COMPILER_RT_BAREMETAL_BUILD ON CACHE BOOL "") -+set(COMPILER_RT_BUILD_LIBFUZZER OFF CACHE BOOL "") -+set(COMPILER_RT_BUILD_PROFILE OFF CACHE BOOL "") -+set(COMPILER_RT_BUILD_SANITIZERS OFF CACHE BOOL "") -+set(COMPILER_RT_BUILD_XRAY OFF CACHE BOOL "") -+set(COMPILER_RT_DEFAULT_TARGET_ONLY ON CACHE BOOL "") -+set(LIBCXXABI_BAREMETAL ON CACHE BOOL "") -+set(LIBCXXABI_ENABLE_ASSERTIONS OFF CACHE BOOL "") -+set(LIBCXXABI_ENABLE_EXCEPTIONS OFF CACHE BOOL "") -+set(LIBCXXABI_ENABLE_SHARED OFF CACHE BOOL "") -+set(LIBCXXABI_ENABLE_STATIC ON CACHE BOOL "") -+set(LIBCXXABI_ENABLE_THREADS OFF CACHE BOOL "") -+set(LIBCXXABI_USE_COMPILER_RT ON CACHE BOOL "") -+set(LIBCXXABI_USE_LLVM_UNWINDER ON CACHE BOOL "") -+set(LIBCXX_ENABLE_EXCEPTIONS OFF CACHE BOOL "") -+set(LIBCXX_ENABLE_FILESYSTEM OFF CACHE STRING "") -+set(LIBCXX_ENABLE_MONOTONIC_CLOCK OFF CACHE BOOL "") -+set(LIBCXX_ENABLE_RANDOM_DEVICE OFF CACHE BOOL "") -+set(LIBCXX_ENABLE_RTTI OFF CACHE BOOL "") -+set(LIBCXX_ENABLE_SHARED OFF CACHE BOOL "") -+set(LIBCXX_ENABLE_STATIC ON CACHE BOOL "") -+set(LIBCXX_ENABLE_THREADS OFF CACHE BOOL "") -+set(LIBCXX_ENABLE_WIDE_CHARACTERS OFF CACHE BOOL "") -+set(LIBCXX_INCLUDE_BENCHMARKS OFF CACHE BOOL "") -+set(LIBCXX_USE_COMPILER_RT ON CACHE BOOL "") -+set(LIBUNWIND_ENABLE_SHARED OFF CACHE BOOL "") -+set(LIBUNWIND_ENABLE_STATIC ON CACHE BOOL "") -+set(LIBUNWIND_ENABLE_THREADS OFF CACHE BOOL "") -+set(LIBUNWIND_IS_BAREMETAL ON CACHE BOOL "") -+set(LIBUNWIND_REMEMBER_HEAP_ALLOC ON CACHE BOOL "") -+set(LIBUNWIND_USE_COMPILER_RT ON CACHE BOOL "") -diff --git a/libcxx/docs/index.rst b/libcxx/docs/index.rst -index c4199dc69d7c..7bb5512beb1f 100644 ---- a/libcxx/docs/index.rst -+++ b/libcxx/docs/index.rst -@@ -124,16 +124,17 @@ GCC 12 In C++11 or later only latest stable release pe - - Libc++ also supports common platforms and architectures: - --=============== ========================= ============================ --Target platform Target architecture Notes --=============== ========================= ============================ --macOS 10.13+ i386, x86_64, arm64 --FreeBSD 12+ i386, x86_64, arm --Linux i386, x86_64, arm, arm64 Only glibc-2.24 and later and no other libc is officially supported --Android 5.0+ i386, x86_64, arm, arm64 --Windows i386, x86_64 Both MSVC and MinGW style environments, ABI in MSVC environments is :doc:`unstable ` --AIX 7.2TL5+ powerpc, powerpc64 --=============== ========================= ============================ -+===================== ========================= ============================ -+Target platform Target architecture Notes -+===================== ========================= ============================ -+macOS 10.13+ i386, x86_64, arm64 -+FreeBSD 12+ i386, x86_64, arm -+Linux i386, x86_64, arm, arm64 Only glibc-2.24 and later and no other libc is officially supported -+Android 5.0+ i386, x86_64, arm, arm64 -+Windows i386, x86_64 Both MSVC and MinGW style environments, ABI in MSVC environments is :doc:`unstable ` -+AIX 7.2TL5+ powerpc, powerpc64 -+Embedded (picolibc) arm Support for building with picolibc is currently work-in-progress -+===================== ========================= ============================ - - Generally speaking, libc++ should work on any platform that provides a fairly complete - C Standard Library. It is also possible to turn off parts of the library for use on -diff --git a/libcxx/test/configs/armv7m-picolibc-libc++.cfg.in b/libcxx/test/configs/armv7m-picolibc-libc++.cfg.in -new file mode 100644 -index 000000000000..c0d23f136475 ---- /dev/null -+++ b/libcxx/test/configs/armv7m-picolibc-libc++.cfg.in -@@ -0,0 +1,42 @@ -+lit_config.load_config(config, '@CMAKE_CURRENT_BINARY_DIR@/cmake-bridge.cfg') -+ -+libc_linker_script = '@CMAKE_INSTALL_PREFIX@/lib/picolibcpp.ld' -+ -+config.substitutions.append(('%{flags}', '--sysroot=@CMAKE_INSTALL_PREFIX@')) -+ -+config.substitutions.append(('%{compile_flags}', -+ '-nostdinc++ -I %{include} -I %{target-include} -I %{libcxx}/test/support' -+ -+ # Disable warnings in cxx_atomic_impl.h: -+ # "large atomic operation may incur significant performance penalty; the -+ # access size (4 bytes) exceeds the max lock-free size (0 bytes)" -+ ' -Wno-atomic-alignment' -+ -+ # Various libc++ headers check for the definition of _NEWLIB_VERSION -+ # which for picolibc is defined in picolibc.h. -+ ' -include picolibc.h' -+)) -+config.substitutions.append(('%{link_flags}', -+ '-nostdlib -nostdlib++ -L %{lib} -lc++ -lc++abi' -+ ' -lc -lm -lclang_rt.builtins -lsemihost -lcrt0-semihost' + -+ ' -T {}'.format(libc_linker_script) + -+ ' -Wl,--defsym=__flash=0x0' -+ ' -Wl,--defsym=__flash_size=0x400000' -+ ' -Wl,--defsym=__ram=0x21000000' -+ ' -Wl,--defsym=__ram_size=0x1000000' -+ ' -Wl,--defsym=__stack_size=0x1000' -+)) -+config.substitutions.append(('%{exec}', -+ 'true' # TODO use qemu-system-arm -+)) -+config.available_features.add('libcxx-fake-executor') -+ -+import os, site -+site.addsitedir(os.path.join('@LIBCXX_SOURCE_DIR@', 'utils')) -+import libcxx.test.params, libcxx.test.config -+libcxx.test.config.configure( -+ libcxx.test.params.DEFAULT_PARAMETERS, -+ libcxx.test.features.DEFAULT_FEATURES, -+ config, -+ lit_config -+) -diff --git a/libcxx/test/libcxx/atomics/atomics.types.generic/atomics.types.float/lockfree.pass.cpp b/libcxx/test/libcxx/atomics/atomics.types.generic/atomics.types.float/lockfree.pass.cpp -index 46511530c7c7..222c6d026fc0 100644 ---- a/libcxx/test/libcxx/atomics/atomics.types.generic/atomics.types.float/lockfree.pass.cpp -+++ b/libcxx/test/libcxx/atomics/atomics.types.generic/atomics.types.float/lockfree.pass.cpp -@@ -8,6 +8,7 @@ - // UNSUPPORTED: c++03, c++11, c++14, c++17 - // UNSUPPORTED: target={{.+}}-windows-gnu - // ADDITIONAL_COMPILE_FLAGS(has-latomic): -latomic -+// XFAIL: !has-64-bit-atomics - - // static constexpr bool is_always_lock_free = implementation-defined; - // bool is_lock_free() const volatile noexcept; -diff --git a/libcxx/test/libcxx/clang_modules_include.gen.py b/libcxx/test/libcxx/clang_modules_include.gen.py -index 04c8e03affee..26ef2077449b 100644 ---- a/libcxx/test/libcxx/clang_modules_include.gen.py -+++ b/libcxx/test/libcxx/clang_modules_include.gen.py -@@ -39,6 +39,9 @@ for header in public_headers: - // TODO: Investigate this failure - // UNSUPPORTED{BLOCKLIT}: LIBCXX-FREEBSD-FIXME - -+// TODO: Investigate this failure -+// UNSUPPORTED{BLOCKLIT}: LIBCXX-PICOLIBC-FIXME -+ - {lit_header_restrictions.get(header, '')} - - #include <{header}> -diff --git a/libcxx/test/libcxx/selftest/dsl/dsl.sh.py b/libcxx/test/libcxx/selftest/dsl/dsl.sh.py -index dfe290b21fbb..6c695a0d672e 100644 ---- a/libcxx/test/libcxx/selftest/dsl/dsl.sh.py -+++ b/libcxx/test/libcxx/selftest/dsl/dsl.sh.py -@@ -6,6 +6,8 @@ - # - # ===----------------------------------------------------------------------===## - -+# XFAIL: libcxx-fake-executor -+ - # Note: We prepend arguments with 'x' to avoid thinking there are too few - # arguments in case an argument is an empty string. - # RUN: %{python} %s x%S x%T x%{substitutions} -diff --git a/libcxx/test/libcxx/selftest/pass.cpp/run-error.pass.cpp b/libcxx/test/libcxx/selftest/pass.cpp/run-error.pass.cpp -index eac7d8846e23..1df98ef11191 100644 ---- a/libcxx/test/libcxx/selftest/pass.cpp/run-error.pass.cpp -+++ b/libcxx/test/libcxx/selftest/pass.cpp/run-error.pass.cpp -@@ -6,6 +6,7 @@ - // - //===----------------------------------------------------------------------===// - -+// UNSUPPORTED: libcxx-fake-executor - // XFAIL: * - - // Make sure the test DOES NOT pass if it fails at runtime. -diff --git a/libcxx/test/libcxx/selftest/pass.mm/run-error.pass.mm b/libcxx/test/libcxx/selftest/pass.mm/run-error.pass.mm -index 22e17666eab0..02e8321c96b2 100644 ---- a/libcxx/test/libcxx/selftest/pass.mm/run-error.pass.mm -+++ b/libcxx/test/libcxx/selftest/pass.mm/run-error.pass.mm -@@ -7,6 +7,7 @@ - //===----------------------------------------------------------------------===// - - // REQUIRES: objective-c++ -+// UNSUPPORTED: libcxx-fake-executor - - // XFAIL: * - -diff --git a/libcxx/test/libcxx/system_reserved_names.gen.py b/libcxx/test/libcxx/system_reserved_names.gen.py -index e2aa8fc47348..8c4be97897f6 100644 ---- a/libcxx/test/libcxx/system_reserved_names.gen.py -+++ b/libcxx/test/libcxx/system_reserved_names.gen.py -@@ -63,7 +63,8 @@ for header in public_headers: - #endif - - // Test that libc++ doesn't use names that collide with FreeBSD system macros. --#ifndef __FreeBSD__ -+// newlib and picolibc also define these macros -+#if !defined(__FreeBSD__) && !defined(_NEWLIB_VERSION) - # define __null_sentinel SYSTEM_RESERVED_NAME - # define __generic SYSTEM_RESERVED_NAME - #endif -@@ -101,7 +102,10 @@ for header in public_headers: - # define __pre SYSTEM_RESERVED_NAME - #endif - --#define __input SYSTEM_RESERVED_NAME -+// Newlib & picolibc use __input as a parameter name of a64l & l64a -+#ifndef _NEWLIB_VERSION -+# define __input SYSTEM_RESERVED_NAME -+#endif - #define __output SYSTEM_RESERVED_NAME - - #define __acquire SYSTEM_RESERVED_NAME -diff --git a/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/assign.pass.cpp b/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/assign.pass.cpp -index 8efb556cb5d9..3bdd8ae792cf 100644 ---- a/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/assign.pass.cpp -+++ b/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/assign.pass.cpp -@@ -8,6 +8,7 @@ - // UNSUPPORTED: c++03, c++11, c++14, c++17 - // UNSUPPORTED: target={{.+}}-windows-gnu - // ADDITIONAL_COMPILE_FLAGS(has-latomic): -latomic -+// XFAIL: !has-64-bit-atomics - - // floating-point-type operator=(floating-point-type) volatile noexcept; - // floating-point-type operator=(floating-point-type) noexcept; -diff --git a/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/compare_exchange_strong.pass.cpp b/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/compare_exchange_strong.pass.cpp -index 839d79d3a411..b9e2fe40f955 100644 ---- a/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/compare_exchange_strong.pass.cpp -+++ b/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/compare_exchange_strong.pass.cpp -@@ -7,6 +7,7 @@ - //===----------------------------------------------------------------------===// - // UNSUPPORTED: c++03, c++11, c++14, c++17 - // ADDITIONAL_COMPILE_FLAGS(has-latomic): -latomic -+// XFAIL: !has-64-bit-atomics - - // bool compare_exchange_strong(T& expected, T desired, - // memory_order success, memory_order failure) volatile noexcept; -diff --git a/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/compare_exchange_weak.pass.cpp b/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/compare_exchange_weak.pass.cpp -index 097210cc4a9d..f3ac52ff28cf 100644 ---- a/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/compare_exchange_weak.pass.cpp -+++ b/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/compare_exchange_weak.pass.cpp -@@ -7,6 +7,7 @@ - //===----------------------------------------------------------------------===// - // UNSUPPORTED: c++03, c++11, c++14, c++17 - // ADDITIONAL_COMPILE_FLAGS(has-latomic): -latomic -+// XFAIL: !has-64-bit-atomics - - // bool compare_exchange_weak(T& expected, T desired, - // memory_order success, memory_order failure) volatile noexcept; -diff --git a/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/ctor.pass.cpp b/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/ctor.pass.cpp -index febabb4f2678..d2f4a2bd64dc 100644 ---- a/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/ctor.pass.cpp -+++ b/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/ctor.pass.cpp -@@ -8,6 +8,7 @@ - // UNSUPPORTED: c++03, c++11, c++14, c++17 - // UNSUPPORTED: target={{.+}}-windows-gnu - // ADDITIONAL_COMPILE_FLAGS(has-latomic): -latomic -+// XFAIL: !has-64-bit-atomics - - // constexpr atomic() noexcept; - // constexpr atomic(floating-point-type) noexcept; -diff --git a/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/exchange.pass.cpp b/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/exchange.pass.cpp -index a8306304280c..1807e48f7bef 100644 ---- a/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/exchange.pass.cpp -+++ b/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/exchange.pass.cpp -@@ -11,6 +11,7 @@ - // XFAIL: tsan - // XFAIL: target={{x86_64-.*}} && msan - // ADDITIONAL_COMPILE_FLAGS(has-latomic): -latomic -+// XFAIL: !has-64-bit-atomics - - // T exchange(T, memory_order = memory_order::seq_cst) volatile noexcept; - // T exchange(T, memory_order = memory_order::seq_cst) noexcept; -diff --git a/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/fetch_add.pass.cpp b/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/fetch_add.pass.cpp -index 0c59b50eb807..a73c5f26b71f 100644 ---- a/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/fetch_add.pass.cpp -+++ b/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/fetch_add.pass.cpp -@@ -13,6 +13,7 @@ - // Hangs with msan. - // UNSUPPORTED: msan - // ADDITIONAL_COMPILE_FLAGS(has-latomic): -latomic -+// XFAIL: !has-64-bit-atomics - - // floating-point-type fetch_add(floating-point-type, - // memory_order = memory_order::seq_cst) volatile noexcept; -diff --git a/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/fetch_sub.pass.cpp b/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/fetch_sub.pass.cpp -index 4435e3fc19b4..d21a42e53a54 100644 ---- a/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/fetch_sub.pass.cpp -+++ b/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/fetch_sub.pass.cpp -@@ -13,6 +13,7 @@ - // Hangs with msan. - // UNSUPPORTED: msan - // ADDITIONAL_COMPILE_FLAGS(has-latomic): -latomic -+// XFAIL: !has-64-bit-atomics - - // floating-point-type fetch_sub(floating-point-type, - // memory_order = memory_order::seq_cst) volatile noexcept; -diff --git a/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/load.pass.cpp b/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/load.pass.cpp -index fa085275de29..2901af0a7f39 100644 ---- a/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/load.pass.cpp -+++ b/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/load.pass.cpp -@@ -10,6 +10,7 @@ - // Clang's support for atomic operations on long double is broken. See https://github.com/llvm/llvm-project/issues/72893 - // XFAIL: tsan - // ADDITIONAL_COMPILE_FLAGS(has-latomic): -latomic -+// XFAIL: !has-64-bit-atomics - - // floating-point-type load(memory_order = memory_order::seq_cst) volatile noexcept; - // floating-point-type load(memory_order = memory_order::seq_cst) noexcept; -diff --git a/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/lockfree.pass.cpp b/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/lockfree.pass.cpp -index 447e0f865002..7619d113a340 100644 ---- a/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/lockfree.pass.cpp -+++ b/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/lockfree.pass.cpp -@@ -8,6 +8,7 @@ - // UNSUPPORTED: c++03, c++11, c++14, c++17 - // UNSUPPORTED: target={{.+}}-windows-gnu - // ADDITIONAL_COMPILE_FLAGS(has-latomic): -latomic -+// XFAIL: !has-64-bit-atomics - - // static constexpr bool is_always_lock_free = implementation-defined; - // bool is_lock_free() const volatile noexcept; -diff --git a/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/notify_all.pass.cpp b/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/notify_all.pass.cpp -index e2320ed0b70e..143a034c55b7 100644 ---- a/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/notify_all.pass.cpp -+++ b/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/notify_all.pass.cpp -@@ -9,6 +9,7 @@ - // XFAIL: availability-synchronization_library-missing - // UNSUPPORTED: c++03, c++11, c++14, c++17 - // ADDITIONAL_COMPILE_FLAGS(has-latomic): -latomic -+// XFAIL: !has-64-bit-atomics - - // void notify_all() volatile noexcept; - // void notify_all() noexcept; -diff --git a/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/notify_one.pass.cpp b/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/notify_one.pass.cpp -index 058424f5cee0..debc9ddcdd32 100644 ---- a/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/notify_one.pass.cpp -+++ b/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/notify_one.pass.cpp -@@ -9,6 +9,7 @@ - // XFAIL: availability-synchronization_library-missing - // UNSUPPORTED: c++03, c++11, c++14, c++17 - // ADDITIONAL_COMPILE_FLAGS(has-latomic): -latomic -+// XFAIL: !has-64-bit-atomics - - // void notify_one() volatile noexcept; - // void notify_one() noexcept; -diff --git a/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/operator.float.pass.cpp b/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/operator.float.pass.cpp -index 54c62ba8d091..e0da122c3059 100644 ---- a/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/operator.float.pass.cpp -+++ b/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/operator.float.pass.cpp -@@ -8,6 +8,7 @@ - // UNSUPPORTED: c++03, c++11, c++14, c++17 - // UNSUPPORTED: target={{.+}}-windows-gnu - // ADDITIONAL_COMPILE_FLAGS(has-latomic): -latomic -+// XFAIL: !has-64-bit-atomics - - // operator floating-point-type() volatile noexcept; - // operator floating-point-type() noexcept; -diff --git a/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/operator.minus_equals.pass.cpp b/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/operator.minus_equals.pass.cpp -index 23ad0c5c819d..0ee0232718af 100644 ---- a/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/operator.minus_equals.pass.cpp -+++ b/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/operator.minus_equals.pass.cpp -@@ -9,6 +9,7 @@ - // UNSUPPORTED: target={{.+}}-windows-gnu - // XFAIL: LIBCXX-AIX-FIXME - // ADDITIONAL_COMPILE_FLAGS(has-latomic): -latomic -+// XFAIL: !has-64-bit-atomics - // Hangs with msan. - // UNSUPPORTED: msan - -diff --git a/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/operator.plus_equals.pass.cpp b/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/operator.plus_equals.pass.cpp -index 0676645fcfa1..1cdafaa4b5ab 100644 ---- a/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/operator.plus_equals.pass.cpp -+++ b/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/operator.plus_equals.pass.cpp -@@ -9,6 +9,7 @@ - // UNSUPPORTED: target={{.+}}-windows-gnu - // XFAIL: LIBCXX-AIX-FIXME - // ADDITIONAL_COMPILE_FLAGS(has-latomic): -latomic -+// XFAIL: !has-64-bit-atomics - // Hangs with msan. - // UNSUPPORTED: msan - -diff --git a/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/store.pass.cpp b/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/store.pass.cpp -index 0bb1f00840a8..957dbbe0d876 100644 ---- a/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/store.pass.cpp -+++ b/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/store.pass.cpp -@@ -9,6 +9,7 @@ - // Clang's support for atomic operations on long double is broken. See https://github.com/llvm/llvm-project/issues/72893 - // XFAIL: tsan - // ADDITIONAL_COMPILE_FLAGS(has-latomic): -latomic -+// XFAIL: !has-64-bit-atomics - - // void store(floating-point-type, memory_order = memory_order::seq_cst) volatile noexcept; - // void store(floating-point-type, memory_order = memory_order::seq_cst) noexcept; -diff --git a/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/wait.pass.cpp b/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/wait.pass.cpp -index 15f3613245a8..6c4f65d3bc38 100644 ---- a/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/wait.pass.cpp -+++ b/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/wait.pass.cpp -@@ -11,6 +11,7 @@ - // XFAIL: tsan - // XFAIL: target={{x86_64-.*}} && msan - // ADDITIONAL_COMPILE_FLAGS(has-latomic): -latomic -+// XFAIL: !has-64-bit-atomics - - // void wait(T old, memory_order order = memory_order::seq_cst) const volatile noexcept; - // void wait(T old, memory_order order = memory_order::seq_cst) const noexcept; -diff --git a/libcxx/test/std/atomics/atomics.types.generic/integral.pass.cpp b/libcxx/test/std/atomics/atomics.types.generic/integral.pass.cpp -index 2695ff94da30..bb88f551bd06 100644 ---- a/libcxx/test/std/atomics/atomics.types.generic/integral.pass.cpp -+++ b/libcxx/test/std/atomics/atomics.types.generic/integral.pass.cpp -@@ -6,6 +6,8 @@ - // - //===----------------------------------------------------------------------===// - -+// XFAIL: !has-64-bit-atomics -+ - // - - // template <> -diff --git a/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_add.pass.cpp b/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_add.pass.cpp -index 31563789227e..069b64b09784 100644 ---- a/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_add.pass.cpp -+++ b/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_add.pass.cpp -@@ -6,6 +6,8 @@ - // - //===----------------------------------------------------------------------===// - -+// XFAIL: !has-64-bit-atomics -+ - // - - // template -diff --git a/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_add_explicit.pass.cpp b/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_add_explicit.pass.cpp -index 747a62ae1829..2b75e915d22b 100644 ---- a/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_add_explicit.pass.cpp -+++ b/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_add_explicit.pass.cpp -@@ -6,6 +6,8 @@ - // - //===----------------------------------------------------------------------===// - -+// XFAIL: !has-64-bit-atomics -+ - // - - // template -diff --git a/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_and.pass.cpp b/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_and.pass.cpp -index 04b279ca9d4d..e106e1a38b0b 100644 ---- a/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_and.pass.cpp -+++ b/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_and.pass.cpp -@@ -6,6 +6,8 @@ - // - //===----------------------------------------------------------------------===// - -+// XFAIL: !has-64-bit-atomics -+ - // - - // template -diff --git a/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_and_explicit.pass.cpp b/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_and_explicit.pass.cpp -index f6887a28ce14..ed878e222477 100644 ---- a/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_and_explicit.pass.cpp -+++ b/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_and_explicit.pass.cpp -@@ -6,6 +6,8 @@ - // - //===----------------------------------------------------------------------===// - -+// XFAIL: !has-64-bit-atomics -+ - // - - // template -diff --git a/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_or.pass.cpp b/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_or.pass.cpp -index 76a66dc6d478..01e73f4503e0 100644 ---- a/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_or.pass.cpp -+++ b/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_or.pass.cpp -@@ -6,6 +6,8 @@ - // - //===----------------------------------------------------------------------===// - -+// XFAIL: !has-64-bit-atomics -+ - // - - // template -diff --git a/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_or_explicit.pass.cpp b/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_or_explicit.pass.cpp -index 73161232ae7e..f8ae8fbbd76a 100644 ---- a/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_or_explicit.pass.cpp -+++ b/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_or_explicit.pass.cpp -@@ -6,6 +6,8 @@ - // - //===----------------------------------------------------------------------===// - -+// XFAIL: !has-64-bit-atomics -+ - // - - // template -diff --git a/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_sub.pass.cpp b/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_sub.pass.cpp -index 37a9586a0ba1..9212f03b0fd9 100644 ---- a/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_sub.pass.cpp -+++ b/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_sub.pass.cpp -@@ -6,6 +6,8 @@ - // - //===----------------------------------------------------------------------===// - -+// XFAIL: !has-64-bit-atomics -+ - // - - // template -diff --git a/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_sub_explicit.pass.cpp b/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_sub_explicit.pass.cpp -index 19240968ee7e..628b81521f19 100644 ---- a/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_sub_explicit.pass.cpp -+++ b/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_sub_explicit.pass.cpp -@@ -6,6 +6,8 @@ - // - //===----------------------------------------------------------------------===// - -+// XFAIL: !has-64-bit-atomics -+ - // - - // template -diff --git a/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_xor.pass.cpp b/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_xor.pass.cpp -index 3875f9e2161c..0c648fce5749 100644 ---- a/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_xor.pass.cpp -+++ b/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_xor.pass.cpp -@@ -6,6 +6,8 @@ - // - //===----------------------------------------------------------------------===// - -+// XFAIL: !has-64-bit-atomics -+ - // - - // template -diff --git a/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_xor_explicit.pass.cpp b/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_xor_explicit.pass.cpp -index 7521a027755d..4bdad43f19ff 100644 ---- a/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_xor_explicit.pass.cpp -+++ b/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_xor_explicit.pass.cpp -@@ -6,6 +6,8 @@ - // - //===----------------------------------------------------------------------===// - -+// XFAIL: !has-64-bit-atomics -+ - // - - // template -diff --git a/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/ctor.pass.cpp b/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/ctor.pass.cpp -index 32baca49e307..3ee44a1771b7 100644 ---- a/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/ctor.pass.cpp -+++ b/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/ctor.pass.cpp -@@ -8,6 +8,8 @@ - - // UNSUPPORTED: c++03 - -+// XFAIL: !has-64-bit-atomics -+ - // - - // constexpr atomic::atomic(T value) -diff --git a/libcxx/test/std/depr/depr.c.headers/fenv_h.compile.pass.cpp b/libcxx/test/std/depr/depr.c.headers/fenv_h.compile.pass.cpp -index fda5e186c036..dcc97573d607 100644 ---- a/libcxx/test/std/depr/depr.c.headers/fenv_h.compile.pass.cpp -+++ b/libcxx/test/std/depr/depr.c.headers/fenv_h.compile.pass.cpp -@@ -6,6 +6,9 @@ - // - //===----------------------------------------------------------------------===// - -+// Floating point exceptions are required for the FE_... macros to be defined. -+// XFAIL: LIBCXX-PICOLIBC-FIXME -+ - // - - #include -diff --git a/libcxx/test/std/depr/depr.c.headers/uchar_h.compile.pass.cpp b/libcxx/test/std/depr/depr.c.headers/uchar_h.compile.pass.cpp -index 2b6455466681..a1560c8ee585 100644 ---- a/libcxx/test/std/depr/depr.c.headers/uchar_h.compile.pass.cpp -+++ b/libcxx/test/std/depr/depr.c.headers/uchar_h.compile.pass.cpp -@@ -11,6 +11,9 @@ - // Apple platforms don't provide yet, so these tests fail. - // XFAIL: target={{.+}}-apple-{{.+}} - -+// mbrtoc16 not defined. -+// XFAIL: LIBCXX-PICOLIBC-FIXME -+ - // - - #include -diff --git a/libcxx/test/std/experimental/simd/simd.reference/reference_assignment.pass.cpp b/libcxx/test/std/experimental/simd/simd.reference/reference_assignment.pass.cpp -index 048625075353..d37b4af563cc 100644 ---- a/libcxx/test/std/experimental/simd/simd.reference/reference_assignment.pass.cpp -+++ b/libcxx/test/std/experimental/simd/simd.reference/reference_assignment.pass.cpp -@@ -8,6 +8,9 @@ - - // UNSUPPORTED: c++03, c++11, c++14 - -+// The machine emulated in tests does not have enough memory for code. -+// UNSUPPORTED: LIBCXX-PICOLIBC-FIXME -+ - // - // - // [simd.reference] -diff --git a/libcxx/test/std/input.output/iostream.objects/narrow.stream.objects/cerr.sh.cpp b/libcxx/test/std/input.output/iostream.objects/narrow.stream.objects/cerr.sh.cpp -index b9e274af7334..9a4b437ab109 100644 ---- a/libcxx/test/std/input.output/iostream.objects/narrow.stream.objects/cerr.sh.cpp -+++ b/libcxx/test/std/input.output/iostream.objects/narrow.stream.objects/cerr.sh.cpp -@@ -6,6 +6,8 @@ - // - //===----------------------------------------------------------------------===// - -+// UNSUPPORTED: LIBCXX-PICOLIBC-FIXME -+ - // - - // ostream cerr; -diff --git a/libcxx/test/std/input.output/iostream.objects/narrow.stream.objects/clog.sh.cpp b/libcxx/test/std/input.output/iostream.objects/narrow.stream.objects/clog.sh.cpp -index 476addba050d..783be3a52e94 100644 ---- a/libcxx/test/std/input.output/iostream.objects/narrow.stream.objects/clog.sh.cpp -+++ b/libcxx/test/std/input.output/iostream.objects/narrow.stream.objects/clog.sh.cpp -@@ -6,6 +6,8 @@ - // - //===----------------------------------------------------------------------===// - -+// UNSUPPORTED: LIBCXX-PICOLIBC-FIXME -+ - // - - // ostream clog; -diff --git a/libcxx/test/std/input.output/iostream.objects/narrow.stream.objects/cout.sh.cpp b/libcxx/test/std/input.output/iostream.objects/narrow.stream.objects/cout.sh.cpp -index b8d319385ca1..1234da38de03 100644 ---- a/libcxx/test/std/input.output/iostream.objects/narrow.stream.objects/cout.sh.cpp -+++ b/libcxx/test/std/input.output/iostream.objects/narrow.stream.objects/cout.sh.cpp -@@ -6,6 +6,8 @@ - // - //===----------------------------------------------------------------------===// - -+// UNSUPPORTED: LIBCXX-PICOLIBC-FIXME -+ - // - - // ostream cout; -diff --git a/libcxx/test/std/iterators/iterator.primitives/iterator.traits/cxx20_iterator_traits.compile.pass.cpp b/libcxx/test/std/iterators/iterator.primitives/iterator.traits/cxx20_iterator_traits.compile.pass.cpp -index f6b7f6f9d463..f56750bb495e 100644 ---- a/libcxx/test/std/iterators/iterator.primitives/iterator.traits/cxx20_iterator_traits.compile.pass.cpp -+++ b/libcxx/test/std/iterators/iterator.primitives/iterator.traits/cxx20_iterator_traits.compile.pass.cpp -@@ -11,6 +11,11 @@ - // This test uses iterator types from std::filesystem - // XFAIL: availability-filesystem-missing - -+// std::same_as failed. -+// The former was long and the latter was long long. -+// Possibly related to "using streamoff = long int" in ios.h. -+// XFAIL: LIBCXX-PICOLIBC-FIXME -+ - // template - // struct iterator_traits; - -diff --git a/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/sized_delete_array14.pass.cpp b/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/sized_delete_array14.pass.cpp -index 21663cdf956d..901f2cca4ce0 100644 ---- a/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/sized_delete_array14.pass.cpp -+++ b/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/sized_delete_array14.pass.cpp -@@ -9,6 +9,7 @@ - // test sized operator delete[] replacement. - - // UNSUPPORTED: sanitizer-new-delete, c++03, c++11 -+// UNSUPPORTED: LIBCXX-PICOLIBC-FIXME - - // NOTE: Clang does not enable sized-deallocation in C++14 and beyond by - // default. It is only enabled when -fsized-deallocation is given. -diff --git a/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete14.pass.cpp b/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete14.pass.cpp -index a8701ce7a86c..d0b10b65be28 100644 ---- a/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete14.pass.cpp -+++ b/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete14.pass.cpp -@@ -9,6 +9,7 @@ - // test sized operator delete replacement. - - // UNSUPPORTED: sanitizer-new-delete, c++03, c++11 -+// UNSUPPORTED: LIBCXX-PICOLIBC-FIXME - - // NOTE: Clang does not enable sized-deallocation in C++14 and beyond by - // default. It is only enabled when -fsized-deallocation is given. -diff --git a/libcxx/test/std/language.support/support.runtime/ctime.timespec.compile.pass.cpp b/libcxx/test/std/language.support/support.runtime/ctime.timespec.compile.pass.cpp -index 04c4c77edd5e..12b1c3888132 100644 ---- a/libcxx/test/std/language.support/support.runtime/ctime.timespec.compile.pass.cpp -+++ b/libcxx/test/std/language.support/support.runtime/ctime.timespec.compile.pass.cpp -@@ -11,6 +11,9 @@ - - // UNSUPPORTED: c++03, c++11, c++14 - -+// picolibc doesn't define TIME_UTC. -+// XFAIL: LIBCXX-PICOLIBC-FIXME -+ - // ::timespec_get is provided by the C library, but it's marked as - // unavailable until macOS 10.15 - // XFAIL: stdlib=apple-libc++ && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14}} -diff --git a/libcxx/test/std/numerics/cfenv/cfenv.syn/cfenv.pass.cpp b/libcxx/test/std/numerics/cfenv/cfenv.syn/cfenv.pass.cpp -index 557a93cdefe0..7b3b490eba27 100644 ---- a/libcxx/test/std/numerics/cfenv/cfenv.syn/cfenv.pass.cpp -+++ b/libcxx/test/std/numerics/cfenv/cfenv.syn/cfenv.pass.cpp -@@ -6,6 +6,9 @@ - // - //===----------------------------------------------------------------------===// - -+// Floating point exceptions are required for the FE_... macros to be defined. -+// XFAIL: LIBCXX-PICOLIBC-FIXME -+ - // - - #include -diff --git a/libcxx/test/std/strings/c.strings/cuchar.compile.pass.cpp b/libcxx/test/std/strings/c.strings/cuchar.compile.pass.cpp -index db00cbde3336..2076384deb2b 100644 ---- a/libcxx/test/std/strings/c.strings/cuchar.compile.pass.cpp -+++ b/libcxx/test/std/strings/c.strings/cuchar.compile.pass.cpp -@@ -11,6 +11,9 @@ - // Apple platforms don't provide yet, so these tests fail. - // XFAIL: target={{.+}}-apple-{{.+}} - -+// mbrtoc16 not defined. -+// XFAIL: LIBCXX-PICOLIBC-FIXME -+ - // - - #include -diff --git a/libcxx/test/std/time/time.clock/time.clock.file/to_from_sys.pass.cpp b/libcxx/test/std/time/time.clock/time.clock.file/to_from_sys.pass.cpp -index 5b1f46599111..b1031c815610 100644 ---- a/libcxx/test/std/time/time.clock/time.clock.file/to_from_sys.pass.cpp -+++ b/libcxx/test/std/time/time.clock/time.clock.file/to_from_sys.pass.cpp -@@ -10,6 +10,9 @@ - - // UNSUPPORTED: availability-filesystem-missing - -+// "unable to find library from dependent library specifier: rt" -+// XFAIL: LIBCXX-PICOLIBC-FIXME -+ - // - // - // file_clock -diff --git a/libcxx/test/std/time/time.clock/time.clock.hires/now.pass.cpp b/libcxx/test/std/time/time.clock/time.clock.hires/now.pass.cpp -index db1fb55df907..8625ac58bde5 100644 ---- a/libcxx/test/std/time/time.clock/time.clock.hires/now.pass.cpp -+++ b/libcxx/test/std/time/time.clock/time.clock.hires/now.pass.cpp -@@ -6,6 +6,9 @@ - // - //===----------------------------------------------------------------------===// - -+// "unable to find library from dependent library specifier: rt" -+// XFAIL: LIBCXX-PICOLIBC-FIXME -+ - // - - // high_resolution_clock -diff --git a/libcxx/test/std/time/time.clock/time.clock.system/from_time_t.pass.cpp b/libcxx/test/std/time/time.clock/time.clock.system/from_time_t.pass.cpp -index 70dd8117e6ce..5ff667445b1a 100644 ---- a/libcxx/test/std/time/time.clock/time.clock.system/from_time_t.pass.cpp -+++ b/libcxx/test/std/time/time.clock/time.clock.system/from_time_t.pass.cpp -@@ -6,6 +6,9 @@ - // - //===----------------------------------------------------------------------===// - -+// "unable to find library from dependent library specifier: rt" -+// XFAIL: LIBCXX-PICOLIBC-FIXME -+ - // - - // system_clock -diff --git a/libcxx/test/std/time/time.clock/time.clock.system/now.pass.cpp b/libcxx/test/std/time/time.clock/time.clock.system/now.pass.cpp -index dade6bafa471..70fbe98d8dfd 100644 ---- a/libcxx/test/std/time/time.clock/time.clock.system/now.pass.cpp -+++ b/libcxx/test/std/time/time.clock/time.clock.system/now.pass.cpp -@@ -6,6 +6,9 @@ - // - //===----------------------------------------------------------------------===// - -+// "unable to find library from dependent library specifier: rt" -+// XFAIL: LIBCXX-PICOLIBC-FIXME -+ - // - - // system_clock -diff --git a/libcxx/test/std/time/time.clock/time.clock.system/to_time_t.pass.cpp b/libcxx/test/std/time/time.clock/time.clock.system/to_time_t.pass.cpp -index bf4339c32d1c..f3238f7bb1bb 100644 ---- a/libcxx/test/std/time/time.clock/time.clock.system/to_time_t.pass.cpp -+++ b/libcxx/test/std/time/time.clock/time.clock.system/to_time_t.pass.cpp -@@ -6,6 +6,9 @@ - // - //===----------------------------------------------------------------------===// - -+// "unable to find library from dependent library specifier: rt" -+// XFAIL: LIBCXX-PICOLIBC-FIXME -+ - // - - // system_clock -diff --git a/libcxx/test/std/time/time.point/time.point.nonmember/op_-duration.pass.cpp b/libcxx/test/std/time/time.point/time.point.nonmember/op_-duration.pass.cpp -index 80e9d04a769f..199bdec66878 100644 ---- a/libcxx/test/std/time/time.point/time.point.nonmember/op_-duration.pass.cpp -+++ b/libcxx/test/std/time/time.point/time.point.nonmember/op_-duration.pass.cpp -@@ -6,6 +6,9 @@ - // - //===----------------------------------------------------------------------===// - -+// "unable to find library from dependent library specifier: rt" -+// XFAIL: LIBCXX-PICOLIBC-FIXME -+ - // - - // time_point -diff --git a/libcxx/utils/ci/BOT_OWNERS.txt b/libcxx/utils/ci/BOT_OWNERS.txt -index 721b19e52d8b..de575c591383 100644 ---- a/libcxx/utils/ci/BOT_OWNERS.txt -+++ b/libcxx/utils/ci/BOT_OWNERS.txt -@@ -10,7 +10,7 @@ least the (N), (E) and (D) fields. - - N: Linaro Toolchain Working Group - E: linaro-toolchain@lists.linaro.org --D: Armv7, Armv8, AArch64 -+D: Arm platforms - - N: LLVM on Power - E: powerllvm@ca.ibm.com -diff --git a/libcxx/utils/ci/build-picolibc.sh b/libcxx/utils/ci/build-picolibc.sh -new file mode 100755 -index 000000000000..078c2bdf5ebc ---- /dev/null -+++ b/libcxx/utils/ci/build-picolibc.sh -@@ -0,0 +1,111 @@ -+#!/usr/bin/env bash -+#===----------------------------------------------------------------------===## -+# -+# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -+# See https://llvm.org/LICENSE.txt for license information. -+# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -+# -+#===----------------------------------------------------------------------===## -+ -+# -+# This script builds picolibc (https://github.com/picolibc/picolibc) from -+# source to facilitate building libc++ against it. -+# -+ -+set -e -+ -+PROGNAME="$(basename "${0}")" -+ -+function error() { printf "error: %s\n" "$*" >&2; exit 1; } -+ -+function usage() { -+cat < Path to the directory to use for building. -+ -+--install-dir Path to the directory to install the library to. -+EOF -+} -+ -+while [[ $# -gt 0 ]]; do -+ case ${1} in -+ -h|--help) -+ usage -+ exit 0 -+ ;; -+ --build-dir) -+ build_dir="${2}" -+ shift; shift -+ ;; -+ --install-dir) -+ install_dir="${2}" -+ shift; shift -+ ;; -+ --target) -+ target="${2}" -+ shift; shift -+ ;; -+ *) -+ error "Unknown argument '${1}'" -+ ;; -+ esac -+done -+ -+for arg in build_dir install_dir target; do -+ if [ -z ${!arg+x} ]; then -+ error "Missing required argument '--${arg//_/-}'" -+ elif [ "${!arg}" == "" ]; then -+ error "Argument to --${arg//_/-} must not be empty" -+ fi -+done -+ -+ -+echo "--- Downloading picolibc" -+picolibc_source_dir="${build_dir}/picolibc-source" -+picolibc_build_dir="${build_dir}/picolibc-build" -+mkdir -p "${picolibc_source_dir}" -+mkdir -p "${picolibc_build_dir}" -+# Download the version of picolibc that was the latest at the time this script was written. -+# Following changes are required and were introduced after version 1.8.5: -+# - updated semihost arguments handling, -+# - added missing macros in stdio.h -+# Version following 1.8.5, was not released by the time of writing. -+picolibc_commit="4b9b8ef01d18cf0563348ad4af4ae89a7277e7ca" -+curl -L "https://github.com/picolibc/picolibc/archive/${picolibc_commit}.zip" --output "${picolibc_source_dir}/picolibc.zip" -+unzip -q "${picolibc_source_dir}/picolibc.zip" -d "${picolibc_source_dir}" -+mv "${picolibc_source_dir}/picolibc-${picolibc_commit}"/* "${picolibc_source_dir}" -+rm -rf "${picolibc_source_dir}/picolibc-${picolibc_commit}" -+ -+cat < "${picolibc_build_dir}/meson-cross-build.txt" -+[binaries] -+c = ['${CC:-cc}', '--target=${target}', '-mfloat-abi=soft', '-nostdlib'] -+ar = 'llvm-ar' -+as = 'llvm-as' -+ld = 'lld' -+strip = 'llvm-strip' -+[host_machine] -+system = 'none' -+cpu_family = 'arm' -+cpu = 'arm' -+endian = 'little' -+[properties] -+skip_sanity_check = true -+EOF -+ -+venv_dir="${build_dir}/meson-venv" -+python3 -m venv "${venv_dir}" -+# Install the version of meson that was the latest at the time this script was written. -+"${venv_dir}/bin/pip" install "meson==1.1.1" -+ -+"${venv_dir}/bin/meson" setup \ -+ -Dincludedir=include -Dlibdir=lib -Dspecsdir=none -Dmultilib=false -Dpicoexit=false \ -+ --prefix "${install_dir}" \ -+ --cross-file "${picolibc_build_dir}/meson-cross-build.txt" \ -+ "${picolibc_build_dir}" \ -+ "${picolibc_source_dir}" -+ -+"${venv_dir}/bin/meson" install -C "${picolibc_build_dir}" -diff --git a/libcxx/utils/ci/buildkite-pipeline.yml b/libcxx/utils/ci/buildkite-pipeline.yml -index 3c49247ab5ae..06b0c55e6f3c 100644 ---- a/libcxx/utils/ci/buildkite-pipeline.yml -+++ b/libcxx/utils/ci/buildkite-pipeline.yml -@@ -227,6 +227,11 @@ steps: - <<: *arm_agent_armv8l - <<: *common - -+ - label: Armv7-M picolibc -+ command: libcxx/utils/ci/run-buildbot armv7m-picolibc -+ <<: *arm_agent_aarch64 -+ <<: *common -+ - - group: AIX - steps: - - label: AIX (32-bit) -diff --git a/libcxx/utils/ci/run-buildbot b/libcxx/utils/ci/run-buildbot -index 58c4c2a1021b..445b1becee0c 100755 ---- a/libcxx/utils/ci/run-buildbot -+++ b/libcxx/utils/ci/run-buildbot -@@ -610,6 +610,41 @@ armv7-no-exceptions) - generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Armv7Thumb-no-exceptions.cmake" - check-runtimes - ;; -+armv7m-picolibc) -+ clean -+ -+ # To make it easier to get this builder up and running, build picolibc -+ # from scratch. Anecdotally, the build-picolibc script takes about 16 seconds. -+ # This could be optimised by building picolibc into the Docker container. -+ ${MONOREPO_ROOT}/libcxx/utils/ci/build-picolibc.sh \ -+ --build-dir "${BUILD_DIR}" \ -+ --install-dir "${INSTALL_DIR}" \ -+ --target armv7m-none-eabi -+ -+ echo "--- Generating CMake" -+ flags="--sysroot=${INSTALL_DIR}" -+ ${CMAKE} \ -+ -S "${MONOREPO_ROOT}/compiler-rt" \ -+ -B "${BUILD_DIR}/compiler-rt" \ -+ -GNinja -DCMAKE_MAKE_PROGRAM="${NINJA}" \ -+ -DCMAKE_BUILD_TYPE=RelWithDebInfo \ -+ -DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \ -+ -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Armv7M-picolibc.cmake" \ -+ -DCMAKE_C_FLAGS="${flags}" \ -+ -DCMAKE_CXX_FLAGS="${flags}" \ -+ -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=ON -+ generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Armv7M-picolibc.cmake" \ -+ -DLIBCXX_TEST_CONFIG="armv7m-picolibc-libc++.cfg.in" \ -+ -DLIBCXXABI_TEST_CONFIG="armv7m-picolibc-libc++abi.cfg.in" \ -+ -DLIBUNWIND_TEST_CONFIG="armv7m-picolibc-libunwind.cfg.in" \ -+ -DCMAKE_C_FLAGS="${flags}" \ -+ -DCMAKE_CXX_FLAGS="${flags}" -+ -+ ${NINJA} -vC "${BUILD_DIR}/compiler-rt" install -+ mv "${BUILD_DIR}/install/lib/armv7m-none-eabi"/* "${BUILD_DIR}/install/lib" -+ -+ check-runtimes -+;; - clang-cl-dll) - clean - # TODO: Currently, building with the experimental library breaks running -diff --git a/libcxx/utils/libcxx/test/features.py b/libcxx/utils/libcxx/test/features.py -index e1cfa032f161..ab5a24dadb60 100644 ---- a/libcxx/utils/libcxx/test/features.py -+++ b/libcxx/utils/libcxx/test/features.py -@@ -190,6 +190,17 @@ DEFAULT_FEATURES = [ - """, - ), - ), -+ Feature( -+ name="has-64-bit-atomics", -+ when=lambda cfg: sourceBuilds( -+ cfg, -+ """ -+ #include -+ std::atomic_uint64_t x; -+ int main(int, char**) { (void)x.load(); return 0; } -+ """, -+ ), -+ ), - # TODO: Remove this feature once compiler-rt includes __atomic_is_lockfree() - # on all supported platforms. - Feature( -@@ -265,7 +276,8 @@ DEFAULT_FEATURES = [ - #include - #include - int main(int, char**) { -- return 0; -+ int fd[2]; -+ return pipe(fd); - } - """, - ), -@@ -413,6 +425,19 @@ DEFAULT_FEATURES += [ - name="LIBCXX-FREEBSD-FIXME", - when=lambda cfg: "__FreeBSD__" in compilerMacros(cfg), - ), -+ Feature( -+ name="LIBCXX-PICOLIBC-FIXME", -+ when=lambda cfg: sourceBuilds( -+ cfg, -+ """ -+ #include -+ #ifndef __PICOLIBC__ -+ #error not picolibc -+ #endif -+ int main(int, char**) { return 0; } -+ """, -+ ), -+ ), - ] - - # Add features representing the build host platform name. -diff --git a/libcxxabi/test/configs/armv7m-picolibc-libc++abi.cfg.in b/libcxxabi/test/configs/armv7m-picolibc-libc++abi.cfg.in -new file mode 100644 -index 000000000000..cb5ede3ac67a ---- /dev/null -+++ b/libcxxabi/test/configs/armv7m-picolibc-libc++abi.cfg.in -@@ -0,0 +1,33 @@ -+lit_config.load_config(config, '@CMAKE_CURRENT_BINARY_DIR@/cmake-bridge.cfg') -+ -+libc_linker_script = '@CMAKE_INSTALL_PREFIX@/lib/picolibcpp.ld' -+ -+config.substitutions.append(('%{flags}', '--sysroot=@CMAKE_INSTALL_PREFIX@')) -+ -+config.substitutions.append(('%{compile_flags}', -+ '-nostdinc++ -I %{include} -I %{cxx-include} -I %{cxx-target-include} %{maybe-include-libunwind} -I %{libcxx}/test/support -I %{libcxx}/src -D_LIBCPP_ENABLE_CXX17_REMOVED_UNEXPECTED_FUNCTIONS' -+)) -+config.substitutions.append(('%{link_flags}', -+ '-nostdlib -nostdlib++ -L %{lib} -lc++ -lc++abi' -+ ' -lc -lm -lclang_rt.builtins -lsemihost -lcrt0-semihost' + -+ ' -T {}'.format(libc_linker_script) + -+ ' -Wl,--defsym=__flash=0x0' -+ ' -Wl,--defsym=__flash_size=0x400000' -+ ' -Wl,--defsym=__ram=0x21000000' -+ ' -Wl,--defsym=__ram_size=0x1000000' -+ ' -Wl,--defsym=__stack_size=0x1000' -+)) -+config.substitutions.append(('%{exec}', -+ 'true' # TODO use qemu-system-arm -+)) -+config.available_features.add('libcxx-fake-executor') -+ -+import os, site -+site.addsitedir(os.path.join('@LIBCXXABI_LIBCXX_PATH@', 'utils')) -+import libcxx.test.params, libcxx.test.config -+libcxx.test.config.configure( -+ libcxx.test.params.DEFAULT_PARAMETERS, -+ libcxx.test.features.DEFAULT_FEATURES, -+ config, -+ lit_config -+) -diff --git a/libcxxabi/test/test_demangle.pass.cpp b/libcxxabi/test/test_demangle.pass.cpp -index ff56d8772869..2b4e2011498d 100644 ---- a/libcxxabi/test/test_demangle.pass.cpp -+++ b/libcxxabi/test/test_demangle.pass.cpp -@@ -9,6 +9,9 @@ - // The demangler does not pass all these tests with the system dylibs on macOS. - // XFAIL: stdlib=apple-libc++ && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}} - -+// This test is too big for most embedded devices. -+// XFAIL: LIBCXX-PICOLIBC-FIXME -+ - // https://llvm.org/PR51407 was not fixed in some previously-released - // demanglers, which causes them to run into the infinite loop. - // UNSUPPORTED: stdlib=apple-libc++ && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}} -diff --git a/libunwind/test/configs/armv7m-picolibc-libunwind.cfg.in b/libunwind/test/configs/armv7m-picolibc-libunwind.cfg.in -new file mode 100644 -index 000000000000..c2dd320ddfd1 ---- /dev/null -+++ b/libunwind/test/configs/armv7m-picolibc-libunwind.cfg.in -@@ -0,0 +1,33 @@ -+lit_config.load_config(config, '@CMAKE_CURRENT_BINARY_DIR@/cmake-bridge.cfg') -+ -+libc_linker_script = '@CMAKE_INSTALL_PREFIX@/lib/picolibcpp.ld' -+ -+config.substitutions.append(('%{flags}', '--sysroot=@CMAKE_INSTALL_PREFIX@')) -+ -+config.substitutions.append(('%{compile_flags}', -+ '-nostdinc++ -I %{include}' -+)) -+config.substitutions.append(('%{link_flags}', -+ '-nostdlib -nostdlib++ -L %{lib} -lunwind' -+ ' -lc -lm -lclang_rt.builtins -lsemihost -lcrt0-semihost' + -+ ' -T {}'.format(libc_linker_script) + -+ ' -Wl,--defsym=__flash=0x0' -+ ' -Wl,--defsym=__flash_size=0x400000' -+ ' -Wl,--defsym=__ram=0x21000000' -+ ' -Wl,--defsym=__ram_size=0x1000000' -+ ' -Wl,--defsym=__stack_size=0x1000' -+)) -+config.substitutions.append(('%{exec}', -+ 'true' # TODO use qemu-system-arm -+)) -+config.available_features.add('libcxx-fake-executor') -+ -+import os, site -+site.addsitedir(os.path.join('@LIBUNWIND_LIBCXX_PATH@', 'utils')) -+import libcxx.test.params, libcxx.test.config -+libcxx.test.config.configure( -+ libcxx.test.params.DEFAULT_PARAMETERS, -+ libcxx.test.features.DEFAULT_FEATURES, -+ config, -+ lit_config -+) --- -2.34.1 - diff --git a/patches/llvm-project/0004-xfail-two-remaining-libcxx-with-picolibc-tests.patch b/patches/llvm-project/0002-xfail-two-remaining-libcxx-with-picolibc-tests.patch similarity index 96% rename from patches/llvm-project/0004-xfail-two-remaining-libcxx-with-picolibc-tests.patch rename to patches/llvm-project/0002-xfail-two-remaining-libcxx-with-picolibc-tests.patch index e312c845..c56fac14 100644 --- a/patches/llvm-project/0004-xfail-two-remaining-libcxx-with-picolibc-tests.patch +++ b/patches/llvm-project/0002-xfail-two-remaining-libcxx-with-picolibc-tests.patch @@ -1,4 +1,4 @@ -From cef87370a380d5fb62345e555a6df6cf6bb7de80 Mon Sep 17 00:00:00 2001 +From 8262b29ffcd9083f5c648131c69f672023859f7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20W=C3=B3jt?= Date: Mon, 16 Oct 2023 11:35:48 +0200 Subject: xfail two remaining libcxx with picolibc tests diff --git a/patches/llvm-project/0003-Run-picolibc-tests-with-qemu.patch b/patches/llvm-project/0003-Run-picolibc-tests-with-qemu.patch deleted file mode 100644 index 7ac174c4..00000000 --- a/patches/llvm-project/0003-Run-picolibc-tests-with-qemu.patch +++ /dev/null @@ -1,346 +0,0 @@ -From ce6b430fac8e2e94325c691eb7ff29fb5a6acf8e Mon Sep 17 00:00:00 2001 -From: Michael Platings -Date: Fri, 29 Sep 2023 12:23:37 +0100 -Subject: Run picolibc tests with qemu - -Differential Revision: https://reviews.llvm.org/D155521 ---- - libcxx/cmake/caches/Armv7M-picolibc.cmake | 1 + - libcxx/docs/index.rst | 2 +- - libcxx/test/configs/armv7m-picolibc-libc++.cfg.in | 13 +++++++++++-- - libcxx/test/libcxx/selftest/dsl/dsl.sh.py | 4 +++- - .../libcxx/selftest/pass.cpp/run-error.pass.cpp | 1 - - .../test/libcxx/selftest/pass.mm/run-error.pass.mm | 1 - - libcxx/test/libcxx/selftest/stdin-is-piped.sh.cpp | 2 ++ - .../alg.sorting/alg.sort/sort/sort.pass.cpp | 3 +++ - .../syserr.errcat.objects/generic_category.pass.cpp | 1 + - .../syserr.errcat.objects/system_category.pass.cpp | 1 + - .../narrow.stream.objects/cerr.sh.cpp | 2 +- - .../narrow.stream.objects/cin.sh.cpp | 1 + - .../narrow.stream.objects/clog.sh.cpp | 2 +- - .../narrow.stream.objects/cout.sh.cpp | 2 -- - .../new.delete.array/sized_delete_array14.pass.cpp | 1 - - .../new.delete.single/sized_delete14.pass.cpp | 1 - - .../facet.ctype.char.statics/classic_table.pass.cpp | 2 ++ - .../facet.num.put.members/put_long_double.pass.cpp | 1 + - .../rand.dist.bern.bin/eval.PR44847.pass.cpp | 3 +++ - .../time/time.clock/time.clock.file/now.pass.cpp | 3 +++ - .../test/configs/armv7m-picolibc-libc++abi.cfg.in | 10 ++++++++-- - .../test/configs/armv7m-picolibc-libunwind.cfg.in | 10 ++++++++-- - 22 files changed, 51 insertions(+), 16 deletions(-) - -diff --git a/libcxx/cmake/caches/Armv7M-picolibc.cmake b/libcxx/cmake/caches/Armv7M-picolibc.cmake -index 6ed1866a5084..e308ac31d1d1 100644 ---- a/libcxx/cmake/caches/Armv7M-picolibc.cmake -+++ b/libcxx/cmake/caches/Armv7M-picolibc.cmake -@@ -36,3 +36,4 @@ set(LIBUNWIND_ENABLE_THREADS OFF CACHE BOOL "") - set(LIBUNWIND_IS_BAREMETAL ON CACHE BOOL "") - set(LIBUNWIND_REMEMBER_HEAP_ALLOC ON CACHE BOOL "") - set(LIBUNWIND_USE_COMPILER_RT ON CACHE BOOL "") -+find_program(QEMU_SYSTEM_ARM qemu-system-arm) -diff --git a/libcxx/docs/index.rst b/libcxx/docs/index.rst -index 7bb5512beb1f..e8b4a95dbcff 100644 ---- a/libcxx/docs/index.rst -+++ b/libcxx/docs/index.rst -@@ -133,7 +133,7 @@ Linux i386, x86_64, arm, arm64 Only glibc-2.24 and later and no - Android 5.0+ i386, x86_64, arm, arm64 - Windows i386, x86_64 Both MSVC and MinGW style environments, ABI in MSVC environments is :doc:`unstable ` - AIX 7.2TL5+ powerpc, powerpc64 --Embedded (picolibc) arm Support for building with picolibc is currently work-in-progress -+Embedded (picolibc) arm - ===================== ========================= ============================ - - Generally speaking, libc++ should work on any platform that provides a fairly complete -diff --git a/libcxx/test/configs/armv7m-picolibc-libc++.cfg.in b/libcxx/test/configs/armv7m-picolibc-libc++.cfg.in -index c0d23f136475..14526c007924 100644 ---- a/libcxx/test/configs/armv7m-picolibc-libc++.cfg.in -+++ b/libcxx/test/configs/armv7m-picolibc-libc++.cfg.in -@@ -26,10 +26,19 @@ config.substitutions.append(('%{link_flags}', - ' -Wl,--defsym=__ram_size=0x1000000' - ' -Wl,--defsym=__stack_size=0x1000' - )) -+ -+config.executor = ( -+ '@LIBCXX_SOURCE_DIR@/utils/qemu_baremetal.py' -+ ' --qemu @QEMU_SYSTEM_ARM@' -+ ' --machine mps2-an385' -+ ' --cpu cortex-m3') - config.substitutions.append(('%{exec}', -- 'true' # TODO use qemu-system-arm -+ '%{executor}' -+ ' --execdir %T' - )) --config.available_features.add('libcxx-fake-executor') -+ -+# Long tests are prohibitively slow when run via emulation. -+config.long_tests = False - - import os, site - site.addsitedir(os.path.join('@LIBCXX_SOURCE_DIR@', 'utils')) -diff --git a/libcxx/test/libcxx/selftest/dsl/dsl.sh.py b/libcxx/test/libcxx/selftest/dsl/dsl.sh.py -index 6c695a0d672e..012759436d89 100644 ---- a/libcxx/test/libcxx/selftest/dsl/dsl.sh.py -+++ b/libcxx/test/libcxx/selftest/dsl/dsl.sh.py -@@ -6,7 +6,9 @@ - # - # ===----------------------------------------------------------------------===## - --# XFAIL: libcxx-fake-executor -+# With picolibc, test_program_stderr_is_not_conflated_with_stdout fails -+# because stdout & stderr are treated as the same. -+# XFAIL: LIBCXX-PICOLIBC-FIXME - - # Note: We prepend arguments with 'x' to avoid thinking there are too few - # arguments in case an argument is an empty string. -diff --git a/libcxx/test/libcxx/selftest/pass.cpp/run-error.pass.cpp b/libcxx/test/libcxx/selftest/pass.cpp/run-error.pass.cpp -index 1df98ef11191..eac7d8846e23 100644 ---- a/libcxx/test/libcxx/selftest/pass.cpp/run-error.pass.cpp -+++ b/libcxx/test/libcxx/selftest/pass.cpp/run-error.pass.cpp -@@ -6,7 +6,6 @@ - // - //===----------------------------------------------------------------------===// - --// UNSUPPORTED: libcxx-fake-executor - // XFAIL: * - - // Make sure the test DOES NOT pass if it fails at runtime. -diff --git a/libcxx/test/libcxx/selftest/pass.mm/run-error.pass.mm b/libcxx/test/libcxx/selftest/pass.mm/run-error.pass.mm -index 02e8321c96b2..22e17666eab0 100644 ---- a/libcxx/test/libcxx/selftest/pass.mm/run-error.pass.mm -+++ b/libcxx/test/libcxx/selftest/pass.mm/run-error.pass.mm -@@ -7,7 +7,6 @@ - //===----------------------------------------------------------------------===// - - // REQUIRES: objective-c++ --// UNSUPPORTED: libcxx-fake-executor - - // XFAIL: * - -diff --git a/libcxx/test/libcxx/selftest/stdin-is-piped.sh.cpp b/libcxx/test/libcxx/selftest/stdin-is-piped.sh.cpp -index ffd10631c6a6..897e10e94783 100644 ---- a/libcxx/test/libcxx/selftest/stdin-is-piped.sh.cpp -+++ b/libcxx/test/libcxx/selftest/stdin-is-piped.sh.cpp -@@ -8,6 +8,8 @@ - - // Make sure that the executor pipes standard input to the test-executable being run. - -+// XFAIL: LIBCXX-PICOLIBC-FIXME -+ - // RUN: %{build} - // RUN: echo "abc" | %{exec} %t.exe - -diff --git a/libcxx/test/std/algorithms/alg.sorting/alg.sort/sort/sort.pass.cpp b/libcxx/test/std/algorithms/alg.sorting/alg.sort/sort/sort.pass.cpp -index 554bd8982ab3..e2581fbf2fa6 100644 ---- a/libcxx/test/std/algorithms/alg.sorting/alg.sort/sort/sort.pass.cpp -+++ b/libcxx/test/std/algorithms/alg.sorting/alg.sort/sort/sort.pass.cpp -@@ -6,6 +6,9 @@ - // - //===----------------------------------------------------------------------===// - -+// This test appears to hang with picolibc & qemu. -+// UNSUPPORTED: LIBCXX-PICOLIBC-FIXME -+ - // - - // template -diff --git a/libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.objects/generic_category.pass.cpp b/libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.objects/generic_category.pass.cpp -index 5b63272a3a1a..3f49c36f8ba2 100644 ---- a/libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.objects/generic_category.pass.cpp -+++ b/libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.objects/generic_category.pass.cpp -@@ -7,6 +7,7 @@ - //===----------------------------------------------------------------------===// - - // XFAIL: stdlib=apple-libc++ && target={{.+}}-apple-macosx10.{{9|10|11|12}} -+// XFAIL: LIBCXX-PICOLIBC-FIXME - - // - -diff --git a/libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.objects/system_category.pass.cpp b/libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.objects/system_category.pass.cpp -index 1caf5cb2ccf7..4a29e1baa808 100644 ---- a/libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.objects/system_category.pass.cpp -+++ b/libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.objects/system_category.pass.cpp -@@ -13,6 +13,7 @@ - // const error_category& system_category(); - - // XFAIL: stdlib=apple-libc++ && target={{.+}}-apple-macosx10.{{9|10|11|12}} -+// XFAIL: LIBCXX-PICOLIBC-FIXME - - #include - #include -diff --git a/libcxx/test/std/input.output/iostream.objects/narrow.stream.objects/cerr.sh.cpp b/libcxx/test/std/input.output/iostream.objects/narrow.stream.objects/cerr.sh.cpp -index 9a4b437ab109..da5563f87df4 100644 ---- a/libcxx/test/std/input.output/iostream.objects/narrow.stream.objects/cerr.sh.cpp -+++ b/libcxx/test/std/input.output/iostream.objects/narrow.stream.objects/cerr.sh.cpp -@@ -6,7 +6,7 @@ - // - //===----------------------------------------------------------------------===// - --// UNSUPPORTED: LIBCXX-PICOLIBC-FIXME -+// XFAIL: LIBCXX-PICOLIBC-FIXME - - // - -diff --git a/libcxx/test/std/input.output/iostream.objects/narrow.stream.objects/cin.sh.cpp b/libcxx/test/std/input.output/iostream.objects/narrow.stream.objects/cin.sh.cpp -index 28ea650e58b1..ad6cc192e2f4 100644 ---- a/libcxx/test/std/input.output/iostream.objects/narrow.stream.objects/cin.sh.cpp -+++ b/libcxx/test/std/input.output/iostream.objects/narrow.stream.objects/cin.sh.cpp -@@ -8,6 +8,7 @@ - - // TODO: Investigate - // UNSUPPORTED: LIBCXX-AIX-FIXME -+// XFAIL: LIBCXX-PICOLIBC-FIXME - - // This test hangs on Android devices that lack shell_v2, which was added in - // Android N (API 24). -diff --git a/libcxx/test/std/input.output/iostream.objects/narrow.stream.objects/clog.sh.cpp b/libcxx/test/std/input.output/iostream.objects/narrow.stream.objects/clog.sh.cpp -index 783be3a52e94..9bedd67e816e 100644 ---- a/libcxx/test/std/input.output/iostream.objects/narrow.stream.objects/clog.sh.cpp -+++ b/libcxx/test/std/input.output/iostream.objects/narrow.stream.objects/clog.sh.cpp -@@ -6,7 +6,7 @@ - // - //===----------------------------------------------------------------------===// - --// UNSUPPORTED: LIBCXX-PICOLIBC-FIXME -+// XFAIL: LIBCXX-PICOLIBC-FIXME - - // - -diff --git a/libcxx/test/std/input.output/iostream.objects/narrow.stream.objects/cout.sh.cpp b/libcxx/test/std/input.output/iostream.objects/narrow.stream.objects/cout.sh.cpp -index 1234da38de03..b8d319385ca1 100644 ---- a/libcxx/test/std/input.output/iostream.objects/narrow.stream.objects/cout.sh.cpp -+++ b/libcxx/test/std/input.output/iostream.objects/narrow.stream.objects/cout.sh.cpp -@@ -6,8 +6,6 @@ - // - //===----------------------------------------------------------------------===// - --// UNSUPPORTED: LIBCXX-PICOLIBC-FIXME -- - // - - // ostream cout; -diff --git a/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/sized_delete_array14.pass.cpp b/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/sized_delete_array14.pass.cpp -index 901f2cca4ce0..21663cdf956d 100644 ---- a/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/sized_delete_array14.pass.cpp -+++ b/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/sized_delete_array14.pass.cpp -@@ -9,7 +9,6 @@ - // test sized operator delete[] replacement. - - // UNSUPPORTED: sanitizer-new-delete, c++03, c++11 --// UNSUPPORTED: LIBCXX-PICOLIBC-FIXME - - // NOTE: Clang does not enable sized-deallocation in C++14 and beyond by - // default. It is only enabled when -fsized-deallocation is given. -diff --git a/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete14.pass.cpp b/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete14.pass.cpp -index d0b10b65be28..a8701ce7a86c 100644 ---- a/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete14.pass.cpp -+++ b/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete14.pass.cpp -@@ -9,7 +9,6 @@ - // test sized operator delete replacement. - - // UNSUPPORTED: sanitizer-new-delete, c++03, c++11 --// UNSUPPORTED: LIBCXX-PICOLIBC-FIXME - - // NOTE: Clang does not enable sized-deallocation in C++14 and beyond by - // default. It is only enabled when -fsized-deallocation is given. -diff --git a/libcxx/test/std/localization/locale.categories/category.ctype/facet.ctype.special/facet.ctype.char.statics/classic_table.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/facet.ctype.special/facet.ctype.char.statics/classic_table.pass.cpp -index 8fe8080bde98..50c60180ce0d 100644 ---- a/libcxx/test/std/localization/locale.categories/category.ctype/facet.ctype.special/facet.ctype.char.statics/classic_table.pass.cpp -+++ b/libcxx/test/std/localization/locale.categories/category.ctype/facet.ctype.special/facet.ctype.char.statics/classic_table.pass.cpp -@@ -6,6 +6,8 @@ - // - //===----------------------------------------------------------------------===// - -+// XFAIL: LIBCXX-PICOLIBC-FIXME -+ - // - - // template <> class ctype -diff --git a/libcxx/test/std/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_long_double.pass.cpp b/libcxx/test/std/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_long_double.pass.cpp -index 8bb9ff1c202a..8637a933008f 100644 ---- a/libcxx/test/std/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_long_double.pass.cpp -+++ b/libcxx/test/std/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_long_double.pass.cpp -@@ -13,6 +13,7 @@ - // iter_type put(iter_type s, ios_base& iob, char_type fill, long double v) const; - - // XFAIL: win32-broken-printf-g-precision -+// XFAIL: LIBCXX-PICOLIBC-FIXME - - // Needs more investigation, but this is probably failing on Android M (API 23) - // and up because the printf formatting of NAN changed. -diff --git a/libcxx/test/std/numerics/rand/rand.dist/rand.dist.bern/rand.dist.bern.bin/eval.PR44847.pass.cpp b/libcxx/test/std/numerics/rand/rand.dist/rand.dist.bern/rand.dist.bern.bin/eval.PR44847.pass.cpp -index 9213d2bac5a6..572a59b7a192 100644 ---- a/libcxx/test/std/numerics/rand/rand.dist/rand.dist.bern/rand.dist.bern.bin/eval.PR44847.pass.cpp -+++ b/libcxx/test/std/numerics/rand/rand.dist/rand.dist.bern/rand.dist.bern.bin/eval.PR44847.pass.cpp -@@ -18,6 +18,9 @@ - // Serializing/deserializing the state of the RNG requires iostreams - // UNSUPPORTED: no-localization - -+// This test appears to hang with picolibc & qemu. -+// UNSUPPORTED: LIBCXX-PICOLIBC-FIXME -+ - #include - #include - #include -diff --git a/libcxx/test/std/time/time.clock/time.clock.file/now.pass.cpp b/libcxx/test/std/time/time.clock/time.clock.file/now.pass.cpp -index 0852483a8b39..4ba17a48988b 100644 ---- a/libcxx/test/std/time/time.clock/time.clock.file/now.pass.cpp -+++ b/libcxx/test/std/time/time.clock/time.clock.file/now.pass.cpp -@@ -10,6 +10,9 @@ - - // UNSUPPORTED: availability-filesystem-missing - -+// qemu: Unsupported SemiHosting SWI 0x30 -+// UNSUPPORTED: LIBCXX-PICOLIBC-FIXME -+ - // - - // file_clock -diff --git a/libcxxabi/test/configs/armv7m-picolibc-libc++abi.cfg.in b/libcxxabi/test/configs/armv7m-picolibc-libc++abi.cfg.in -index cb5ede3ac67a..b4744f935ad8 100644 ---- a/libcxxabi/test/configs/armv7m-picolibc-libc++abi.cfg.in -+++ b/libcxxabi/test/configs/armv7m-picolibc-libc++abi.cfg.in -@@ -17,10 +17,16 @@ config.substitutions.append(('%{link_flags}', - ' -Wl,--defsym=__ram_size=0x1000000' - ' -Wl,--defsym=__stack_size=0x1000' - )) -+ -+config.executor = ( -+ '@LIBCXXABI_LIBCXX_PATH@/utils/qemu_baremetal.py' -+ ' --qemu @QEMU_SYSTEM_ARM@' -+ ' --machine mps2-an385' -+ ' --cpu cortex-m3') - config.substitutions.append(('%{exec}', -- 'true' # TODO use qemu-system-arm -+ '%{executor}' -+ ' --execdir %T' - )) --config.available_features.add('libcxx-fake-executor') - - import os, site - site.addsitedir(os.path.join('@LIBCXXABI_LIBCXX_PATH@', 'utils')) -diff --git a/libunwind/test/configs/armv7m-picolibc-libunwind.cfg.in b/libunwind/test/configs/armv7m-picolibc-libunwind.cfg.in -index c2dd320ddfd1..e8f68a51fc53 100644 ---- a/libunwind/test/configs/armv7m-picolibc-libunwind.cfg.in -+++ b/libunwind/test/configs/armv7m-picolibc-libunwind.cfg.in -@@ -17,10 +17,16 @@ config.substitutions.append(('%{link_flags}', - ' -Wl,--defsym=__ram_size=0x1000000' - ' -Wl,--defsym=__stack_size=0x1000' - )) -+ -+config.executor = ( -+ '@LIBUNWIND_LIBCXX_PATH@/utils/qemu_baremetal.py' -+ ' --qemu @QEMU_SYSTEM_ARM@' -+ ' --machine mps2-an385' -+ ' --cpu cortex-m3') - config.substitutions.append(('%{exec}', -- 'true' # TODO use qemu-system-arm -+ '%{executor}' -+ ' --execdir %T' - )) --config.available_features.add('libcxx-fake-executor') - - import os, site - site.addsitedir(os.path.join('@LIBUNWIND_LIBCXX_PATH@', 'utils')) --- -2.34.1 - diff --git a/patches/llvm-project/0003-libc-tests-with-picolibc-disable-large-tests.patch b/patches/llvm-project/0003-libc-tests-with-picolibc-disable-large-tests.patch new file mode 100644 index 00000000..dd54a1c1 --- /dev/null +++ b/patches/llvm-project/0003-libc-tests-with-picolibc-disable-large-tests.patch @@ -0,0 +1,58 @@ +From 555fbcabc83763423e547d9e18a7289078cb47bc Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Dominik=20W=C3=B3jt?= +Date: Wed, 15 Nov 2023 12:18:35 +0100 +Subject: [libc++] tests with picolibc: disable large tests + +--- + libcxx/cmake/caches/Armv7M-picolibc.cmake | 9 ++++++++- + libcxxabi/test/test_demangle.pass.cpp | 2 +- + 2 files changed, 9 insertions(+), 2 deletions(-) + +diff --git a/libcxx/cmake/caches/Armv7M-picolibc.cmake b/libcxx/cmake/caches/Armv7M-picolibc.cmake +index 9f8863943444..3ac426ad7948 100644 +--- a/libcxx/cmake/caches/Armv7M-picolibc.cmake ++++ b/libcxx/cmake/caches/Armv7M-picolibc.cmake +@@ -17,6 +17,9 @@ set(LIBCXXABI_ENABLE_EXCEPTIONS OFF CACHE BOOL "") + set(LIBCXXABI_ENABLE_SHARED OFF CACHE BOOL "") + set(LIBCXXABI_ENABLE_STATIC ON CACHE BOOL "") + set(LIBCXXABI_ENABLE_THREADS OFF CACHE BOOL "") ++# Long tests are prohibitively slow when run via emulation. ++# The emulated target has limited memory. ++set(LIBCXXABI_TEST_PARAMS "long_tests=False large_tests=False" CACHE STRING "") + set(LIBCXXABI_USE_COMPILER_RT ON CACHE BOOL "") + set(LIBCXXABI_USE_LLVM_UNWINDER ON CACHE BOOL "") + set(LIBCXX_ENABLE_EXCEPTIONS OFF CACHE BOOL "") +@@ -30,12 +33,16 @@ set(LIBCXX_ENABLE_THREADS OFF CACHE BOOL "") + set(LIBCXX_ENABLE_WIDE_CHARACTERS OFF CACHE BOOL "") + set(LIBCXX_INCLUDE_BENCHMARKS OFF CACHE BOOL "") + # Long tests are prohibitively slow when run via emulation. +-set(LIBCXX_TEST_PARAMS "long_tests=False" CACHE STRING "") ++# The emulated target has limited memory. ++set(LIBCXX_TEST_PARAMS "long_tests=False large_tests=False" CACHE STRING "") + set(LIBCXX_USE_COMPILER_RT ON CACHE BOOL "") + set(LIBUNWIND_ENABLE_SHARED OFF CACHE BOOL "") + set(LIBUNWIND_ENABLE_STATIC ON CACHE BOOL "") + set(LIBUNWIND_ENABLE_THREADS OFF CACHE BOOL "") + set(LIBUNWIND_IS_BAREMETAL ON CACHE BOOL "") + set(LIBUNWIND_REMEMBER_HEAP_ALLOC ON CACHE BOOL "") ++# Long tests are prohibitively slow when run via emulation. ++# The emulated target has limited memory. ++set(LIBUNWIND_TEST_PARAMS "long_tests=False large_tests=False" CACHE STRING "") + set(LIBUNWIND_USE_COMPILER_RT ON CACHE BOOL "") + find_program(QEMU_SYSTEM_ARM qemu-system-arm) +diff --git a/libcxxabi/test/test_demangle.pass.cpp b/libcxxabi/test/test_demangle.pass.cpp +index b7e41099ebfc..8f04caba6ad9 100644 +--- a/libcxxabi/test/test_demangle.pass.cpp ++++ b/libcxxabi/test/test_demangle.pass.cpp +@@ -10,7 +10,7 @@ + // XFAIL: stdlib=apple-libc++ && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}} + + // This test is too big for most embedded devices. +-// XFAIL: LIBCXX-PICOLIBC-FIXME ++// REQUIRES: large_tests + + // https://llvm.org/PR51407 was not fixed in some previously-released + // demanglers, which causes them to run into the infinite loop. +-- +2.34.1 + diff --git a/patches/llvm-project/0006-Disable-failing-compiler-rt-test.patch b/patches/llvm-project/0004-Disable-failing-compiler-rt-test.patch similarity index 92% rename from patches/llvm-project/0006-Disable-failing-compiler-rt-test.patch rename to patches/llvm-project/0004-Disable-failing-compiler-rt-test.patch index 884f8347..bf51cc3f 100644 --- a/patches/llvm-project/0006-Disable-failing-compiler-rt-test.patch +++ b/patches/llvm-project/0004-Disable-failing-compiler-rt-test.patch @@ -1,4 +1,4 @@ -From a75e049595315ab4827eb2ff36a8f62b95eae70c Mon Sep 17 00:00:00 2001 +From 83c5054ea596497ceca96b7605f0f2d2b69884e7 Mon Sep 17 00:00:00 2001 From: Piotr Przybyla Date: Wed, 15 Nov 2023 16:04:24 +0000 Subject: Disable failing compiler-rt test diff --git a/patches/llvm-project/0005-disable-large-tests.patch b/patches/llvm-project/0005-disable-large-tests.patch deleted file mode 100644 index 9102b64b..00000000 --- a/patches/llvm-project/0005-disable-large-tests.patch +++ /dev/null @@ -1,69 +0,0 @@ -From 763821bc0f57ad93e741d64b98c09d5fef596104 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Dominik=20W=C3=B3jt?= -Date: Wed, 15 Nov 2023 12:18:35 +0100 -Subject: disable large tests - ---- - libcxx/test/configs/armv7m-picolibc-libc++.cfg.in | 2 ++ - libcxxabi/test/configs/armv7m-picolibc-libc++abi.cfg.in | 3 +++ - libcxxabi/test/test_demangle.pass.cpp | 2 +- - libunwind/test/configs/armv7m-picolibc-libunwind.cfg.in | 3 +++ - 4 files changed, 9 insertions(+), 1 deletion(-) - -diff --git a/libcxx/test/configs/armv7m-picolibc-libc++.cfg.in b/libcxx/test/configs/armv7m-picolibc-libc++.cfg.in -index 14526c007924..840e218dff3d 100644 ---- a/libcxx/test/configs/armv7m-picolibc-libc++.cfg.in -+++ b/libcxx/test/configs/armv7m-picolibc-libc++.cfg.in -@@ -39,6 +39,8 @@ config.substitutions.append(('%{exec}', - - # Long tests are prohibitively slow when run via emulation. - config.long_tests = False -+# The emulated target has limited memory. -+config.large_tests = False - - import os, site - site.addsitedir(os.path.join('@LIBCXX_SOURCE_DIR@', 'utils')) -diff --git a/libcxxabi/test/configs/armv7m-picolibc-libc++abi.cfg.in b/libcxxabi/test/configs/armv7m-picolibc-libc++abi.cfg.in -index b4744f935ad8..52aae63e82d6 100644 ---- a/libcxxabi/test/configs/armv7m-picolibc-libc++abi.cfg.in -+++ b/libcxxabi/test/configs/armv7m-picolibc-libc++abi.cfg.in -@@ -28,6 +28,9 @@ config.substitutions.append(('%{exec}', - ' --execdir %T' - )) - -+# The emulated target has limited memory. -+config.large_tests = False -+ - import os, site - site.addsitedir(os.path.join('@LIBCXXABI_LIBCXX_PATH@', 'utils')) - import libcxx.test.params, libcxx.test.config -diff --git a/libcxxabi/test/test_demangle.pass.cpp b/libcxxabi/test/test_demangle.pass.cpp -index 2b4e2011498d..25eb6f254f66 100644 ---- a/libcxxabi/test/test_demangle.pass.cpp -+++ b/libcxxabi/test/test_demangle.pass.cpp -@@ -10,7 +10,7 @@ - // XFAIL: stdlib=apple-libc++ && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}} - - // This test is too big for most embedded devices. --// XFAIL: LIBCXX-PICOLIBC-FIXME -+// REQUIRES: large_tests - - // https://llvm.org/PR51407 was not fixed in some previously-released - // demanglers, which causes them to run into the infinite loop. -diff --git a/libunwind/test/configs/armv7m-picolibc-libunwind.cfg.in b/libunwind/test/configs/armv7m-picolibc-libunwind.cfg.in -index e8f68a51fc53..55b8ce11d06f 100644 ---- a/libunwind/test/configs/armv7m-picolibc-libunwind.cfg.in -+++ b/libunwind/test/configs/armv7m-picolibc-libunwind.cfg.in -@@ -28,6 +28,9 @@ config.substitutions.append(('%{exec}', - ' --execdir %T' - )) - -+# The emulated target has limited memory. -+config.large_tests = False -+ - import os, site - site.addsitedir(os.path.join('@LIBUNWIND_LIBCXX_PATH@', 'utils')) - import libcxx.test.params, libcxx.test.config --- -2.34.1 - diff --git a/patches/llvm-project/0007-libc-tests-with-picolibc-handle-stdin.patch b/patches/llvm-project/0005-libc-tests-with-picolibc-handle-stdin.patch similarity index 96% rename from patches/llvm-project/0007-libc-tests-with-picolibc-handle-stdin.patch rename to patches/llvm-project/0005-libc-tests-with-picolibc-handle-stdin.patch index 64cb07ca..ff45ed1c 100644 --- a/patches/llvm-project/0007-libc-tests-with-picolibc-handle-stdin.patch +++ b/patches/llvm-project/0005-libc-tests-with-picolibc-handle-stdin.patch @@ -1,4 +1,4 @@ -From 26677138b697566f283715359171272842867ac9 Mon Sep 17 00:00:00 2001 +From 89830497518b26d39bbdaf8cb835ce9de3eab51c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20W=C3=B3jt?= Date: Mon, 23 Oct 2023 14:37:41 +0200 Subject: [libc++] tests with picolibc: handle stdin diff --git a/patches/llvm-project/0008-libc-tests-with-picolibc-add-has-compolete-fenv-feat.patch b/patches/llvm-project/0006-libc-tests-with-picolibc-add-has-compolete-fenv-feat.patch similarity index 97% rename from patches/llvm-project/0008-libc-tests-with-picolibc-add-has-compolete-fenv-feat.patch rename to patches/llvm-project/0006-libc-tests-with-picolibc-add-has-compolete-fenv-feat.patch index 084f668f..8c54cb6c 100644 --- a/patches/llvm-project/0008-libc-tests-with-picolibc-add-has-compolete-fenv-feat.patch +++ b/patches/llvm-project/0006-libc-tests-with-picolibc-add-has-compolete-fenv-feat.patch @@ -1,4 +1,4 @@ -From d9a35d088a49c8ca946e8e273089c88fe6724fc9 Mon Sep 17 00:00:00 2001 +From 69b8c896e78334d601e46aa0f29be523f15e461c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20W=C3=B3jt?= Date: Tue, 24 Oct 2023 12:12:27 +0200 Subject: [libc++] tests with picolibc: add has-compolete-fenv feature diff --git a/patches/llvm-project/0009-libc-tests-with-picolibc-Fix-expected-error-message.patch b/patches/llvm-project/0007-libc-tests-with-picolibc-Fix-expected-error-message.patch similarity index 97% rename from patches/llvm-project/0009-libc-tests-with-picolibc-Fix-expected-error-message.patch rename to patches/llvm-project/0007-libc-tests-with-picolibc-Fix-expected-error-message.patch index 0d58f941..a612970a 100644 --- a/patches/llvm-project/0009-libc-tests-with-picolibc-Fix-expected-error-message.patch +++ b/patches/llvm-project/0007-libc-tests-with-picolibc-Fix-expected-error-message.patch @@ -1,4 +1,4 @@ -From f8a81d827b1d63da46c794fa931285f6ebe9fc70 Mon Sep 17 00:00:00 2001 +From e1951f46391ed43dcae49afb592051bbcbb7397e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20W=C3=B3jt?= Date: Wed, 25 Oct 2023 12:27:18 +0200 Subject: [libc++] tests with picolibc: Fix expected error message diff --git a/patches/llvm-project/0010-libc-tests-with-picolibc-Fix-iterator-diff_type-to-s.patch b/patches/llvm-project/0008-libc-tests-with-picolibc-Fix-iterator-diff_type-to-s.patch similarity index 96% rename from patches/llvm-project/0010-libc-tests-with-picolibc-Fix-iterator-diff_type-to-s.patch rename to patches/llvm-project/0008-libc-tests-with-picolibc-Fix-iterator-diff_type-to-s.patch index 37e8505e..26d137e0 100644 --- a/patches/llvm-project/0010-libc-tests-with-picolibc-Fix-iterator-diff_type-to-s.patch +++ b/patches/llvm-project/0008-libc-tests-with-picolibc-Fix-iterator-diff_type-to-s.patch @@ -1,4 +1,4 @@ -From bc25322abaeabed5302e97e96b102d4f29fdb566 Mon Sep 17 00:00:00 2001 +From 00f5102bee1a415d31ee38f13b45f99cdf68217c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20W=C3=B3jt?= Date: Fri, 27 Oct 2023 14:33:48 +0200 Subject: [libc++] tests with picolibc: Fix iterator diff_type to diff --git a/patches/llvm-project/0011-libc-tests-with-picolibc-mark-sort-test-as-long-one.patch b/patches/llvm-project/0009-libc-tests-with-picolibc-mark-sort-test-as-long-one.patch similarity index 93% rename from patches/llvm-project/0011-libc-tests-with-picolibc-mark-sort-test-as-long-one.patch rename to patches/llvm-project/0009-libc-tests-with-picolibc-mark-sort-test-as-long-one.patch index 135f22d0..acf2b0c1 100644 --- a/patches/llvm-project/0011-libc-tests-with-picolibc-mark-sort-test-as-long-one.patch +++ b/patches/llvm-project/0009-libc-tests-with-picolibc-mark-sort-test-as-long-one.patch @@ -1,4 +1,4 @@ -From 3a96ac98b4330af2bd3bf3da546f10f74a1ab8b2 Mon Sep 17 00:00:00 2001 +From 72ce44d20936dc45a241e2ee728c5fae82769c4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20W=C3=B3jt?= Date: Thu, 9 Nov 2023 14:14:30 +0100 Subject: [libc++] tests with picolibc: mark sort test as long one diff --git a/patches/llvm-project/0012-libc-tests-with-picolibc-XFAIL-uses-of-atomics.patch b/patches/llvm-project/0010-libc-tests-with-picolibc-XFAIL-uses-of-atomics.patch similarity index 98% rename from patches/llvm-project/0012-libc-tests-with-picolibc-XFAIL-uses-of-atomics.patch rename to patches/llvm-project/0010-libc-tests-with-picolibc-XFAIL-uses-of-atomics.patch index 83e86d77..f46fe207 100644 --- a/patches/llvm-project/0012-libc-tests-with-picolibc-XFAIL-uses-of-atomics.patch +++ b/patches/llvm-project/0010-libc-tests-with-picolibc-XFAIL-uses-of-atomics.patch @@ -1,4 +1,4 @@ -From 59042dbd4f0afad0453aeb7a8e96a09b94d2c7be Mon Sep 17 00:00:00 2001 +From e3f16bc9e7947bf4f16b9760f6b97fab7ce98ec2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20W=C3=B3jt?= Date: Thu, 9 Nov 2023 15:25:14 +0100 Subject: [libc++] tests with picolibc: XFAIL uses of atomics diff --git a/patches/llvm-project/0013-libc-tests-with-picolibc-mark-two-more-large-tests.patch b/patches/llvm-project/0011-libc-tests-with-picolibc-mark-two-more-large-tests.patch similarity index 96% rename from patches/llvm-project/0013-libc-tests-with-picolibc-mark-two-more-large-tests.patch rename to patches/llvm-project/0011-libc-tests-with-picolibc-mark-two-more-large-tests.patch index b9a3219a..16253e7f 100644 --- a/patches/llvm-project/0013-libc-tests-with-picolibc-mark-two-more-large-tests.patch +++ b/patches/llvm-project/0011-libc-tests-with-picolibc-mark-two-more-large-tests.patch @@ -1,4 +1,4 @@ -From 52333466de30e14c056f5fa57ce3a225411d3b8d Mon Sep 17 00:00:00 2001 +From 71204b845198165770fbf68c1285abdda65c43e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20W=C3=B3jt?= Date: Wed, 22 Nov 2023 16:12:39 +0100 Subject: [libc++] tests with picolibc: mark two more large tests diff --git a/patches/llvm-project/0014-libc-tests-with-picolibc-xfail-test-missing-rt-libra.patch b/patches/llvm-project/0012-libc-tests-with-picolibc-xfail-test-missing-rt-libra.patch similarity index 95% rename from patches/llvm-project/0014-libc-tests-with-picolibc-xfail-test-missing-rt-libra.patch rename to patches/llvm-project/0012-libc-tests-with-picolibc-xfail-test-missing-rt-libra.patch index 1669a82d..9d3da9c7 100644 --- a/patches/llvm-project/0014-libc-tests-with-picolibc-xfail-test-missing-rt-libra.patch +++ b/patches/llvm-project/0012-libc-tests-with-picolibc-xfail-test-missing-rt-libra.patch @@ -1,4 +1,4 @@ -From 22a9ced293a5bc87619e9c28432c7d9137a2feb0 Mon Sep 17 00:00:00 2001 +From 890e0fffa3d0a29059d843876b65bcd2c679e43c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20W=C3=B3jt?= Date: Fri, 24 Nov 2023 10:18:29 +0100 Subject: [libc++] tests with picolibc: xfail test missing "rt" library