aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher Ferris <cferris@google.com>2018-05-11 18:23:54 -0700
committerChristopher Ferris <cferris@google.com>2018-05-15 11:23:01 -0700
commit79dff70b468b683fc23fb2e61107a9f69288fee4 (patch)
treede510e98c210fd77e07739747121377a76ce2c66
parent01dd3fb5043b1af6913292bd237d1ba08f57e623 (diff)
downloadbuild_soong-79dff70b468b683fc23fb2e61107a9f69288fee4.tar.gz
build_soong-79dff70b468b683fc23fb2e61107a9f69288fee4.tar.bz2
build_soong-79dff70b468b683fc23fb2e61107a9f69288fee4.zip
Remove cortex-a53 linker workaround for new cpus.
Bug: 78133793 Test: Built target with cortex-a53 and verified that the flag is still Test: there. Test: Build target with cortex-a55/cortex-a75 and verified that the flag Test: is not there. Test: Built and booted on a taimen, ran bionic unit tests. Change-Id: Ibd7f497ecf46e5781cd0265463b0782babdf062a
-rw-r--r--cc/config/arm64_device.go19
1 files changed, 16 insertions, 3 deletions
diff --git a/cc/config/arm64_device.go b/cc/config/arm64_device.go
index c4426e31..b2b07648 100644
--- a/cc/config/arm64_device.go
+++ b/cc/config/arm64_device.go
@@ -39,7 +39,6 @@ var (
arm64Ldflags = []string{
"-Wl,-m,aarch64_elf64_le_vec",
"-Wl,--hash-style=gnu",
- "-Wl,--fix-cortex-a53-843419",
"-fuse-ld=gold",
"-Wl,--icf=safe",
}
@@ -172,6 +171,7 @@ var (
type toolchainArm64 struct {
toolchain64Bit
+ ldflags string
toolchainCflags string
toolchainClangCflags string
}
@@ -205,7 +205,7 @@ func (t *toolchainArm64) Cppflags() string {
}
func (t *toolchainArm64) Ldflags() string {
- return "${config.Arm64Ldflags}"
+ return t.ldflags
}
func (t *toolchainArm64) IncludeFlags() string {
@@ -225,7 +225,7 @@ func (t *toolchainArm64) ClangCppflags() string {
}
func (t *toolchainArm64) ClangLdflags() string {
- return "${config.Arm64Ldflags}"
+ return t.ldflags
}
func (t *toolchainArm64) ToolchainClangCflags() string {
@@ -249,7 +249,20 @@ func arm64ToolchainFactory(arch android.Arch) Toolchain {
toolchainClangCflags = append(toolchainClangCflags,
variantOrDefault(arm64ClangCpuVariantCflagsVar, arch.CpuVariant))
+ var extraLdflags string
+ switch arch.CpuVariant {
+ case "cortex-a53", "cortex-a73", "kryo", "exynos-m1", "exynos-m2",
+ // This variant might not need the workaround but leave it
+ // in the list since it has had the workaround on before.
+ "denver64":
+ extraLdflags = "-Wl,--fix-cortex-a53-843419"
+ }
+
return &toolchainArm64{
+ ldflags: strings.Join([]string{
+ "${config.Arm64Ldflags}",
+ extraLdflags,
+ }, " "),
toolchainCflags: variantOrDefault(arm64CpuVariantCflagsVar, arch.CpuVariant),
toolchainClangCflags: strings.Join(toolchainClangCflags, " "),
}