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
diff --git a/cc/linker.go b/cc/linker.go
index 7c997d5..2a6c909 100644
--- a/cc/linker.go
+++ b/cc/linker.go
@@ -234,8 +234,10 @@
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)
+ }
}
}