summaryrefslogtreecommitdiff
path: root/test/xray
diff options
context:
space:
mode:
authorKamil Rytarowski <n54@gmx.com>2018-02-15 14:17:15 +0000
committerKamil Rytarowski <n54@gmx.com>2018-02-15 14:17:15 +0000
commit8dde6e6cf5a5ac8fcb6894d647322c32491f5f4f (patch)
tree81b812c62404a151114c5f223d70d0cc527c04d5 /test/xray
parent9a797cae14217a85a22fbb2dc3581c56624c5303 (diff)
Add Xray instrumentation support to FreeBSD
Summary: - Enabling the build. - Using assembly for the cpuid parts. - Using thr_self FreeBSD call to get the thread id Patch by: David CARLIER Reviewers: dberris, rnk, krytarowski Reviewed By: dberris, krytarowski Subscribers: emaste, stevecheckoway, nglevin, srhines, kubamracek, dberris, mgorny, krytarowski, llvm-commits, #sanitizers Differential Revision: https://reviews.llvm.org/D43278 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@325240 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/xray')
-rw-r--r--test/xray/lit.cfg12
1 files changed, 9 insertions, 3 deletions
diff --git a/test/xray/lit.cfg b/test/xray/lit.cfg
index d5e40975d..c0eeea0cf 100644
--- a/test/xray/lit.cfg
+++ b/test/xray/lit.cfg
@@ -20,6 +20,13 @@ def build_invocation(compile_flags):
llvm_xray = os.path.join(config.llvm_tools_dir, 'llvm-xray')
# Setup substitutions.
+xraylib_flags = '-lm -pthread -lrt'
+if config.host_os == 'Linux':
+ xraylib_flags += ' -ldl'
+
+xraylib_flags += ' -L%s -Wl,-whole-archive -lclang_rt.xray-%s '
+'-Wl,-no-whole-archive'
+
config.substitutions.append(
('%clang ', build_invocation([config.target_cflags])))
config.substitutions.append(
@@ -33,14 +40,13 @@ config.substitutions.append(
('%llvm_xray', llvm_xray))
config.substitutions.append(
('%xraylib',
- ('-lm -lpthread -ldl -lrt -L%s '
- '-Wl,-whole-archive -lclang_rt.xray-%s -Wl,-no-whole-archive')
+ (xraylib_flags)
% (config.compiler_rt_libdir, config.host_arch)))
# Default test suffixes.
config.suffixes = ['.c', '.cc', '.cpp']
-if config.host_os not in ['Linux']:
+if config.host_os not in ['Linux', 'FreeBSD']:
config.unsupported = True
elif '64' not in config.host_arch:
if 'arm' in config.host_arch: