diff options
-rw-r--r-- | core/config.mk | 35 | ||||
-rw-r--r-- | core/executable.mk | 6 | ||||
-rw-r--r-- | core/package.mk | 6 | ||||
-rw-r--r-- | target/product/aosp_arm64.mk | 1 | ||||
-rw-r--r-- | target/product/core_64_bit.mk | 40 | ||||
-rw-r--r-- | target/product/full_mips64.mk | 1 | ||||
-rwxr-xr-x | target/product/full_x86_64.mk | 4 |
7 files changed, 74 insertions, 19 deletions
diff --git a/core/config.mk b/core/config.mk index 3e76401..c6e859d 100644 --- a/core/config.mk +++ b/core/config.mk @@ -231,12 +231,13 @@ combo_2nd_arch_prefix := $(TARGET_2ND_ARCH_VAR_PREFIX) include $(BUILD_SYSTEM)/combo/select.mk endif -# "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) $(TARGET_CPU_ABI2) $(TARGET_2ND_CPU_ABI) $(TARGET_2ND_CPU_ABI2) +ifdef TARGET_PREFER_32_BIT +TARGET_PREFER_32_BIT_APPS := true +TARGET_PREFER_32_BIT_EXECUTABLES := true +endif + +ifeq (,$(TARGET_SUPPORTS_32_BIT_APPS)$(TARGET_SUPPORTS_64_BIT_APPS)) + TARGET_SUPPORTS_32_BIT_APPS := true endif # "ro.product.cpu.abilist32" and "ro.product.cpu.abilist64" are @@ -249,7 +250,7 @@ endif # is always 32 bits. If this isn't the case, these variables should # be overriden in the boarc configuration. ifeq (,$(TARGET_CPU_ABI_LIST_64_BIT)) - ifeq (true,$(TARGET_IS_64_BIT)) + ifeq (true|true,$(TARGET_IS_64_BIT)|$(TARGET_SUPPORTS_64_BIT_APPS)) TARGET_CPU_ABI_LIST_64_BIT := $(TARGET_CPU_ABI) $(TARGET_CPU_ABI2) endif endif @@ -258,9 +259,23 @@ ifeq (,$(TARGET_CPU_ABI_LIST_32_BIT)) ifneq (true,$(TARGET_IS_64_BIT)) TARGET_CPU_ABI_LIST_32_BIT := $(TARGET_CPU_ABI) $(TARGET_CPU_ABI2) else - # For a 64 bit target, assume that the 2ND_CPU_ABI - # is a 32 bit ABI. - TARGET_CPU_ABI_LIST_32_BIT := $(TARGET_2ND_CPU_ABI) $(TARGET_2ND_CPU_ABI2) + ifeq (true,$(TARGET_SUPPORTS_32_BIT_APPS)) + # For a 64 bit target, assume that the 2ND_CPU_ABI + # is a 32 bit ABI. + TARGET_CPU_ABI_LIST_32_BIT := $(TARGET_2ND_CPU_ABI) $(TARGET_2ND_CPU_ABI2) + endif + endif +endif + +# "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)) + ifeq ($(TARGET_IS_64_BIT)|$(TARGET_PREFER_32_BIT_APPS),true|true) + TARGET_CPU_ABI_LIST := $(TARGET_CPU_ABI_LIST_32_BIT) $(TARGET_CPU_ABI_LIST_64_BIT) + else + TARGET_CPU_ABI_LIST := $(TARGET_CPU_ABI_LIST_64_BIT) $(TARGET_CPU_ABI_LIST_32_BIT) endif endif diff --git a/core/executable.mk b/core/executable.mk index b67ac36..7a3e08e 100644 --- a/core/executable.mk +++ b/core/executable.mk @@ -19,9 +19,9 @@ else #!LOCAL_MULTILIB == both LOCAL_NO_2ND_ARCH_MODULE_SUFFIX := true endif -# if TARGET_PREFER_32_BIT is set, try to build 32-bit first +# if TARGET_PREFER_32_BIT_EXECUTABLES is set, try to build 32-bit first ifdef TARGET_2ND_ARCH -ifeq ($(TARGET_PREFER_32_BIT),true) +ifeq ($(TARGET_PREFER_32_BIT_EXECUTABLES),true) LOCAL_2ND_ARCH_VAR_PREFIX := $(TARGET_2ND_ARCH_VAR_PREFIX) else LOCAL_2ND_ARCH_VAR_PREFIX := @@ -45,7 +45,7 @@ ifndef my_skip_non_preferred_arch ifdef TARGET_2ND_ARCH # check if the non-preferred arch is the primary or secondary -ifeq ($(TARGET_PREFER_32_BIT),true) +ifeq ($(TARGET_PREFER_32_BIT_EXECUTABLES),true) LOCAL_2ND_ARCH_VAR_PREFIX := else LOCAL_2ND_ARCH_VAR_PREFIX := $(TARGET_2ND_ARCH_VAR_PREFIX) diff --git a/core/package.mk b/core/package.mk index fe4d0e4..c7d68d9 100644 --- a/core/package.mk +++ b/core/package.mk @@ -40,9 +40,9 @@ endif LOCAL_NO_2ND_ARCH_MODULE_SUFFIX := true -# if TARGET_PREFER_32_BIT is set, try to build 32-bit first +# if TARGET_PREFER_32_BIT_APPS is set, try to build 32-bit first ifdef TARGET_2ND_ARCH -ifeq ($(TARGET_PREFER_32_BIT),true) +ifeq ($(TARGET_PREFER_32_BIT_APPS),true) LOCAL_2ND_ARCH_VAR_PREFIX := $(TARGET_2ND_ARCH_VAR_PREFIX) else LOCAL_2ND_ARCH_VAR_PREFIX := @@ -56,7 +56,7 @@ ifeq ($(my_module_arch_supported),true) include $(BUILD_SYSTEM)/package_internal.mk else ifneq (,$(TARGET_2ND_ARCH)) # check if the non-preferred arch is the primary or secondary -ifeq ($(TARGET_PREFER_32_BIT),true) +ifeq ($(TARGET_PREFER_32_BIT_APPS),true) LOCAL_2ND_ARCH_VAR_PREFIX := else LOCAL_2ND_ARCH_VAR_PREFIX := $(TARGET_2ND_ARCH_VAR_PREFIX) diff --git a/target/product/aosp_arm64.mk b/target/product/aosp_arm64.mk index 8ff0bd1..e119466 100644 --- a/target/product/aosp_arm64.mk +++ b/target/product/aosp_arm64.mk @@ -19,6 +19,7 @@ # build quite specifically for the emulator, and might not be # entirely appropriate to inherit from for on-device configurations. +$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk) $(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_base_telephony.mk) $(call inherit-product, $(SRC_TARGET_DIR)/board/generic_arm64/device.mk) diff --git a/target/product/core_64_bit.mk b/target/product/core_64_bit.mk new file mode 100644 index 0000000..1947bf2 --- /dev/null +++ b/target/product/core_64_bit.mk @@ -0,0 +1,40 @@ +# +# Copyright (C) 2014 The Android Open Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +# Inherit from this product for devices that support 64-bit apps using: +# $(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk) +# The inheritance for this must come before the inheritance chain that leads +# to core_minimal.mk + +# For now this will allow 64-bit apps, but still compile all apps with JNI +# for 32-bit only. + +# Copy the 32-bit primary, 64-bit secondary zygote startup script +PRODUCT_COPY_FILES += system/core/rootdir/init.zygote32_64.rc:root/init.zygote32_64.rc + +# Set the zygote property to select the 32-bit primary, 64-bit secondary script +# This line must be parsed before the one in core_minimal.mk +PRODUCT_DEFAULT_PROPERTY_OVERRIDES += ro.zygote=zygote32_64 + +# Temporary hack to prefer launching processes as 32 bit +# instead of 64 bit. +# +# STOPSHIP: Revert this to allow products to select it themselves +TARGET_PREFER_32_BIT_APPS := true + +# Temporarily leave these unset to keep all apps with JNI building as 32-bit +# TARGET_SUPPORTS_32_BIT_APPS := true +# TARGET_SUPPORTS_64_BIT_APPS := true diff --git a/target/product/full_mips64.mk b/target/product/full_mips64.mk index 3f171e0..408e81c 100644 --- a/target/product/full_mips64.mk +++ b/target/product/full_mips64.mk @@ -19,6 +19,7 @@ # mips64 build quite specifically for the emulator, and might not be # entirely appropriate to inherit from for on-device configurations. +$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk) $(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_base_telephony.mk) $(call inherit-product, $(SRC_TARGET_DIR)/board/generic_mips64/device.mk) diff --git a/target/product/full_x86_64.mk b/target/product/full_x86_64.mk index ce5dcf7..d9c0c1e 100755 --- a/target/product/full_x86_64.mk +++ b/target/product/full_x86_64.mk @@ -23,9 +23,7 @@ # that isn't a wifi connection. This will instruct init.rc to enable the # network connection so that you can use it with ADB -# Override and force 64-bit Zygote. Must come first. -PRODUCT_DEFAULT_PROPERTY_OVERRIDES += ro.zygote=zygote64 - +$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk) $(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_base_telephony.mk) $(call inherit-product, $(SRC_TARGET_DIR)/board/generic_x86_64/device.mk) |