From 99db8c30c1ddeda07c9580fa836c4cb557ab331e Mon Sep 17 00:00:00 2001 From: Dan Willemsen Date: Thu, 3 Mar 2016 18:05:38 -0800 Subject: Do not use -Wl,--gc-sections for linux host libraries This matches make Change-Id: I2ee2e47065439afa02b946ede3a7718f1a8dc71b --- cc/cc.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cc/cc.go b/cc/cc.go index 717e598b..eb9c58fd 100644 --- a/cc/cc.go +++ b/cc/cc.go @@ -1248,7 +1248,10 @@ func (c *CCLibrary) flags(ctx common.AndroidModuleContext, flags CCFlags) CCFlag sharedFlag = "-shared" } if ctx.Device() { - flags.LdFlags = append(flags.LdFlags, "-nostdlib") + flags.LdFlags = append(flags.LdFlags, + "-nostdlib", + "-Wl,--gc-sections", + ) } if ctx.Darwin() { @@ -1260,7 +1263,6 @@ func (c *CCLibrary) flags(ctx common.AndroidModuleContext, flags CCFlags) CCFlag ) } else { flags.LdFlags = append(flags.LdFlags, - "-Wl,--gc-sections", sharedFlag, "-Wl,-soname,"+libName+flags.Toolchain.ShlibSuffix(), ) -- cgit v1.2.3