diff options
Diffstat (limited to 'test/xray/lit.cfg')
-rw-r--r-- | test/xray/lit.cfg | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/test/xray/lit.cfg b/test/xray/lit.cfg index 0dc2108ba..cc4cc2124 100644 --- a/test/xray/lit.cfg +++ b/test/xray/lit.cfg @@ -10,8 +10,16 @@ config.test_source_root = os.path.dirname(__file__) # Setup default compiler flags use with -fxray-instrument option. clang_xray_cflags = (['-fxray-instrument', config.target_cflags]) -clang_xray_cxxflags = config.cxx_mode_flags + clang_xray_cflags +# If libc++ was used to build XRAY libraries, libc++ is needed. Fix applied +# to Linux only since -rpath may not be portable. This can be extended to +# other platforms. +if config.libcxx_used == "1" and config.host_os == "Linux": + clang_xray_cflags = clang_xray_cflags + (['-L%s -lc++ -Wl,-rpath=%s' + % (config.llvm_shlib_dir, + config.llvm_shlib_dir)]) + +clang_xray_cxxflags = config.cxx_mode_flags + clang_xray_cflags def build_invocation(compile_flags): return ' ' + ' '.join([config.clang] + compile_flags) + ' ' |