summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKamil Rytarowski <n54@gmx.com>2018-10-08 18:04:00 +0000
committerKamil Rytarowski <n54@gmx.com>2018-10-08 18:04:00 +0000
commitbfd14ca645974d194dc32ae0d86c86d20ba30a3f (patch)
tree58420d78e9da7a1b15ed36deaeb15c401a2aad9d
parent0c93ea2634219eb01fb8f9d2b32e6a64c7aa058c (diff)
downloadbcm5719-llvm-bfd14ca645974d194dc32ae0d86c86d20ba30a3f.tar.gz
bcm5719-llvm-bfd14ca645974d194dc32ae0d86c86d20ba30a3f.zip
Don't harcode -ldl test/sanitizer_common/TestCases
Summary: The dl library does not exist on all system and in particular this breaks build on NetBSD. Make it conditional and enable only for Linux, following the approach from other test suites in the same repository. Reviewers: joerg, vitalybuka Reviewed By: vitalybuka Subscribers: kubamracek, llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D52994 llvm-svn: 343987
-rw-r--r--compiler-rt/test/sanitizer_common/TestCases/get_module_and_offset_for_pc.cc2
-rw-r--r--compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_symbolize.cc2
-rw-r--r--compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_trace_pc_guard.cc2
-rw-r--r--compiler-rt/test/sanitizer_common/lit.common.cfg6
4 files changed, 9 insertions, 3 deletions
diff --git a/compiler-rt/test/sanitizer_common/TestCases/get_module_and_offset_for_pc.cc b/compiler-rt/test/sanitizer_common/TestCases/get_module_and_offset_for_pc.cc
index 0591d356f13..b313df87ce1 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/get_module_and_offset_for_pc.cc
+++ b/compiler-rt/test/sanitizer_common/TestCases/get_module_and_offset_for_pc.cc
@@ -1,6 +1,6 @@
// RUN: mkdir -p %t-dir
// RUN: %clangxx -DSHARED %s -shared -o %t-dir/get_module_and_offset_for_pc.so -fPIC
-// RUN: %clangxx -DSO_DIR=\"%t-dir\" -O0 %s -ldl -o %t
+// RUN: %clangxx -DSO_DIR=\"%t-dir\" -O0 %s -o %t
// RUN: %run %t 2>&1 | FileCheck %s
// UNSUPPORTED: i386-darwin
diff --git a/compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_symbolize.cc b/compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_symbolize.cc
index 28e237802b2..daa994c8116 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_symbolize.cc
+++ b/compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_symbolize.cc
@@ -7,7 +7,7 @@
// RUN: rm -rf $DIR
// RUN: mkdir -p $DIR
// RUN: cd $DIR
-// RUN: %clangxx -O0 -fsanitize-coverage=trace-pc-guard %s -ldl -o %t
+// RUN: %clangxx -O0 -fsanitize-coverage=trace-pc-guard %s -o %t
// RUN: %env_tool_opts=coverage=1 %t 2>&1 | FileCheck %s
// RUN: rm -rf $DIR
diff --git a/compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_trace_pc_guard.cc b/compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_trace_pc_guard.cc
index 1adbf653bb7..5e01a803bff 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_trace_pc_guard.cc
+++ b/compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_trace_pc_guard.cc
@@ -9,7 +9,7 @@
// RUN: rm -rf $DIR
// RUN: mkdir -p $DIR
// RUN: cd $DIR
-// RUN: %clangxx -O0 -fsanitize-coverage=trace-pc-guard %s -ldl -o %t
+// RUN: %clangxx -O0 -fsanitize-coverage=trace-pc-guard %s -o %t
// RUN: %env_tool_opts=coverage=1 %t 2>&1 | FileCheck %s
// RUN: %sancovcc -covered-functions -strip_path_prefix=TestCases/ *.sancov %t 2>&1 | \
// RUN: FileCheck --check-prefix=CHECK-SANCOV %s
diff --git a/compiler-rt/test/sanitizer_common/lit.common.cfg b/compiler-rt/test/sanitizer_common/lit.common.cfg
index 1b347bf2bba..75cc7b77e70 100644
--- a/compiler-rt/test/sanitizer_common/lit.common.cfg
+++ b/compiler-rt/test/sanitizer_common/lit.common.cfg
@@ -46,7 +46,13 @@ if default_tool_options_str:
config.environment[tool_options] = default_tool_options_str
default_tool_options_str += ':'
+if config.host_os in ['Linux']:
+ extra_link_flags = ["-ldl"]
+else:
+ extra_link_flags = []
+
clang_cflags = config.debug_info_flags + tool_cflags + [config.target_cflags]
+clang_cflags += extra_link_flags
clang_cxxflags = config.cxx_mode_flags + clang_cflags
def build_invocation(compile_flags):
OpenPOWER on IntegriCloud