Do not use -Wl,--gc-sections for linux host libraries

This matches make

Change-Id: I2ee2e47065439afa02b946ede3a7718f1a8dc71b
This commit is contained in:
Dan Willemsen 2016-03-03 18:05:38 -08:00
parent f534a10643
commit 99db8c30c1

View file

@ -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(),
)