[PATCH] D38527: [sanitizer] Move %ld_flags_rpath_exe to common and use it in more tests.

Evgenii Stepanov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 5 13:02:00 PDT 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rL315010: [sanitizer] Move %ld_flags_rpath_exe to common and use it in more tests. (authored by eugenis).

Changed prior to commit:
  https://reviews.llvm.org/D38527?vs=117616&id=117871#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D38527

Files:
  compiler-rt/trunk/test/asan/lit.cfg
  compiler-rt/trunk/test/cfi/target_uninstrumented.cpp
  compiler-rt/trunk/test/lit.common.cfg
  compiler-rt/trunk/test/ubsan/TestCases/TypeCheck/vptr-non-unique-typeinfo.cpp


Index: compiler-rt/trunk/test/cfi/target_uninstrumented.cpp
===================================================================
--- compiler-rt/trunk/test/cfi/target_uninstrumented.cpp
+++ compiler-rt/trunk/test/cfi/target_uninstrumented.cpp
@@ -1,5 +1,5 @@
-// RUN: %clangxx -g -DSHARED_LIB %s -fPIC -shared -o %T/target_uninstrumented-so.so
-// RUN: %clangxx_cfi_diag -g %s -o %t %T/target_uninstrumented-so.so
+// RUN: %clangxx -g -DSHARED_LIB %s -fPIC -shared -o %dynamiclib %ld_flags_rpath_so
+// RUN: %clangxx_cfi_diag -g %s -o %t %ld_flags_rpath_exe
 // RUN: %run %t 2>&1 | FileCheck %s
 
 // REQUIRES: cxxabi
@@ -32,7 +32,7 @@
 int main(int argc, char *argv[]) {
   void *p = create_B();
   // CHECK: runtime error: control flow integrity check for type 'A' failed during cast to unrelated type
-  // CHECK: invalid vtable in module {{.*}}target_uninstrumented-so.so
+  // CHECK: invalid vtable in module {{.*}}libtarget_uninstrumented.cpp.dynamic.so
   A *a = (A *)p;
   memset(p, 0, sizeof(A));
   // CHECK: runtime error: control flow integrity check for type 'A' failed during cast to unrelated type
Index: compiler-rt/trunk/test/asan/lit.cfg
===================================================================
--- compiler-rt/trunk/test/asan/lit.cfg
+++ compiler-rt/trunk/test/asan/lit.cfg
@@ -178,21 +178,6 @@
 
 config.available_features.add("asan-" + config.bits + "-bits")
 
-if config.host_os == 'Darwin':
-  config.substitutions.append( ("%ld_flags_rpath_exe", '-Wl,-rpath, at executable_path/ %dynamiclib') )
-  config.substitutions.append( ("%ld_flags_rpath_so", '-install_name @rpath/`basename %dynamiclib`') )
-elif config.host_os == 'FreeBSD':
-  config.substitutions.append( ("%ld_flags_rpath_exe", "-Wl,-z,origin -Wl,-rpath,\$ORIGIN -L%T -l%xdynamiclib_namespec") )
-  config.substitutions.append( ("%ld_flags_rpath_so", '') )
-elif config.host_os == 'Linux':
-  config.substitutions.append( ("%ld_flags_rpath_exe", "-Wl,-rpath,\$ORIGIN -L%T -l%xdynamiclib_namespec") )
-  config.substitutions.append( ("%ld_flags_rpath_so", '') )
-
-# Must be defined after the substitutions that use %dynamiclib.
-config.substitutions.append( ("%dynamiclib", '%T/%xdynamiclib_filename') )
-config.substitutions.append( ("%xdynamiclib_filename", 'lib%xdynamiclib_namespec.so') )
-config.substitutions.append( ("%xdynamiclib_namespec", '%basename_t.dynamic') )
-
 # Allow tests to use REQUIRES=stable-runtime.  For use when you cannot use XFAIL
 # because the test hangs. Adding armhf as we now have two modes.
 if config.target_arch != 'arm' and config.target_arch != 'armhf' and config.target_arch != 'aarch64':
Index: compiler-rt/trunk/test/lit.common.cfg
===================================================================
--- compiler-rt/trunk/test/lit.common.cfg
+++ compiler-rt/trunk/test/lit.common.cfg
@@ -280,3 +280,18 @@
 # of large mmap'd regions (terabytes) by the kernel.
 if platform.system() == 'Darwin':
   lit_config.parallelism_groups["darwin-64bit-sanitizer"] = 3
+
+if config.host_os == 'Darwin':
+  config.substitutions.append( ("%ld_flags_rpath_exe", '-Wl,-rpath, at executable_path/ %dynamiclib') )
+  config.substitutions.append( ("%ld_flags_rpath_so", '-install_name @rpath/`basename %dynamiclib`') )
+elif config.host_os == 'FreeBSD':
+  config.substitutions.append( ("%ld_flags_rpath_exe", "-Wl,-z,origin -Wl,-rpath,\$ORIGIN -L%T -l%xdynamiclib_namespec") )
+  config.substitutions.append( ("%ld_flags_rpath_so", '') )
+elif config.host_os == 'Linux':
+  config.substitutions.append( ("%ld_flags_rpath_exe", "-Wl,-rpath,\$ORIGIN -L%T -l%xdynamiclib_namespec") )
+  config.substitutions.append( ("%ld_flags_rpath_so", '') )
+
+# Must be defined after the substitutions that use %dynamiclib.
+config.substitutions.append( ("%dynamiclib", '%T/%xdynamiclib_filename') )
+config.substitutions.append( ("%xdynamiclib_filename", 'lib%xdynamiclib_namespec.so') )
+config.substitutions.append( ("%xdynamiclib_namespec", '%basename_t.dynamic') )
Index: compiler-rt/trunk/test/ubsan/TestCases/TypeCheck/vptr-non-unique-typeinfo.cpp
===================================================================
--- compiler-rt/trunk/test/ubsan/TestCases/TypeCheck/vptr-non-unique-typeinfo.cpp
+++ compiler-rt/trunk/test/ubsan/TestCases/TypeCheck/vptr-non-unique-typeinfo.cpp
@@ -1,5 +1,5 @@
-// RUN: %clangxx -frtti -fsanitize=vptr -fno-sanitize-recover=vptr -I%p/Helpers -g %s -fPIC -shared -o %t-lib.so -DBUILD_SO
-// RUN: %clangxx -frtti -fsanitize=vptr -fno-sanitize-recover=vptr -I%p/Helpers -g %s -O3 -o %t %t-lib.so
+// RUN: %clangxx -frtti -fsanitize=vptr -fno-sanitize-recover=vptr -I%p/Helpers -g %s -fPIC -shared -o %dynamiclib -DBUILD_SO %ld_flags_rpath_so
+// RUN: %clangxx -frtti -fsanitize=vptr -fno-sanitize-recover=vptr -I%p/Helpers -g %s -O3 -o %t %ld_flags_rpath_exe
 // RUN: %run %t
 //
 // REQUIRES: cxxabi


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D38527.117871.patch
Type: text/x-patch
Size: 4837 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171005/fbb010e9/attachment.bin>


More information about the llvm-commits mailing list