Support prepended arch-specific properties

Arch-specific static libraries should be prepended so that the common
static libraries can depend on them.

Bug: 26968262
Change-Id: I40a21d18ece8f6d20824437e7180628b29ffdd04
diff --git a/common/arch.go b/common/arch.go
index b92e05b..23ec550 100644
--- a/common/arch.go
+++ b/common/arch.go
@@ -621,7 +621,17 @@
 		return true, nil
 	}
 
-	err := proptools.AppendProperties(dst, src, filter)
+	order := func(property string,
+		dstField, srcField reflect.StructField,
+		dstValue, srcValue interface{}) (proptools.Order, error) {
+		if proptools.HasTag(dstField, "android", "variant_prepend") {
+			return proptools.Prepend, nil
+		} else {
+			return proptools.Append, nil
+		}
+	}
+
+	err := proptools.ExtendProperties(dst, src, filter, order)
 	if err != nil {
 		if propertyErr, ok := err.(*proptools.ExtendPropertyError); ok {
 			ctx.PropertyErrorf(propertyErr.Property, "%s", propertyErr.Err.Error())