Skip to content

Commit daf0dfb

Browse files
committed
[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
1 parent 070090c commit daf0dfb

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

libcxx/test/configs/libcxx-trunk-shared.cfg.in

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ INSTALL_ROOT = "@CMAKE_BINARY_DIR@"
77
COMPILER = "@CMAKE_CXX_COMPILER@"
88
EXEC_ROOT = "@LIBCXX_BINARY_DIR@"
99
CMAKE_OSX_SYSROOT = "@CMAKE_OSX_SYSROOT@"
10+
INCLUDE_DIR = "@LIBCXX_INSTALL_INCLUDE_DIR@"
11+
INCLUDE_TARGET_DIR = "@LIBCXX_INSTALL_INCLUDE_TARGET_DIR@"
12+
LIBRARY_DIR = "@LIBCXX_INSTALL_LIBRARY_DIR@"
1013

1114
import os
1215
import pipes
@@ -32,13 +35,14 @@ config.substitutions.append(('%{flags}',
3235
'-isysroot {}'.format(CMAKE_OSX_SYSROOT) if CMAKE_OSX_SYSROOT else ''
3336
))
3437
config.substitutions.append(('%{compile_flags}',
35-
'-nostdinc++ -isystem {} -I {}'.format(
36-
os.path.join(INSTALL_ROOT, 'include', 'c++', 'v1'),
38+
'-nostdinc++ -isystem {} -isystem {} -I {}'.format(
39+
os.path.join(INSTALL_ROOT, INCLUDE_DIR),
40+
os.path.join(INSTALL_ROOT, INCLUDE_TARGET_DIR),
3741
os.path.join(LIBCXX_ROOT, 'test', 'support'))
3842
))
3943
config.substitutions.append(('%{link_flags}',
4044
'-nostdlib++ -L {0} -lc++ -Wl,-rpath,{0} -pthread'.format(
41-
os.path.join(INSTALL_ROOT, 'lib'))
45+
os.path.join(INSTALL_ROOT, LIBRARY_DIR))
4246
))
4347
config.substitutions.append(('%{exec}',
4448
'{} {} --execdir %T -- '.format(

libcxx/test/configs/libcxx-trunk-static.cfg.in

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ INSTALL_ROOT = "@CMAKE_BINARY_DIR@"
77
COMPILER = "@CMAKE_CXX_COMPILER@"
88
EXEC_ROOT = "@LIBCXX_BINARY_DIR@"
99
CMAKE_OSX_SYSROOT = "@CMAKE_OSX_SYSROOT@"
10+
INCLUDE_DIR = "@LIBCXX_INSTALL_INCLUDE_DIR@"
11+
INCLUDE_TARGET_DIR = "@LIBCXX_INSTALL_INCLUDE_TARGET_DIR@"
12+
LIBRARY_DIR = "@LIBCXX_INSTALL_LIBRARY_DIR@"
1013

1114
import os
1215
import pipes
@@ -32,13 +35,14 @@ config.substitutions.append(('%{flags}',
3235
'-isysroot {}'.format(CMAKE_OSX_SYSROOT) if CMAKE_OSX_SYSROOT else ''
3336
))
3437
config.substitutions.append(('%{compile_flags}',
35-
'-nostdinc++ -isystem {} -I {}'.format(
36-
os.path.join(INSTALL_ROOT, 'include', 'c++', 'v1'),
38+
'-nostdinc++ -isystem {} -isystem {} -I {}'.format(
39+
os.path.join(INSTALL_ROOT, INCLUDE_DIR),
40+
os.path.join(INSTALL_ROOT, INCLUDE_TARGET_DIR),
3741
os.path.join(LIBCXX_ROOT, 'test', 'support'))
3842
))
3943
config.substitutions.append(('%{link_flags}',
4044
'-nostdlib++ -L {} -lc++ -lc++abi -pthread'.format(
41-
os.path.join(INSTALL_ROOT, 'lib'))
45+
os.path.join(INSTALL_ROOT, LIBRARY_DIR))
4246
))
4347
config.substitutions.append(('%{exec}',
4448
'{} {} --execdir %T -- '.format(

0 commit comments

Comments
 (0)