[PATCH] D52994: Don't harcode -ldl test/sanitizer_common/TestCases

Phabricator via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 8 11:06:01 PDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rCRT343987: Don't harcode -ldl test/sanitizer_common/TestCases (authored by kamil, committed by ).

Repository:
  rL LLVM

https://reviews.llvm.org/D52994

Files:
  test/sanitizer_common/TestCases/get_module_and_offset_for_pc.cc
  test/sanitizer_common/TestCases/sanitizer_coverage_symbolize.cc
  test/sanitizer_common/TestCases/sanitizer_coverage_trace_pc_guard.cc
  test/sanitizer_common/lit.common.cfg


Index: test/sanitizer_common/TestCases/get_module_and_offset_for_pc.cc
===================================================================
--- test/sanitizer_common/TestCases/get_module_and_offset_for_pc.cc
+++ 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
Index: test/sanitizer_common/TestCases/sanitizer_coverage_trace_pc_guard.cc
===================================================================
--- test/sanitizer_common/TestCases/sanitizer_coverage_trace_pc_guard.cc
+++ 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
Index: test/sanitizer_common/TestCases/sanitizer_coverage_symbolize.cc
===================================================================
--- test/sanitizer_common/TestCases/sanitizer_coverage_symbolize.cc
+++ 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
 
Index: test/sanitizer_common/lit.common.cfg
===================================================================
--- test/sanitizer_common/lit.common.cfg
+++ test/sanitizer_common/lit.common.cfg
@@ -46,7 +46,13 @@
   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):


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D52994.168684.patch
Type: text/x-patch
Size: 2470 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181008/b46572e3/attachment.bin>


More information about the llvm-commits mailing list