From 7863cf53a86d722faf9255de65bbe2c230747ba7 Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Thu, 20 Oct 2016 10:47:21 -0700 Subject: [PATCH] Only use -read_only_relocs on darwin x86 Darwin x86_64 warns with -read_only_relocs: ld: warning: -read_only_relocs cannot be used with x86_64 Only pass it for darwin x86. Test: m -j on darwin Change-Id: I080afb83d777587d14b60c8cd24b59005a275275 --- cc/library.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cc/library.go b/cc/library.go index feeb03c46..a61e6a108 100644 --- a/cc/library.go +++ b/cc/library.go @@ -229,9 +229,13 @@ func (library *libraryDecorator) linkerFlags(ctx ModuleContext, flags Flags) Fla f = append(f, "-dynamiclib", "-single_module", - "-read_only_relocs suppress", "-install_name @rpath/"+libName+flags.Toolchain.ShlibSuffix(), ) + if ctx.Arch().ArchType == android.X86 { + f = append(f, + "-read_only_relocs suppress", + ) + } } else { f = append(f, sharedFlag,