aboutsummaryrefslogtreecommitdiffstats
path: root/androidmk
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2016-05-25 17:15:40 -0700
committerColin Cross <ccross@android.com>2016-05-25 17:17:40 -0700
commitab6e6e0135d6ff6bde3dd6b192646c22eb633838 (patch)
treeae1c8ddbf0f5972cddb0a208b2214630cf6545f4 /androidmk
parentb36ab1a1a0355d15d692e2b6ff5955cae1275174 (diff)
downloadbuild_soong-ab6e6e0135d6ff6bde3dd6b192646c22eb633838.tar.gz
build_soong-ab6e6e0135d6ff6bde3dd6b192646c22eb633838.tar.bz2
build_soong-ab6e6e0135d6ff6bde3dd6b192646c22eb633838.zip
Fix non-deterministic errors with LOCAL_*_x86_64
LOCAL_*_x86_64 was sometimes recognized as a _64 suffix and other times as the correct _x86_64 suffix, based on the random order of the propertyPrefixes map. Replace the map with a slice so that the ordering is consistent, and ensure 64 as after x86_64. Change-Id: I1a4b4959f8ef4273ad4a1cdd0672ad557bf1891e
Diffstat (limited to 'androidmk')
-rw-r--r--androidmk/cmd/androidmk/android.go20
-rw-r--r--androidmk/cmd/androidmk/androidmk.go8
2 files changed, 15 insertions, 13 deletions
diff --git a/androidmk/cmd/androidmk/android.go b/androidmk/cmd/androidmk/android.go
index fee15d2d..3d683531 100644
--- a/androidmk/cmd/androidmk/android.go
+++ b/androidmk/cmd/androidmk/android.go
@@ -313,15 +313,17 @@ var deleteProperties = map[string]struct{}{
"LOCAL_CPP_EXTENSION": struct{}{},
}
-var propertyPrefixes = map[string]string{
- "arm": "arch.arm",
- "arm64": "arch.arm64",
- "mips": "arch.mips",
- "mips64": "arch.mips64",
- "x86": "arch.x86",
- "x86_64": "arch.x86_64",
- "32": "multilib.lib32",
- "64": "multilib.lib64",
+// Shorter suffixes of other suffixes must be at the end of the list
+var propertyPrefixes = []struct{ mk, bp string }{
+ {"arm", "arch.arm"},
+ {"arm64", "arch.arm64"},
+ {"mips", "arch.mips"},
+ {"mips64", "arch.mips64"},
+ {"x86", "arch.x86"},
+ {"x86_64", "arch.x86_64"},
+ {"32", "multilib.lib32"},
+ // 64 must be after x86_64
+ {"64", "multilib.lib64"},
}
var conditionalTranslations = map[string]map[bool]string{
diff --git a/androidmk/cmd/androidmk/androidmk.go b/androidmk/cmd/androidmk/androidmk.go
index 4dc4d724..c6e13cc2 100644
--- a/androidmk/cmd/androidmk/androidmk.go
+++ b/androidmk/cmd/androidmk/androidmk.go
@@ -195,10 +195,10 @@ func handleAssignment(file *bpFile, assignment mkparser.Assignment, c *condition
prefix := ""
if strings.HasPrefix(name, "LOCAL_") {
- for k, v := range propertyPrefixes {
- if strings.HasSuffix(name, "_"+k) {
- name = strings.TrimSuffix(name, "_"+k)
- prefix = v
+ for _, x := range propertyPrefixes {
+ if strings.HasSuffix(name, "_"+x.mk) {
+ name = strings.TrimSuffix(name, "_"+x.mk)
+ prefix = x.bp
break
}
}