[libcxx-commits] [PATCH] D108836: [libc++] Support -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=on in CI

Fangrui Song via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri Aug 27 12:30:32 PDT 2021


MaskRay created this revision.
MaskRay added reviewers: ldionne, mstorsjo, phosek.
Herald added subscribers: pengfei, arichardson.
MaskRay requested review of this revision.
Herald added a project: libc++.
Herald added a subscriber: libcxx-commits.
Herald added a reviewer: libc++.

This fixes -isystem/-L/-Wl,-rpath paths when -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=on
is used (https://reviews.llvm.org/D107799#2969650).

- `-isystem path/to/build/generic-cxx17/include/c++/v1`. `build/generic-cxx17/include/x86_64-unknown-linux-gnu/c++/v1 (__config_site)` is missing.
- `-L path/to/build/generic-cxx17/lib`. Should be `build/generic-cxx17/lib/x86_64-unknown-linux-gnu` instead


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D108836

Files:
  libcxx/test/configs/libcxx-trunk-shared.cfg.in
  libcxx/test/configs/libcxx-trunk-static.cfg.in
  libcxx/utils/ci/run-buildbot


Index: libcxx/utils/ci/run-buildbot
===================================================================
--- libcxx/utils/ci/run-buildbot
+++ libcxx/utils/ci/run-buildbot
@@ -81,6 +81,7 @@
           -B "${BUILD_DIR}" \
           -GNinja -DCMAKE_MAKE_PROGRAM="${NINJA}" \
           -DCMAKE_BUILD_TYPE=RelWithDebInfo \
+          -DCMAKE_CXX_COMPILER=$HOME/Stable/bin/clang++ -DCMAKE_C_COMPILER=$HOME/Stable/bin/clang \
           -DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \
           -DLLVM_LIT_ARGS="-sv --show-unsupported --xunit-xml-output test-results.xml" \
           "${@}"
Index: libcxx/test/configs/libcxx-trunk-static.cfg.in
===================================================================
--- libcxx/test/configs/libcxx-trunk-static.cfg.in
+++ libcxx/test/configs/libcxx-trunk-static.cfg.in
@@ -7,6 +7,9 @@
 COMPILER = "@CMAKE_CXX_COMPILER@"
 EXEC_ROOT = "@LIBCXX_BINARY_DIR@"
 CMAKE_OSX_SYSROOT = "@CMAKE_OSX_SYSROOT@"
+INCLUDE_DIR = "@LIBCXX_INSTALL_INCLUDE_DIR@"
+INCLUDE_TARGET_DIR = "@LIBCXX_INSTALL_INCLUDE_TARGET_DIR@"
+LIBRARY_DIR = "@LIBCXX_INSTALL_LIBRARY_DIR@"
 
 import os
 import pipes
@@ -32,13 +35,14 @@
     '-isysroot {}'.format(CMAKE_OSX_SYSROOT) if CMAKE_OSX_SYSROOT else ''
 ))
 config.substitutions.append(('%{compile_flags}',
-    '-nostdinc++ -isystem {} -I {}'.format(
-        os.path.join(INSTALL_ROOT, 'include', 'c++', 'v1'),
+    '-nostdinc++ -isystem {} -isystem {} -I {}'.format(
+        os.path.join(INSTALL_ROOT, INCLUDE_DIR),
+        os.path.join(INSTALL_ROOT, INCLUDE_TARGET_DIR),
         os.path.join(LIBCXX_ROOT, 'test', 'support'))
 ))
 config.substitutions.append(('%{link_flags}',
     '-nostdlib++ -L {} -lc++ -lc++abi -pthread'.format(
-        os.path.join(INSTALL_ROOT, 'lib'))
+        os.path.join(INSTALL_ROOT, LIBRARY_DIR))
 ))
 config.substitutions.append(('%{exec}',
     '{} {} --execdir %T -- '.format(
Index: libcxx/test/configs/libcxx-trunk-shared.cfg.in
===================================================================
--- libcxx/test/configs/libcxx-trunk-shared.cfg.in
+++ libcxx/test/configs/libcxx-trunk-shared.cfg.in
@@ -7,6 +7,9 @@
 COMPILER = "@CMAKE_CXX_COMPILER@"
 EXEC_ROOT = "@LIBCXX_BINARY_DIR@"
 CMAKE_OSX_SYSROOT = "@CMAKE_OSX_SYSROOT@"
+INCLUDE_DIR = "@LIBCXX_INSTALL_INCLUDE_DIR@"
+INCLUDE_TARGET_DIR = "@LIBCXX_INSTALL_INCLUDE_TARGET_DIR@"
+LIBRARY_DIR = "@LIBCXX_INSTALL_LIBRARY_DIR@"
 
 import os
 import pipes
@@ -32,13 +35,14 @@
     '-isysroot {}'.format(CMAKE_OSX_SYSROOT) if CMAKE_OSX_SYSROOT else ''
 ))
 config.substitutions.append(('%{compile_flags}',
-    '-nostdinc++ -isystem {} -I {}'.format(
-        os.path.join(INSTALL_ROOT, 'include', 'c++', 'v1'),
+    '-nostdinc++ -isystem {} -isystem {} -I {}'.format(
+        os.path.join(INSTALL_ROOT, INCLUDE_DIR),
+        os.path.join(INSTALL_ROOT, INCLUDE_TARGET_DIR),
         os.path.join(LIBCXX_ROOT, 'test', 'support'))
 ))
 config.substitutions.append(('%{link_flags}',
     '-nostdlib++ -L {0} -lc++ -Wl,-rpath,{0} -pthread'.format(
-        os.path.join(INSTALL_ROOT, 'lib'))
+        os.path.join(INSTALL_ROOT, LIBRARY_DIR))
 ))
 config.substitutions.append(('%{exec}',
     '{} {} --execdir %T -- '.format(


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D108836.369160.patch
Type: text/x-patch
Size: 3170 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20210827/ba61d944/attachment.bin>


More information about the libcxx-commits mailing list