[libcxx-commits] [PATCH] D111329: [libc++] Add a from-scratch testing config for GCC

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Oct 7 11:54:59 PDT 2021


ldionne created this revision.
Herald added a subscriber: arichardson.
ldionne requested review of this revision.
Herald added a project: libc++.
Herald added a subscriber: libcxx-commits.
Herald added a reviewer: libc++.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D111329

Files:
  libcxx/test/configs/llvm-libc++-shared-gcc.cfg.in
  libcxx/utils/ci/run-buildbot


Index: libcxx/utils/ci/run-buildbot
===================================================================
--- libcxx/utils/ci/run-buildbot
+++ libcxx/utils/ci/run-buildbot
@@ -287,14 +287,15 @@
     export CC=gcc-11
     export CXX=g++-11
     clean
-    generate-cmake
+    generate-cmake -DLIBCXX_TEST_CONFIG="llvm-libc++-shared-gcc.cfg.in"
     check-runtimes
 ;;
 generic-gcc-cxx11)
     export CC=gcc-11
     export CXX=g++-11
     clean
-    generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx11.cmake"
+    generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx11.cmake" \
+                   -DLIBCXX_TEST_CONFIG="llvm-libc++-shared-gcc.cfg.in"
     check-runtimes
 ;;
 generic-asan)
Index: libcxx/test/configs/llvm-libc++-shared-gcc.cfg.in
===================================================================
--- /dev/null
+++ libcxx/test/configs/llvm-libc++-shared-gcc.cfg.in
@@ -0,0 +1,28 @@
+# This testing configuration handles running the test suite against LLVM's libc++
+# using a shared library, with GCC. This is done differently from Clang because
+# GCC does not support the -nostdlib++ command-line flag.
+
+import sys
+
+lit_config.load_config(config, '@CMAKE_CURRENT_BINARY_DIR@/cmake-bridge.cfg')
+
+config.substitutions.append(('%{flags}', ''))
+config.substitutions.append(('%{compile_flags}',
+    '-nostdinc++ -isystem %{include} -isystem %{target-include} -I %{libcxx}/test/support'
+))
+config.substitutions.append(('%{link_flags}',
+    '-L %{lib} -Wl,-rpath,%{lib} -nodefaultlibs -lc++ -lm -lgcc_s -lgcc -lpthread -lc -lgcc_s -lgcc -latomic'
+))
+config.substitutions.append(('%{exec}',
+    '{} %{{libcxx}}/utils/run.py --execdir %T -- '.format(sys.executable)
+))
+
+import os, site
+site.addsitedir(os.path.join('@LIBCXX_SOURCE_DIR@', 'utils'))
+import libcxx.test.params, libcxx.test.newconfig, libcxx.test.newconfig
+libcxx.test.newconfig.configure(
+    libcxx.test.params.DEFAULT_PARAMETERS,
+    libcxx.test.features.DEFAULT_FEATURES,
+    config,
+    lit_config
+)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D111329.377939.patch
Type: text/x-patch
Size: 2033 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20211007/ae305c82/attachment-0001.bin>


More information about the libcxx-commits mailing list