From 6f91fbff768a5822d7c5ef54a49192c513f301db Mon Sep 17 00:00:00 2001 From: Dan Willemsen Date: Mon, 18 Sep 2017 22:45:15 -0700 Subject: Don't add a rpath to the linker It doesn't need one, and doesn't handle it well either (it tries allocating memory before the memory allocators are initialized). Test: out/soong/host/linux_bionic-x86/bin/linker64 Change-Id: Ic4f75e8914093f13f28d53cf771f518f2b4e5d2e --- cc/linker.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'cc/linker.go') diff --git a/cc/linker.go b/cc/linker.go index 7c997d53..2a6c9098 100644 --- a/cc/linker.go +++ b/cc/linker.go @@ -234,8 +234,10 @@ func (linker *baseLinker) linkerFlags(ctx ModuleContext, flags Flags) Flags { rpath_prefix = "@loader_path/" } - for _, rpath := range linker.dynamicProperties.RunPaths { - flags.LdFlags = append(flags.LdFlags, "-Wl,-rpath,"+rpath_prefix+rpath) + if !ctx.static() { + for _, rpath := range linker.dynamicProperties.RunPaths { + flags.LdFlags = append(flags.LdFlags, "-Wl,-rpath,"+rpath_prefix+rpath) + } } } -- cgit v1.2.3