Skip to content

Commit 92bbcfa

Browse files
committed
[libunwind] Tidy-up the testing configuration for libunwind
Start testing Apple backdeployment with older libunwinds, and stop explicitly specifying the libunwind testing config, since it is already selected correctly by default. Differential Revision: https://reviews.llvm.org/D126470
1 parent 75acec8 commit 92bbcfa

File tree

4 files changed

+112
-78
lines changed

4 files changed

+112
-78
lines changed

libcxx/utils/ci/run-buildbot

Lines changed: 44 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -193,78 +193,67 @@ check-generated-output)
193193
;;
194194
generic-cxx03)
195195
clean
196-
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx03.cmake" \
197-
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
196+
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx03.cmake"
198197
check-runtimes
199198
check-abi-list
200199
;;
201200
generic-cxx11)
202201
clean
203-
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx11.cmake" \
204-
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
202+
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx11.cmake"
205203
check-runtimes
206204
check-abi-list
207205
;;
208206
generic-cxx14)
209207
clean
210-
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx14.cmake" \
211-
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
208+
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx14.cmake"
212209
check-runtimes
213210
check-abi-list
214211
;;
215212
generic-cxx17)
216213
clean
217-
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx17.cmake" \
218-
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
214+
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx17.cmake"
219215
check-runtimes
220216
check-abi-list
221217
;;
222218
generic-cxx20)
223219
clean
224-
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx20.cmake" \
225-
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
220+
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx20.cmake"
226221
check-runtimes
227222
check-abi-list
228223
;;
229224
generic-cxx2b)
230225
clean
231-
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx2b.cmake" \
232-
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
226+
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx2b.cmake"
233227
check-runtimes
234228
check-abi-list
235229
;;
236230
generic-assertions)
237231
clean
238-
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-assertions.cmake" \
239-
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
232+
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-assertions.cmake"
240233
check-runtimes
241234
check-abi-list
242235
;;
243236
generic-debug-iterators)
244237
clean
245-
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-debug-iterators.cmake" \
246-
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
238+
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-debug-iterators.cmake"
247239
check-runtimes
248240
check-abi-list
249241
;;
250242
generic-noexceptions)
251243
clean
252-
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-noexceptions.cmake" \
253-
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
244+
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-noexceptions.cmake"
254245
check-runtimes
255246
check-abi-list
256247
;;
257248
generic-modules)
258249
clean
259-
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-modules.cmake" \
260-
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
250+
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-modules.cmake"
261251
check-runtimes
262252
check-abi-list
263253
;;
264254
generic-static)
265255
clean
266-
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-static.cmake" \
267-
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-static.cfg.in"
256+
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-static.cmake"
268257
check-runtimes
269258
;;
270259
generic-merged)
@@ -279,24 +268,23 @@ generic-clang-13)
279268
export CC=clang-13
280269
export CXX=clang++-13
281270
clean
282-
generate-cmake -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
271+
generate-cmake
283272
check-runtimes
284273
check-abi-list
285274
;;
286275
generic-clang-14)
287276
export CC=clang-14
288277
export CXX=clang++-14
289278
clean
290-
generate-cmake -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
279+
generate-cmake
291280
check-runtimes
292281
check-abi-list
293282
;;
294283
generic-gcc)
295284
export CC=gcc-11
296285
export CXX=g++-11
297286
clean
298-
generate-cmake -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in" \
299-
-DLIBCXX_ENABLE_WERROR=NO \
287+
generate-cmake -DLIBCXX_ENABLE_WERROR=NO \
300288
-DLIBCXXABI_ENABLE_WERROR=NO \
301289
-DLIBUNWIND_ENABLE_WERROR=NO
302290
check-runtimes
@@ -306,96 +294,81 @@ generic-gcc-cxx11)
306294
export CXX=g++-11
307295
clean
308296
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx11.cmake" \
309-
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in" \
310297
-DLIBCXX_ENABLE_WERROR=NO \
311298
-DLIBCXXABI_ENABLE_WERROR=NO \
312299
-DLIBUNWIND_ENABLE_WERROR=NO
313300
check-runtimes
314301
;;
315302
generic-asan)
316303
clean
317-
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-asan.cmake" \
318-
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
304+
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-asan.cmake"
319305
check-runtimes
320306
;;
321307
generic-msan)
322308
clean
323-
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-msan.cmake" \
324-
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
309+
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-msan.cmake"
325310
check-runtimes
326311
;;
327312
generic-tsan)
328313
clean
329-
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-tsan.cmake" \
330-
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
314+
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-tsan.cmake"
331315
check-runtimes
332316
;;
333317
generic-ubsan)
334318
clean
335-
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-ubsan.cmake" \
336-
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
319+
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-ubsan.cmake"
337320
check-runtimes
338321
;;
339322
generic-with_llvm_unwinder)
340323
clean
341-
generate-cmake -DLIBCXXABI_USE_LLVM_UNWINDER=ON \
342-
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
324+
generate-cmake -DLIBCXXABI_USE_LLVM_UNWINDER=ON
343325
check-runtimes
344326
;;
345327
generic-no-threads)
346328
clean
347-
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-threads.cmake" \
348-
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
329+
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-threads.cmake"
349330
check-runtimes
350331
;;
351332
generic-no-debug)
352333
clean
353-
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-debug.cmake" \
354-
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
334+
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-debug.cmake"
355335
check-runtimes
356336
check-abi-list
357337
;;
358338
generic-no-filesystem)
359339
clean
360-
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-filesystem.cmake" \
361-
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
340+
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-filesystem.cmake"
362341
check-runtimes
363342
;;
364343
generic-no-random_device)
365344
clean
366-
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-random_device.cmake" \
367-
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
345+
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-random_device.cmake"
368346
check-runtimes
369347
;;
370348
generic-no-localization)
371349
clean
372-
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-localization.cmake" \
373-
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
350+
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-localization.cmake"
374351
check-runtimes
375352
;;
376353
generic-no-unicode)
377354
clean
378-
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-unicode.cmake" \
379-
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
355+
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-unicode.cmake"
380356
check-runtimes
381357
;;
382358
generic-no-wide-characters)
383359
clean
384-
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-wide-characters.cmake" \
385-
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
360+
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-wide-characters.cmake"
386361
check-runtimes
387362
;;
388363
generic-no-experimental)
389364
clean
390-
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-experimental.cmake" \
391-
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
365+
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-experimental.cmake"
392366
check-runtimes
393367
check-abi-list
394368
;;
395369
generic-abi-unstable)
396370
clean
397-
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-abi-unstable.cmake" \
398-
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
371+
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-abi-unstable.cmake"
399372
check-runtimes
400373
;;
401374
apple-system)
@@ -427,10 +400,13 @@ apple-system-backdeployment-*)
427400

428401
DEPLOYMENT_TARGET="${BUILDER#apple-system-backdeployment-}"
429402

430-
# TODO: On Apple platforms, we never produce libc++abi.1.dylib, always libc++abi.dylib.
431-
# Fix that in the build so that the tests stop searching for @rpath/libc++abi.1.dylib.
403+
# TODO: On Apple platforms, we never produce libc++abi.1.dylib or libunwind.1.dylib,
404+
# only libc++abi.dylib and libunwind.dylib. Fix that in the build so that the
405+
# tests stop searching for @rpath/libc++abi.1.dylib and @rpath/libunwind.1.dylib.
432406
cp "${OSX_ROOTS}/macOS/libc++abi/${DEPLOYMENT_TARGET}/libc++abi.dylib" \
433407
"${OSX_ROOTS}/macOS/libc++abi/${DEPLOYMENT_TARGET}/libc++abi.1.dylib"
408+
cp "${OSX_ROOTS}/macOS/libunwind/${DEPLOYMENT_TARGET}/libunwind.dylib" \
409+
"${OSX_ROOTS}/macOS/libunwind/${DEPLOYMENT_TARGET}/libunwind.1.dylib"
434410

435411
arch="$(uname -m)"
436412
PARAMS="target_triple=${arch}-apple-macosx${DEPLOYMENT_TARGET}"
@@ -439,18 +415,19 @@ apple-system-backdeployment-*)
439415
PARAMS+=";unwind_runtime_root=${OSX_ROOTS}/macOS/libunwind/${DEPLOYMENT_TARGET}"
440416
PARAMS+=";use_system_cxx_lib=True"
441417

442-
# TODO: We should run the libunwind tests using the back-deployment dylibs too.
443418
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Apple.cmake" \
444419
-DLIBCXX_TEST_CONFIG="apple-libc++-backdeployment.cfg.in" \
445420
-DLIBCXXABI_TEST_CONFIG="apple-libc++abi-backdeployment.cfg.in" \
421+
-DLIBUNWIND_TEST_CONFIG="apple-libunwind-backdeployment.cfg.in" \
446422
-DLIBCXX_TEST_PARAMS="${PARAMS}" \
447-
-DLIBCXXABI_TEST_PARAMS="${PARAMS}"
423+
-DLIBCXXABI_TEST_PARAMS="${PARAMS}" \
424+
-DLIBUNWIND_TEST_PARAMS="${PARAMS}"
448425

449426
check-runtimes
450427
;;
451428
benchmarks)
452429
clean
453-
generate-cmake -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
430+
generate-cmake
454431
check-cxx-benchmarks
455432
;;
456433
documentation)
@@ -475,8 +452,7 @@ bootstrapping-build)
475452
-DLLVM_RUNTIME_TARGETS="$(c++ --print-target-triple)" \
476453
-DLLVM_TARGETS_TO_BUILD="host" \
477454
-DRUNTIMES_BUILD_ALLOW_DARWIN=ON \
478-
-DLLVM_ENABLE_ASSERTIONS=ON \
479-
-DRUNTIMES_LIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
455+
-DLLVM_ENABLE_ASSERTIONS=ON
480456

481457
echo "+++ Running the libc++ and libc++abi tests"
482458
${NINJA} -C "${BUILD_DIR}" check-runtimes
@@ -506,42 +482,36 @@ legacy-project-build)
506482
;;
507483
aarch64)
508484
clean
509-
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/AArch64.cmake" \
510-
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
485+
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/AArch64.cmake"
511486
check-runtimes
512487
;;
513488
aarch64-noexceptions)
514489
clean
515490
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/AArch64.cmake" \
516491
-DLIBCXX_ENABLE_EXCEPTIONS=OFF \
517-
-DLIBCXXABI_ENABLE_EXCEPTIONS=OFF \
518-
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
492+
-DLIBCXXABI_ENABLE_EXCEPTIONS=OFF
519493
check-runtimes
520494
;;
521495
# Aka Armv8 32 bit
522496
armv8)
523497
clean
524-
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Armv8Arm.cmake" \
525-
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
498+
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Armv8Arm.cmake"
526499
check-runtimes
527500
;;
528501
armv8-noexceptions)
529502
clean
530-
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Armv8Thumb-noexceptions.cmake" \
531-
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
503+
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Armv8Thumb-noexceptions.cmake"
532504
check-runtimes
533505
;;
534506
# Armv7 32 bit. One building Arm only one Thumb only code.
535507
armv7)
536508
clean
537-
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Armv7Arm.cmake" \
538-
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
509+
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Armv7Arm.cmake"
539510
check-runtimes
540511
;;
541512
armv7-noexceptions)
542513
clean
543-
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Armv7Thumb-noexceptions.cmake" \
544-
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
514+
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Armv7Thumb-noexceptions.cmake"
545515
check-runtimes
546516
;;
547517
clang-cl-dll)
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Testing configuration for back-deployment against older Apple system libunwind.
2+
#
3+
# Under this configuration, we compile and link all the test suite against the latest libunwind,
4+
# however we run against the libunwind on a different platform. This emulates the workflow of
5+
# a developer building their application using recent tools but with the goal of deploying
6+
# on existing devices running an older OS (and hence an older dylib).
7+
8+
import os, site
9+
site.addsitedir(os.path.join('@LIBUNWIND_LIBCXX_PATH@', 'utils'))
10+
import libcxx.test.params, libcxx.test.newconfig, libcxx.test.dsl
11+
12+
lit_config.load_config(config, '@CMAKE_CURRENT_BINARY_DIR@/cmake-bridge.cfg')
13+
14+
BACKDEPLOYMENT_PARAMETERS = [
15+
libcxx.test.dsl.Parameter(name='cxx_runtime_root', type=str,
16+
actions=lambda root: [libcxx.test.dsl.AddSubstitution('%{cxx-runtime-root}', root)],
17+
help="""
18+
The simulated root of the system (for libc++) when running tests.
19+
20+
This should be a directory hierarchy under which the libc++ dylib can be found.
21+
The dylib in that hierarchy is the one that will be used at runtime when running
22+
the tests.
23+
"""),
24+
libcxx.test.dsl.Parameter(name='abi_runtime_root', type=str,
25+
actions=lambda root: [libcxx.test.dsl.AddSubstitution('%{abi-runtime-root}', root)],
26+
help="""
27+
The simulated root of the system (for libc++abi) when running tests.
28+
29+
This should be a directory hierarchy under which the libc++abi dylib can be found.
30+
The dylib in that hierarchy is the one that will be used at runtime when running
31+
the tests.
32+
"""),
33+
libcxx.test.dsl.Parameter(name='unwind_runtime_root', type=str,
34+
actions=lambda root: [libcxx.test.dsl.AddSubstitution('%{unwind-runtime-root}', root)],
35+
help="""
36+
The simulated root of the system (for libunwind) when running tests.
37+
38+
This should be a directory hierarchy under which the libunwind dylib can be found.
39+
The dylib in that hierarchy is the one that will be used at runtime when running
40+
the tests.
41+
"""),
42+
]
43+
44+
config.substitutions.append(('%{flags}',
45+
'-isysroot {}'.format('@CMAKE_OSX_SYSROOT@') if '@CMAKE_OSX_SYSROOT@' else ''
46+
))
47+
config.substitutions.append(('%{compile_flags}',
48+
'-nostdinc++ -I %{include}'
49+
))
50+
config.substitutions.append(('%{link_flags}',
51+
'-nostdlib++ -L %{lib} -lc++ -lc++abi -lunwind'
52+
))
53+
config.substitutions.append(('%{exec}',
54+
'%{executor} --execdir %T --env DYLD_LIBRARY_PATH="%{cxx-runtime-root}:%{abi-runtime-root}:%{unwind-runtime-root}" -- '
55+
))
56+
57+
import os, site
58+
import libcxx.test.params, libcxx.test.newconfig, libcxx.test.newconfig
59+
libcxx.test.newconfig.configure(
60+
libcxx.test.params.DEFAULT_PARAMETERS + BACKDEPLOYMENT_PARAMETERS,
61+
libcxx.test.features.DEFAULT_FEATURES,
62+
config,
63+
lit_config
64+
)

0 commit comments

Comments
 (0)