aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Willemsen <dwillemsen@google.com>2016-05-09 13:39:58 -0700
committerDan Willemsen <dwillemsen@google.com>2016-05-09 15:30:53 -0700
commited89a7aa0c9b9085490b8ef1957f4b549d559012 (patch)
tree2861d5e3ca3d97d901ebdd2526d6b8a1cc73d440
parentb485099badf27dee6f92a0492aa85e3e28c4a485 (diff)
downloadbuild_soong-ed89a7aa0c9b9085490b8ef1957f4b549d559012.tar.gz
build_soong-ed89a7aa0c9b9085490b8ef1957f4b549d559012.tar.bz2
build_soong-ed89a7aa0c9b9085490b8ef1957f4b549d559012.zip
Clean up and fix Krait cflags
For krait, we were using the cortex-a15 cflags for GCC, but a completely separate set for Clang. To make it more readable, and prevent the LPAE flag from being missed for Clang, explicitly define krait cflags for GCC as well. Change-Id: I6dc00a22e2b298ee3755190bf09f28e427c8c70d
-rw-r--r--cc/arm_device.go17
1 files changed, 12 insertions, 5 deletions
diff --git a/cc/arm_device.go b/cc/arm_device.go
index 764aaa9a..323ebc9d 100644
--- a/cc/arm_device.go
+++ b/cc/arm_device.go
@@ -126,6 +126,14 @@ var (
// better solution comes around. See Bug 27340895
"-D__ARM_FEATURE_LPAE=1",
},
+ "krait": []string{
+ "-mcpu=cortex-a15",
+ // Fake an ARM compiler flag as these processors support LPAE which GCC/clang
+ // don't advertise.
+ // TODO This is a hack and we need to add it for each processor that supports LPAE until some
+ // better solution comes around. See Bug 27340895
+ "-D__ARM_FEATURE_LPAE=1",
+ },
}
armClangCpuVariantCflags = copyVariantFlags(armCpuVariantCflags)
@@ -146,10 +154,8 @@ func init() {
}
replaceFirst(armClangArchVariantCflags["armv5te"], "-march=armv5te", "-march=armv5t")
- armClangCpuVariantCflags["krait"] = []string{
- "-mcpu=krait",
- "-mfpu=neon-vfpv4",
- }
+ replaceFirst(armClangCpuVariantCflags["krait"], "-mcpu=cortex-a15", "-mcpu=krait")
+ armClangCpuVariantCflags["krait"] = append(armClangCpuVariantCflags["krait"], "-mfpu=neon-vfpv4")
pctx.StaticVariable("armGccVersion", armGccVersion)
@@ -185,6 +191,7 @@ func init() {
pctx.StaticVariable("armCortexA7Cflags", strings.Join(armCpuVariantCflags["cortex-a7"], " "))
pctx.StaticVariable("armCortexA8Cflags", strings.Join(armCpuVariantCflags["cortex-a8"], " "))
pctx.StaticVariable("armCortexA15Cflags", strings.Join(armCpuVariantCflags["cortex-a15"], " "))
+ pctx.StaticVariable("armKraitCflags", strings.Join(armCpuVariantCflags["krait"], " "))
// Clang cflags
pctx.StaticVariable("armToolchainClangCflags", strings.Join(clangFilterUnknownCflags(armToolchainCflags), " "))
@@ -231,7 +238,7 @@ var (
"cortex-a15": "${armCortexA15Cflags}",
"cortex-a53": "${armCortexA7Cflags}",
"cortex-a53.a57": "${armCortexA7Cflags}",
- "krait": "${armCortexA15Cflags}",
+ "krait": "${armKraitCflags}",
"denver": "${armCortexA15Cflags}",
}