[asan] Link tests with ld.gold on Android.
authorEvgeniy Stepanov <eugeni.stepanov@gmail.com>
Sat, 1 Aug 2015 00:01:23 +0000 (00:01 +0000)
committerEvgeniy Stepanov <eugeni.stepanov@gmail.com>
Sat, 1 Aug 2015 00:01:23 +0000 (00:01 +0000)
ld.bfd fails to find dependencies of asan runtime library w/o an
extra -rpath-link pointing to usr/lib under the sysroot. Gold does
not have this problem.

llvm-svn: 243802

compiler-rt/test/asan/lit.cfg

index a9d5733..57ee2e4 100644 (file)
@@ -55,6 +55,11 @@ if config.compiler_id == 'GNU':
 else:
   extra_linkflags = []
 
+# BFD linker in 64-bit android toolchains fails to find libm.so, which is a
+# transitive shared library dependency (via asan runtime).
+if config.android:
+  extra_linkflags += ["-fuse-ld=gold"]
+
 # 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