Skip to content

Commit c07b80c

Browse files
committed
[libc++] Add a from-scratch testing config for GCC
Differential Revision: https://reviews.llvm.org/D111329
1 parent 976aa4d commit c07b80c

File tree

2 files changed

+31
-2
lines changed

2 files changed

+31
-2
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# This testing configuration handles running the test suite against LLVM's libc++
2+
# using a shared library, with GCC. This is done differently from Clang because
3+
# GCC does not support the -nostdlib++ command-line flag.
4+
5+
import sys
6+
7+
lit_config.load_config(config, '@CMAKE_CURRENT_BINARY_DIR@/cmake-bridge.cfg')
8+
9+
config.substitutions.append(('%{flags}', ''))
10+
config.substitutions.append(('%{compile_flags}',
11+
'-nostdinc++ -isystem %{include} -isystem %{target-include} -I %{libcxx}/test/support'
12+
))
13+
config.substitutions.append(('%{link_flags}',
14+
'-L %{lib} -Wl,-rpath,%{lib} -nodefaultlibs -lc++ -lm -lgcc_s -lgcc -lpthread -lc -lgcc_s -lgcc -latomic'
15+
))
16+
config.substitutions.append(('%{exec}',
17+
'{} %{{libcxx}}/utils/run.py --execdir %T -- '.format(sys.executable)
18+
))
19+
20+
import os, site
21+
site.addsitedir(os.path.join('@LIBCXX_SOURCE_DIR@', 'utils'))
22+
import libcxx.test.params, libcxx.test.newconfig, libcxx.test.newconfig
23+
libcxx.test.newconfig.configure(
24+
libcxx.test.params.DEFAULT_PARAMETERS,
25+
libcxx.test.features.DEFAULT_FEATURES,
26+
config,
27+
lit_config
28+
)

libcxx/utils/ci/run-buildbot

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,14 +287,15 @@ generic-gcc)
287287
export CC=gcc-11
288288
export CXX=g++-11
289289
clean
290-
generate-cmake
290+
generate-cmake -DLIBCXX_TEST_CONFIG="llvm-libc++-shared-gcc.cfg.in"
291291
check-runtimes
292292
;;
293293
generic-gcc-cxx11)
294294
export CC=gcc-11
295295
export CXX=g++-11
296296
clean
297-
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx11.cmake"
297+
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx11.cmake" \
298+
-DLIBCXX_TEST_CONFIG="llvm-libc++-shared-gcc.cfg.in"
298299
check-runtimes
299300
;;
300301
generic-asan)

0 commit comments

Comments
 (0)