OSDN Git Service

Extend the CPU ABI specification mechanism.
authorNarayan Kamath <narayan@google.com>
Wed, 26 Mar 2014 17:33:55 +0000 (17:33 +0000)
committerNarayan Kamath <narayan@google.com>
Fri, 28 Mar 2014 17:10:47 +0000 (17:10 +0000)
Add a (read only) system property that is a comma
separated list of ABIs supported by the device in order
of preference. For example, typical arm-v8 device might
define:

ro.cpu.abilist = arm64-v8a,armeabi-v7a,armeabi

For most purposes, a single flattened list like the above is
probably more useful than the parallel system of variables
TARGET_CPU_ABI{2} / TARGET_2ND_ARCH_CPU_ABI{2} that we use
in the build system.

Change-Id: If9102669ad9f5f8fd89a8bcc5bf88cca1acadc3c

core/Makefile
core/envsetup.mk
tools/buildinfo.sh

index 1a008d8..918a94f 100644 (file)
@@ -191,6 +191,7 @@ $(INSTALLED_BUILD_PROP_TARGET): $(BUILDINFO_SH) $(INTERNAL_BUILD_ID_MAKEFILE) $(
                        TARGET_BOOTLOADER_BOARD_NAME="$(TARGET_BOOTLOADER_BOARD_NAME)" \
                        BUILD_FINGERPRINT="$(BUILD_FINGERPRINT)" \
                        TARGET_BOARD_PLATFORM="$(TARGET_BOARD_PLATFORM)" \
+                       TARGET_CPU_ABI_LIST="$(TARGET_CPU_ABI_LIST)" \
                        TARGET_CPU_ABI="$(TARGET_CPU_ABI)" \
                        TARGET_CPU_ABI2="$(TARGET_CPU_ABI2)" \
                        TARGET_AAPT_CHARACTERISTICS="$(TARGET_AAPT_CHARACTERISTICS)" \
index 4cb389b..628c95b 100644 (file)
@@ -143,6 +143,28 @@ endif
 TARGET_DEVICE_DIR := $(patsubst %/,%,$(dir $(board_config_mk)))
 board_config_mk :=
 
+# "ro.product.cpu.abilist" is a comma separated list of ABIs (in order
+# of preference) that the target supports. If a TARGET_CPU_ABI_LIST
+# is specified by the board configuration, we use that. If not, we
+# build a list out of the TARGET_CPU_ABIs specified by the config.
+ifeq (,$(TARGET_CPU_ABI_LIST))
+  TARGET_CPU_ABI_LIST := $(TARGET_CPU_ABI)
+  ifneq (,$(TARGET_CPU_ABI2))
+    TARGET_CPU_ABI_LIST += ,$(TARGET_CPU_ABI2)
+  endif
+  ifneq (,$(TARGET_2ND_CPU_ABI))
+    TARGET_CPU_ABI_LIST += ,$(TARGET_2ND_CPU_ABI)
+  endif
+  ifneq (,$(TARGET_2ND_CPU_ABI2))
+    TARGET_CPU_ABI_LIST += ,$(TARGET_2ND_CPU_ABI2)
+  endif
+
+  # Strip whitespace from the ABI list string.
+  empty :=
+  space := $(empty) $(empty)
+  TARGET_CPU_ABI_LIST := $(subst $(space),,$(TARGET_CPU_ABI_LIST))
+endif
+
 # ---------------------------------------------------------------
 # Set up configuration for target machine.
 # The following must be set:
index e3fe99c..39ddc66 100755 (executable)
@@ -20,10 +20,17 @@ echo "ro.product.brand=$PRODUCT_BRAND"
 echo "ro.product.name=$PRODUCT_NAME"
 echo "ro.product.device=$TARGET_DEVICE"
 echo "ro.product.board=$TARGET_BOOTLOADER_BOARD_NAME"
+
+# These values are deprecated, use "ro.product.cpu.abilist"
+# instead (see below).
+echo "# ro.product.cpu.abi and ro.product.cpu.abi2 are obsolete,"
+echo "# use ro.product.cpu.abilist instead."
 echo "ro.product.cpu.abi=$TARGET_CPU_ABI"
 if [ -n "$TARGET_CPU_ABI2" ] ; then
   echo "ro.product.cpu.abi2=$TARGET_CPU_ABI2"
 fi
+echo "ro.product.cpu.abilist=$TARGET_CPU_ABI_LIST"
+
 echo "ro.product.manufacturer=$PRODUCT_MANUFACTURER"
 if [ -n "$PRODUCT_DEFAULT_LANGUAGE" ] ; then
   echo "ro.product.locale.language=$PRODUCT_DEFAULT_LANGUAGE"