Use --hash-style=both for NDK binaries
Old devices don't support gnu hashes, use --hash-style=both when the sdk_version property is set. Test: m -j checkbuild Bug: 64608507 Change-Id: Iec5229a08fc192f1c8872466ee4bf866adf50443
This commit is contained in:
@@ -232,6 +232,14 @@ func (linker *baseLinker) linkerFlags(ctx ModuleContext, flags Flags) Flags {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ctx.sdk() && (ctx.Arch().ArchType != android.Mips && ctx.Arch().ArchType != android.Mips64) {
|
||||||
|
// The bionic linker now has support gnu style hashes (which are much faster!), but shipping
|
||||||
|
// to older devices requires the old style hash. Fortunately, we can build with both and
|
||||||
|
// it'll work anywhere.
|
||||||
|
// This is not currently supported on MIPS architectures.
|
||||||
|
flags.LdFlags = append(flags.LdFlags, "-Wl,--hash-style=both")
|
||||||
|
}
|
||||||
|
|
||||||
if flags.Clang {
|
if flags.Clang {
|
||||||
flags.LdFlags = append(flags.LdFlags, toolchain.ToolchainClangLdflags())
|
flags.LdFlags = append(flags.LdFlags, toolchain.ToolchainClangLdflags())
|
||||||
} else {
|
} else {
|
||||||
|
Reference in New Issue
Block a user