Skip to content

Commit f540d2b

Browse files
authored
libc++ tests: prevent looking for unneeded "rt" library (#389)
1 parent b5dc3f1 commit f540d2b

8 files changed

+136
-14
lines changed

patches/llvm-project/0001-libc-tests-with-picolibc-xfail-two-remaining-tests.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
From 60dbe1130f49bc2e79590dc821c8f1bf9f012156 Mon Sep 17 00:00:00 2001
1+
From a225212af98c5030f5ad6e92b8e149ebb23b33a6 Mon Sep 17 00:00:00 2001
22
From: =?UTF-8?q?Dominik=20W=C3=B3jt?= <[email protected]>
33
Date: Mon, 16 Oct 2023 11:35:48 +0200
44
Subject: [libc++] tests with picolibc: xfail two remaining tests

patches/llvm-project/0002-libc-tests-with-picolibc-disable-large-tests.patch

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
From 08b2f73f8e2e4fd6f30261f3dff46708857ee62d Mon Sep 17 00:00:00 2001
1+
From 309e9168febae9c240daf3f507b360ef2688904c Mon Sep 17 00:00:00 2001
22
From: =?UTF-8?q?Dominik=20W=C3=B3jt?= <[email protected]>
33
Date: Wed, 15 Nov 2023 12:18:35 +0100
44
Subject: [libc++] tests with picolibc: disable large tests
@@ -9,7 +9,7 @@ Subject: [libc++] tests with picolibc: disable large tests
99
2 files changed, 9 insertions(+), 2 deletions(-)
1010

1111
diff --git a/libcxx/cmake/caches/Armv7M-picolibc.cmake b/libcxx/cmake/caches/Armv7M-picolibc.cmake
12-
index b5f9089308d2..fedf13548131 100644
12+
index b5f9089308d2..0a83e75ceceb 100644
1313
--- a/libcxx/cmake/caches/Armv7M-picolibc.cmake
1414
+++ b/libcxx/cmake/caches/Armv7M-picolibc.cmake
1515
@@ -18,6 +18,9 @@ set(LIBCXXABI_ENABLE_SHARED OFF CACHE BOOL "")
@@ -18,7 +18,7 @@ index b5f9089308d2..fedf13548131 100644
1818
set(LIBCXXABI_ENABLE_THREADS OFF CACHE BOOL "")
1919
+# Long tests are prohibitively slow when run via emulation.
2020
+# The emulated target has limited memory.
21-
+set(LIBCXXABI_TEST_PARAMS "long_tests=False large_tests=False" CACHE STRING "")
21+
+set(LIBCXXABI_TEST_PARAMS "long_tests=False;large_tests=False" CACHE STRING "")
2222
set(LIBCXXABI_USE_COMPILER_RT ON CACHE BOOL "")
2323
set(LIBCXX_ENABLE_EXCEPTIONS ON CACHE BOOL "")
2424
set(LIBCXX_ENABLE_FILESYSTEM OFF CACHE STRING "")
@@ -28,7 +28,7 @@ index b5f9089308d2..fedf13548131 100644
2828
# Long tests are prohibitively slow when run via emulation.
2929
-set(LIBCXX_TEST_PARAMS "long_tests=False" CACHE STRING "")
3030
+# The emulated target has limited memory.
31-
+set(LIBCXX_TEST_PARAMS "long_tests=False large_tests=False" CACHE STRING "")
31+
+set(LIBCXX_TEST_PARAMS "long_tests=False;large_tests=False" CACHE STRING "")
3232
set(LIBCXX_USE_COMPILER_RT ON CACHE BOOL "")
3333
set(LIBUNWIND_ENABLE_SHARED OFF CACHE BOOL "")
3434
set(LIBUNWIND_ENABLE_STATIC ON CACHE BOOL "")
@@ -37,7 +37,7 @@ index b5f9089308d2..fedf13548131 100644
3737
set(LIBUNWIND_REMEMBER_HEAP_ALLOC ON CACHE BOOL "")
3838
+# Long tests are prohibitively slow when run via emulation.
3939
+# The emulated target has limited memory.
40-
+set(LIBUNWIND_TEST_PARAMS "long_tests=False large_tests=False" CACHE STRING "")
40+
+set(LIBUNWIND_TEST_PARAMS "long_tests=False;large_tests=False" CACHE STRING "")
4141
set(LIBUNWIND_USE_COMPILER_RT ON CACHE BOOL "")
4242
find_program(QEMU_SYSTEM_ARM qemu-system-arm REQUIRED)
4343
diff --git a/libcxxabi/test/test_demangle.pass.cpp b/libcxxabi/test/test_demangle.pass.cpp

patches/llvm-project/0003-Disable-failing-compiler-rt-test.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
From 019b0593a2fea25a5cc6c78210c02ffabe5bc7dd Mon Sep 17 00:00:00 2001
1+
From 70171f09fbfafe088bb63dc1709d632a8d38d3fa Mon Sep 17 00:00:00 2001
22
From: Piotr Przybyla <[email protected]>
33
Date: Wed, 15 Nov 2023 16:04:24 +0000
44
Subject: Disable failing compiler-rt test

patches/llvm-project/0004-libc-tests-with-picolibc-mark-sort-test-as-long-one.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
From 4b433e4baba54480bde65465a3abc70c3357d611 Mon Sep 17 00:00:00 2001
1+
From dbf12762bbafad2c1edce25b37699fa573fc17ee Mon Sep 17 00:00:00 2001
22
From: =?UTF-8?q?Dominik=20W=C3=B3jt?= <[email protected]>
33
Date: Thu, 9 Nov 2023 14:14:30 +0100
44
Subject: [libc++] tests with picolibc: mark sort test as long one

patches/llvm-project/0005-libc-tests-with-picolibc-XFAIL-uses-of-atomics.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
From 1044139f897608b9f684c614211e1ffb9639529c Mon Sep 17 00:00:00 2001
1+
From bc5eb3dd38da8273d8883823f89a31fd67e162c1 Mon Sep 17 00:00:00 2001
22
From: =?UTF-8?q?Dominik=20W=C3=B3jt?= <[email protected]>
33
Date: Thu, 9 Nov 2023 15:25:14 +0100
44
Subject: [libc++] tests with picolibc: XFAIL uses of atomics

patches/llvm-project/0006-libc-tests-with-picolibc-mark-two-more-large-tests.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
From dde9dae50d209a05ad11edd1ba938230a479cce2 Mon Sep 17 00:00:00 2001
1+
From ae6dd285f85f6b771fded2bb77baaa6e7986bf3c Mon Sep 17 00:00:00 2001
22
From: =?UTF-8?q?Dominik=20W=C3=B3jt?= <[email protected]>
33
Date: Wed, 22 Nov 2023 16:12:39 +0100
44
Subject: [libc++] tests with picolibc: mark two more large tests

patches/llvm-project/0007-libc-tests-with-picoilbc-protect-absent-atomic-types.patch renamed to patches/llvm-project/0007-libc-tests-with-picolibc-protect-absent-atomic-types.patch

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
From f69c5ad51f5a148c6b3ee917ba7897d7d1c01269 Mon Sep 17 00:00:00 2001
1+
From fac4a4499279bd0c44177c47a7f163adc0269baf Mon Sep 17 00:00:00 2001
22
From: =?UTF-8?q?Dominik=20W=C3=B3jt?= <[email protected]>
33
Date: Mon, 19 Feb 2024 11:23:25 +0100
4-
Subject: [libc++] tests with picoilbc: protect absent atomic types with ifdef
4+
Subject: [libc++] tests with picolibc: protect absent atomic types with ifdef
55

6-
On some platforms, like armv4t, there are currently no atomic types at
7-
all. This ifdef prevents module from trying to import absent types.
86
---
97
libcxx/modules/std/atomic.inc | 2 ++
108
1 file changed, 2 insertions(+)
Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
From 8939fb173dc8c649976e3eef90c61d2ef76233cd Mon Sep 17 00:00:00 2001
2+
From: =?UTF-8?q?Dominik=20W=C3=B3jt?= <[email protected]>
3+
Date: Mon, 19 Feb 2024 16:40:17 +0100
4+
Subject: [libc++] tests with picolibc: prevent looking for unneeded "rt"
5+
library
6+
7+
The clock_gettime function is provided by picolibc. There is no need to
8+
link to "rt" library, to have it. If still trying to link to "rt",
9+
following error is given:
10+
unable to find library from dependent library specifier: rt
11+
---
12+
libcxx/cmake/config-ix.cmake | 7 ++++++-
13+
.../time/time.clock/time.clock.file/to_from_sys.pass.cpp | 3 ---
14+
.../test/std/time/time.clock/time.clock.hires/now.pass.cpp | 3 ---
15+
.../time/time.clock/time.clock.system/from_time_t.pass.cpp | 3 ---
16+
.../std/time/time.clock/time.clock.system/now.pass.cpp | 3 ---
17+
.../time/time.clock/time.clock.system/to_time_t.pass.cpp | 3 ---
18+
.../time.point/time.point.nonmember/op_-duration.pass.cpp | 3 ---
19+
7 files changed, 6 insertions(+), 19 deletions(-)
20+
21+
diff --git a/libcxx/cmake/config-ix.cmake b/libcxx/cmake/config-ix.cmake
22+
index 1e8c2f5ce463..24f158f03bcd 100644
23+
--- a/libcxx/cmake/config-ix.cmake
24+
+++ b/libcxx/cmake/config-ix.cmake
25+
@@ -118,6 +118,11 @@ elseif(ANDROID)
26+
set(LIBCXX_HAS_ATOMIC_LIB NO)
27+
else()
28+
check_library_exists(pthread pthread_create "" LIBCXX_HAS_PTHREAD_LIB)
29+
- check_library_exists(rt clock_gettime "" LIBCXX_HAS_RT_LIB)
30+
+ check_library_exists("" clock_gettime "" LIBCXX_HAS_RT_FUNC_WITHOUT_LIB)
31+
+ if (LIBCXX_HAS_RT_FUNC_WITHOUT_LIB)
32+
+ set(LIBCXX_HAS_RT_LIB NO)
33+
+ else()
34+
+ check_library_exists("" clock_gettime "" LIBCXX_HAS_RT_FUNC_WITHOUT_LIB)
35+
+ endif()
36+
check_library_exists(atomic __atomic_fetch_add_8 "" LIBCXX_HAS_ATOMIC_LIB)
37+
endif()
38+
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
39+
index b1031c815610..5b1f46599111 100644
40+
--- a/libcxx/test/std/time/time.clock/time.clock.file/to_from_sys.pass.cpp
41+
+++ b/libcxx/test/std/time/time.clock/time.clock.file/to_from_sys.pass.cpp
42+
@@ -10,9 +10,6 @@
43+
44+
// UNSUPPORTED: availability-filesystem-missing
45+
46+
-// "unable to find library from dependent library specifier: rt"
47+
-// XFAIL: LIBCXX-PICOLIBC-FIXME
48+
-
49+
// <chrono>
50+
//
51+
// file_clock
52+
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
53+
index 8625ac58bde5..db1fb55df907 100644
54+
--- a/libcxx/test/std/time/time.clock/time.clock.hires/now.pass.cpp
55+
+++ b/libcxx/test/std/time/time.clock/time.clock.hires/now.pass.cpp
56+
@@ -6,9 +6,6 @@
57+
//
58+
//===----------------------------------------------------------------------===//
59+
60+
-// "unable to find library from dependent library specifier: rt"
61+
-// XFAIL: LIBCXX-PICOLIBC-FIXME
62+
-
63+
// <chrono>
64+
65+
// high_resolution_clock
66+
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
67+
index 5ff667445b1a..70dd8117e6ce 100644
68+
--- a/libcxx/test/std/time/time.clock/time.clock.system/from_time_t.pass.cpp
69+
+++ b/libcxx/test/std/time/time.clock/time.clock.system/from_time_t.pass.cpp
70+
@@ -6,9 +6,6 @@
71+
//
72+
//===----------------------------------------------------------------------===//
73+
74+
-// "unable to find library from dependent library specifier: rt"
75+
-// XFAIL: LIBCXX-PICOLIBC-FIXME
76+
-
77+
// <chrono>
78+
79+
// system_clock
80+
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
81+
index 70fbe98d8dfd..dade6bafa471 100644
82+
--- a/libcxx/test/std/time/time.clock/time.clock.system/now.pass.cpp
83+
+++ b/libcxx/test/std/time/time.clock/time.clock.system/now.pass.cpp
84+
@@ -6,9 +6,6 @@
85+
//
86+
//===----------------------------------------------------------------------===//
87+
88+
-// "unable to find library from dependent library specifier: rt"
89+
-// XFAIL: LIBCXX-PICOLIBC-FIXME
90+
-
91+
// <chrono>
92+
93+
// system_clock
94+
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
95+
index f3238f7bb1bb..bf4339c32d1c 100644
96+
--- a/libcxx/test/std/time/time.clock/time.clock.system/to_time_t.pass.cpp
97+
+++ b/libcxx/test/std/time/time.clock/time.clock.system/to_time_t.pass.cpp
98+
@@ -6,9 +6,6 @@
99+
//
100+
//===----------------------------------------------------------------------===//
101+
102+
-// "unable to find library from dependent library specifier: rt"
103+
-// XFAIL: LIBCXX-PICOLIBC-FIXME
104+
-
105+
// <chrono>
106+
107+
// system_clock
108+
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
109+
index 199bdec66878..80e9d04a769f 100644
110+
--- a/libcxx/test/std/time/time.point/time.point.nonmember/op_-duration.pass.cpp
111+
+++ b/libcxx/test/std/time/time.point/time.point.nonmember/op_-duration.pass.cpp
112+
@@ -6,9 +6,6 @@
113+
//
114+
//===----------------------------------------------------------------------===//
115+
116+
-// "unable to find library from dependent library specifier: rt"
117+
-// XFAIL: LIBCXX-PICOLIBC-FIXME
118+
-
119+
// <chrono>
120+
121+
// time_point
122+
--
123+
2.34.1
124+

0 commit comments

Comments
 (0)