aboutsummaryrefslogtreecommitdiff
path: root/test/asan/lit.cfg
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2015-02-10 07:45:43 +0000
committerDimitry Andric <dim@FreeBSD.org>2015-02-10 07:45:43 +0000
commit476c4db3dc56bee43df384704c75ccc71cfa7a1d (patch)
tree5d0dcec3cc12fc53532fc84029892b98711a2596 /test/asan/lit.cfg
parentca9211ecdede9bdedb812b2243a4abdb8dacd1b9 (diff)
downloadsrc-476c4db3dc56bee43df384704c75ccc71cfa7a1d.tar.gz
src-476c4db3dc56bee43df384704c75ccc71cfa7a1d.zip
Import compiler-rt trunk r228651.vendor/compiler-rt/compiler-rt-r228651
Notes
Notes: svn path=/vendor/compiler-rt/dist/; revision=278497 svn path=/vendor/compiler-rt/compiler-rt-r228651/; revision=278498; tag=vendor/compiler-rt/compiler-rt-r228651
Diffstat (limited to 'test/asan/lit.cfg')
-rw-r--r--test/asan/lit.cfg16
1 files changed, 10 insertions, 6 deletions
diff --git a/test/asan/lit.cfg b/test/asan/lit.cfg
index 82a36de9cdda..8be7062614b3 100644
--- a/test/asan/lit.cfg
+++ b/test/asan/lit.cfg
@@ -19,7 +19,7 @@ def push_dynamic_library_lookup_path(config, new_path):
dynamic_library_lookup_var = 'LD_LIBRARY_PATH'
new_ld_library_path = os.path.pathsep.join(
- (new_path, config.environment[dynamic_library_lookup_var]))
+ (new_path, config.environment.get(dynamic_library_lookup_var, '')))
config.environment[dynamic_library_lookup_var] = new_ld_library_path
# Setup config name.
@@ -28,17 +28,19 @@ config.name = 'AddressSanitizer' + config.name_suffix
# Setup source root.
config.test_source_root = os.path.dirname(__file__)
+# There is no libdl on FreeBSD.
+if config.host_os != 'FreeBSD':
+ libdl_flag = "-ldl"
+else:
+ libdl_flag = ""
+
# GCC-ASan doesn't link in all the necessary libraries automatically, so
# we have to do it ourselves.
if config.compiler_id == 'GNU':
- extra_linkflags = ["-pthread", "-lstdc++"]
+ extra_linkflags = ["-pthread", "-lstdc++", libdl_flag]
else:
extra_linkflags = []
-# There is no libdl on FreeBSD.
-if config.compiler_id == 'GNU' and config.host_os != 'FreeBSD':
- extra_linkflags += ["-ldl"]
-
# Setup default compiler flags used with -fsanitize=address option.
# FIXME: Review the set of required flags and check if it can be reduced.
target_cflags = [get_required_attr(config, "target_cflags")] + extra_linkflags
@@ -121,6 +123,8 @@ else:
config.substitutions.append( ('CHECK-%kernel_bits', ("CHECK-kernel-" + kernel_bits + "-bits")))
+config.substitutions.append( ("%libdl", libdl_flag) )
+
config.available_features.add("asan-" + config.bits + "-bits")
# Allow tests to use REQUIRES=stable-runtime. For use when you cannot use XFAIL