diff options
Diffstat (limited to 'test/asan/lit.cfg')
-rw-r--r-- | test/asan/lit.cfg | 16 |
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 |