[compiler-rt] r325315 - Reintroduce FreeBSD support in test/xray

Kamil Rytarowski via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 15 20:20:34 PST 2018


Author: kamil
Date: Thu Feb 15 20:20:33 2018
New Revision: 325315

URL: http://llvm.org/viewvc/llvm-project?rev=325315&view=rev
Log:
Reintroduce FreeBSD support in test/xray

Tested by Douglas Yung.

The original patch from D43278 has been reverted.

New patch by myself.

Modified:
    compiler-rt/trunk/test/xray/lit.cfg

Modified: compiler-rt/trunk/test/xray/lit.cfg
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/xray/lit.cfg?rev=325315&r1=325314&r2=325315&view=diff
==============================================================================
--- compiler-rt/trunk/test/xray/lit.cfg (original)
+++ compiler-rt/trunk/test/xray/lit.cfg Thu Feb 15 20:20:33 2018
@@ -20,6 +20,11 @@ def build_invocation(compile_flags):
 llvm_xray = os.path.join(config.llvm_tools_dir, 'llvm-xray')
 
 # Setup substitutions.
+if config.host_os == "Linux":
+  libdl_flag = "-ldl"
+else:
+  libdl_flag = ""
+
 config.substitutions.append(
     ('%clang ', build_invocation([config.target_cflags])))
 config.substitutions.append(
@@ -33,14 +38,14 @@ config.substitutions.append(
     ('%llvm_xray', llvm_xray))
 config.substitutions.append(
     ('%xraylib',
-        ('-lm -lpthread -ldl -lrt -L%s '
+        ('-lm -lpthread %s -lrt -L%s '
          '-Wl,-whole-archive -lclang_rt.xray-%s -Wl,-no-whole-archive')
-        % (config.compiler_rt_libdir, config.host_arch)))
+        % (libdl_flag, 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 ['FreeBSD', 'Linux']:
   config.unsupported = True
 elif '64' not in config.host_arch:
   if 'arm' in config.host_arch:




More information about the llvm-commits mailing list