[libcxx-commits] [libcxxabi] 8aeaceb - [libc++] Add initial support for picolibc
Louis Dionne via libcxx-commits
libcxx-commits at lists.llvm.org
Wed Nov 29 07:43:28 PST 2023
Author: Michael Platings
Date: 2023-11-29T10:43:16-05:00
New Revision: 8aeacebf288b2f5dc9d3f23e9ac9a4f910238504
URL: https://github.com/llvm/llvm-project/commit/8aeacebf288b2f5dc9d3f23e9ac9a4f910238504
DIFF: https://github.com/llvm/llvm-project/commit/8aeacebf288b2f5dc9d3f23e9ac9a4f910238504.diff
LOG: [libc++] Add initial support for picolibc
Picolibc is a C Standard Library that is commonly used in embedded
environments. This patch adds initial support for this configuration
along with pre-commit CI. As of this patch, the test suite only builds
the tests and nothing is run. A follow-up patch will make the test suite
actually run the tests.
Differential Revision: https://reviews.llvm.org/D154246
Added:
libcxx/cmake/caches/Armv7M-picolibc.cmake
libcxx/test/configs/armv7m-picolibc-libc++.cfg.in
libcxx/utils/ci/build-picolibc.sh
libcxxabi/test/configs/armv7m-picolibc-libc++abi.cfg.in
libunwind/test/configs/armv7m-picolibc-libunwind.cfg.in
Modified:
libcxx/docs/index.rst
libcxx/test/libcxx/atomics/atomics.types.generic/atomics.types.float/lockfree.pass.cpp
libcxx/test/libcxx/clang_modules_include.gen.py
libcxx/test/libcxx/selftest/dsl/dsl.sh.py
libcxx/test/libcxx/selftest/pass.cpp/run-error.pass.cpp
libcxx/test/libcxx/selftest/pass.mm/run-error.pass.mm
libcxx/test/libcxx/system_reserved_names.gen.py
libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/assign.pass.cpp
libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/compare_exchange_strong.pass.cpp
libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/compare_exchange_weak.pass.cpp
libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/ctor.pass.cpp
libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/exchange.pass.cpp
libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/fetch_add.pass.cpp
libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/fetch_sub.pass.cpp
libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/load.pass.cpp
libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/lockfree.pass.cpp
libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/notify_all.pass.cpp
libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/notify_one.pass.cpp
libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/operator.float.pass.cpp
libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/operator.minus_equals.pass.cpp
libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/operator.plus_equals.pass.cpp
libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/store.pass.cpp
libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/wait.pass.cpp
libcxx/test/std/atomics/atomics.types.generic/integral.pass.cpp
libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_add.pass.cpp
libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_add_explicit.pass.cpp
libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_and.pass.cpp
libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_and_explicit.pass.cpp
libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_or.pass.cpp
libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_or_explicit.pass.cpp
libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_sub.pass.cpp
libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_sub_explicit.pass.cpp
libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_xor.pass.cpp
libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_xor_explicit.pass.cpp
libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/ctor.pass.cpp
libcxx/test/std/depr/depr.c.headers/fenv_h.compile.pass.cpp
libcxx/test/std/depr/depr.c.headers/uchar_h.compile.pass.cpp
libcxx/test/std/experimental/simd/simd.reference/reference_assignment.pass.cpp
libcxx/test/std/input.output/iostream.objects/narrow.stream.objects/cerr.sh.cpp
libcxx/test/std/input.output/iostream.objects/narrow.stream.objects/clog.sh.cpp
libcxx/test/std/input.output/iostream.objects/narrow.stream.objects/cout.sh.cpp
libcxx/test/std/iterators/iterator.primitives/iterator.traits/cxx20_iterator_traits.compile.pass.cpp
libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/sized_delete_array14.pass.cpp
libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete14.pass.cpp
libcxx/test/std/language.support/support.runtime/ctime.timespec.compile.pass.cpp
libcxx/test/std/numerics/cfenv/cfenv.syn/cfenv.pass.cpp
libcxx/test/std/strings/c.strings/cuchar.compile.pass.cpp
libcxx/test/std/time/time.clock/time.clock.file/to_from_sys.pass.cpp
libcxx/test/std/time/time.clock/time.clock.hires/now.pass.cpp
libcxx/test/std/time/time.clock/time.clock.system/from_time_t.pass.cpp
libcxx/test/std/time/time.clock/time.clock.system/now.pass.cpp
libcxx/test/std/time/time.clock/time.clock.system/to_time_t.pass.cpp
libcxx/test/std/time/time.point/time.point.nonmember/op_-duration.pass.cpp
libcxx/utils/ci/BOT_OWNERS.txt
libcxx/utils/ci/buildkite-pipeline.yml
libcxx/utils/ci/run-buildbot
libcxx/utils/libcxx/test/features.py
libcxxabi/test/test_demangle.pass.cpp
Removed:
################################################################################
diff --git a/libcxx/cmake/caches/Armv7M-picolibc.cmake b/libcxx/cmake/caches/Armv7M-picolibc.cmake
new file mode 100644
index 000000000000000..6ed1866a50845fe
--- /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 c4199dc69d7c26c..7bb5512beb1f1fc 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 <DesignDocs/ABIVersioning>`
-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 <DesignDocs/ABIVersioning>`
+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 000000000000000..c0d23f136475eba
--- /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 46511530c7c7582..222c6d026fc0f1d 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 04c8e03affee594..26ef2077449b88f 100644
--- a/libcxx/test/libcxx/clang_modules_include.gen.py
+++ b/libcxx/test/libcxx/clang_modules_include.gen.py
@@ -39,6 +39,9 @@
// 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 dfe290b21fbb015..6c695a0d672ee07 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 eac7d8846e23a6f..1df98ef11191845 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 22e17666eab073c..02e8321c96b2303 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 e2aa8fc473483b9..8c4be97897f657e 100644
--- a/libcxx/test/libcxx/system_reserved_names.gen.py
+++ b/libcxx/test/libcxx/system_reserved_names.gen.py
@@ -63,7 +63,8 @@
#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 @@
# 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 8efb556cb5d99a5..3bdd8ae792cf7db 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 839d79d3a411052..b9e2fe40f955f74 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 097210cc4a9db26..f3ac52ff28cfee2 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 febabb4f2678261..d2f4a2bd64dc038 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 a8306304280c545..1807e48f7befbfe 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 0c59b50eb807051..a73c5f26b71f64f 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 4435e3fc19b4e90..d21a42e53a5469e 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 fa085275de2995b..2901af0a7f39d83 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 447e0f86500272b..7619d113a3408a6 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 e2320ed0b70ed13..143a034c55b7ffc 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 058424f5cee0593..debc9ddcdd32817 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 54c62ba8d091810..e0da122c3059b26 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 23ad0c5c819dc8e..0ee0232718afa86 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 0676645fcfa1518..1cdafaa4b5ab898 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 0bb1f00840a890f..957dbbe0d876e33 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 15f3613245a836e..6c4f65d3bc38630 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 2695ff94da30658..bb88f551bd06dba 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
+
// <atomic>
// 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 31563789227e9a0..069b64b097843ec 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
+
// <atomic>
// template<class T>
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 747a62ae1829542..2b75e915d22bc54 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
+
// <atomic>
// template<class T>
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 04b279ca9d4dfda..e106e1a38b0bbc4 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
+
// <atomic>
// template<class T>
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 f6887a28ce14724..ed878e222477f53 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
+
// <atomic>
// template<class T>
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 76a66dc6d478471..01e73f4503e0bd9 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
+
// <atomic>
// template<class T>
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 73161232ae7e572..f8ae8fbbd76a320 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
+
// <atomic>
// template<class T>
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 37a9586a0ba1aa3..9212f03b0fd9d33 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
+
// <atomic>
// template<class T>
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 19240968ee7e5fd..628b81521f1933b 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
+
// <atomic>
// template<class T>
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 3875f9e2161c1d0..0c648fce5749e04 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
+
// <atomic>
// template<class T>
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 7521a027755db22..4bdad43f19ff312 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
+
// <atomic>
// template<class T>
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 32baca49e3078ac..3ee44a1771b7ab5 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
+
// <atomic>
// constexpr atomic<T>::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 fda5e186c0362bc..dcc97573d607335 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
+
// <fenv.h>
#include <fenv.h>
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 2b64554666817d0..a1560c8ee5853c6 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 <uchar.h> yet, so these tests fail.
// XFAIL: target={{.+}}-apple-{{.+}}
+// mbrtoc16 not defined.
+// XFAIL: LIBCXX-PICOLIBC-FIXME
+
// <uchar.h>
#include <uchar.h>
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 04862507535362d..d37b4af563cc301 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
+
// <experimental/simd>
//
// [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 b9e274af7334111..9a4b437ab109a65 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
+
// <iostream>
// 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 476addba050d1c8..783be3a52e94dc3 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
+
// <iostream>
// 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 b8d319385ca1f71..1234da38de03148 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
+
// <iostream>
// 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 f6b7f6f9d463fa4..f56750bb495e15f 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<typename Traits::
diff erence_type, DiffType> 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<class T>
// 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 21663cdf956d425..901f2cca4ce03f1 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 a8701ce7a86cff5..d0b10b65be2835a 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 04c4c77edd5ed3d..12b1c3888132eb8 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 557a93cdefe06ca..7b3b490eba273a1 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
+
// <cfenv>
#include <cfenv>
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 db00cbde3336588..2076384deb2b230 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 <uchar.h> yet, so these tests fail.
// XFAIL: target={{.+}}-apple-{{.+}}
+// mbrtoc16 not defined.
+// XFAIL: LIBCXX-PICOLIBC-FIXME
+
// <cuchar>
#include <cuchar>
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 5b1f4659911118f..b1031c81561047f 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
+
// <chrono>
//
// 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 db1fb55df90721f..8625ac58bde5596 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
+
// <chrono>
// 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 70dd8117e6cef55..5ff667445b1a39d 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
+
// <chrono>
// 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 dade6bafa471bb7..70fbe98d8dfd12b 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
+
// <chrono>
// 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 bf4339c32d1ca99..f3238f7bb1bb523 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
+
// <chrono>
// 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 80e9d04a769fde3..199bdec66878a2a 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
+
// <chrono>
// time_point
diff --git a/libcxx/utils/ci/BOT_OWNERS.txt b/libcxx/utils/ci/BOT_OWNERS.txt
index 721b19e52d8bcb1..de575c59138318b 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 at lists.linaro.org
-D: Armv7, Armv8, AArch64
+D: Arm platforms
N: LLVM on Power
E: powerllvm at ca.ibm.com
diff --git a/libcxx/utils/ci/build-picolibc.sh b/libcxx/utils/ci/build-picolibc.sh
new file mode 100755
index 000000000000000..078c2bdf5ebccc4
--- /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 <<EOF
+Usage:
+${PROGNAME} [options]
+
+[-h|--help] Display this help and exit.
+
+--build-dir <DIR> Path to the directory to use for building.
+
+--install-dir <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 <<EOF > "${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 3c49247ab5aeeb9..06b0c55e6f3cab5 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 58c4c2a1021b600..445b1becee0c2a8 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 e1cfa032f1614e8..ab5a24dadb605b8 100644
--- a/libcxx/utils/libcxx/test/features.py
+++ b/libcxx/utils/libcxx/test/features.py
@@ -190,6 +190,17 @@ def _getAndroidDeviceApi(cfg):
""",
),
),
+ Feature(
+ name="has-64-bit-atomics",
+ when=lambda cfg: sourceBuilds(
+ cfg,
+ """
+ #include <atomic>
+ 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 @@ def _getAndroidDeviceApi(cfg):
#include <unistd.h>
#include <sys/wait.h>
int main(int, char**) {
- return 0;
+ int fd[2];
+ return pipe(fd);
}
""",
),
@@ -413,6 +425,19 @@ def _getAndroidDeviceApi(cfg):
name="LIBCXX-FREEBSD-FIXME",
when=lambda cfg: "__FreeBSD__" in compilerMacros(cfg),
),
+ Feature(
+ name="LIBCXX-PICOLIBC-FIXME",
+ when=lambda cfg: sourceBuilds(
+ cfg,
+ """
+ #include <string.h>
+ #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 000000000000000..cb5ede3ac67a179
--- /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 67d52088a9e7c9a..b7e41099ebfc53f 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 000000000000000..c2dd320ddfd1fb6
--- /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
+)
More information about the libcxx-commits
mailing list