[PATCH] D53111: [lit] Support the `%shared_libasan` lit substitution on Apple platforms.

Dan Liew via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 12 16:38:43 PDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rL344434: [lit] Support the `%shared_libasan` lit substitution on Apple platforms. (authored by delcypher, committed by ).

Repository:
  rL LLVM

https://reviews.llvm.org/D53111

Files:
  compiler-rt/trunk/test/asan/lit.cfg


Index: compiler-rt/trunk/test/asan/lit.cfg
===================================================================
--- compiler-rt/trunk/test/asan/lit.cfg
+++ compiler-rt/trunk/test/asan/lit.cfg
@@ -101,8 +101,17 @@
 config.substitutions.append( ("%clangxx ", build_invocation(target_cxxflags)) )
 config.substitutions.append( ("%clang_asan ", build_invocation(clang_asan_cflags)) )
 config.substitutions.append( ("%clangxx_asan ", build_invocation(clang_asan_cxxflags)) )
-config.substitutions.append( ("%shared_libasan", "libclang_rt.asan%s.so" % config.target_suffix))
 if config.asan_dynamic:
+  if config.host_os == 'Linux':
+    shared_libasan_path = os.path.join(config.compiler_rt_libdir, "libclang_rt.asan{}.so".format(config.target_suffix))
+  elif config.host_os == 'Darwin':
+    shared_libasan_path = os.path.join(config.compiler_rt_libdir, 'libclang_rt.asan_{}_dynamic.dylib'.format(config.apple_platform))
+  else:
+    lit_config.warning('%shared_libasan substitution not set but dynamic ASan is available.')
+    shared_libasan_path = None
+
+  if shared_libasan_path is not None:
+    config.substitutions.append( ("%shared_libasan", shared_libasan_path) )
   config.substitutions.append( ("%clang_asan_static ", build_invocation(clang_asan_static_cflags)) )
   config.substitutions.append( ("%clangxx_asan_static ", build_invocation(clang_asan_static_cxxflags)) )
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D53111.169519.patch
Type: text/x-patch
Size: 1381 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181012/7111d20e/attachment.bin>


More information about the llvm-commits mailing list