Skip to content

Commit 8902445

Browse files
committed
[asan] Link tests with ld.gold on Android.
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. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@243802 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 13725b4 commit 8902445

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

test/asan/lit.cfg

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,11 @@ if config.compiler_id == 'GNU':
5555
else:
5656
extra_linkflags = []
5757

58+
# BFD linker in 64-bit android toolchains fails to find libm.so, which is a
59+
# transitive shared library dependency (via asan runtime).
60+
if config.android:
61+
extra_linkflags += ["-fuse-ld=gold"]
62+
5863
# Setup default compiler flags used with -fsanitize=address option.
5964
# FIXME: Review the set of required flags and check if it can be reduced.
6065
target_cflags = [get_required_attr(config, "target_cflags")] + extra_linkflags

0 commit comments

Comments
 (0)