[libcxx-commits] [libcxx] daf0dfb - [libc++] Support -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=on in CI

Fangrui Song via libcxx-commits libcxx-commits at lists.llvm.org
Mon Aug 30 12:59:14 PDT 2021


Author: Fangrui Song
Date: 2021-08-30T12:59:08-07:00
New Revision: daf0dfb786f0d72c2cd39a64a97f1593ccaebadf

URL: https://github.com/llvm/llvm-project/commit/daf0dfb786f0d72c2cd39a64a97f1593ccaebadf
DIFF: https://github.com/llvm/llvm-project/commit/daf0dfb786f0d72c2cd39a64a97f1593ccaebadf.diff

LOG: [libc++] Support -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=on in CI

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

Reviewed By: ldionne, phosek, #libc

Differential Revision: https://reviews.llvm.org/D108836

Added: 
    

Modified: 
    libcxx/test/configs/libcxx-trunk-shared.cfg.in
    libcxx/test/configs/libcxx-trunk-static.cfg.in

Removed: 
    


################################################################################
diff  --git a/libcxx/test/configs/libcxx-trunk-shared.cfg.in b/libcxx/test/configs/libcxx-trunk-shared.cfg.in
index 4bb4c43dc752e..3711d5d321434 100644
--- a/libcxx/test/configs/libcxx-trunk-shared.cfg.in
+++ b/libcxx/test/configs/libcxx-trunk-shared.cfg.in
@@ -7,6 +7,9 @@ INSTALL_ROOT = "@CMAKE_BINARY_DIR@"
 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 @@ config.substitutions.append(('%{flags}',
     '-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(

diff  --git a/libcxx/test/configs/libcxx-trunk-static.cfg.in b/libcxx/test/configs/libcxx-trunk-static.cfg.in
index 5a111e05fe956..07f5890699fe0 100644
--- a/libcxx/test/configs/libcxx-trunk-static.cfg.in
+++ b/libcxx/test/configs/libcxx-trunk-static.cfg.in
@@ -7,6 +7,9 @@ INSTALL_ROOT = "@CMAKE_BINARY_DIR@"
 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 @@ config.substitutions.append(('%{flags}',
     '-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(


        


More information about the libcxx-commits mailing list