From d54520a667e3bd5c9f2abe98573a5de83bcf4872 Mon Sep 17 00:00:00 2001 From: Ying Wang Date: Mon, 8 Dec 2014 14:46:29 -0800 Subject: [PATCH] Remove libdvm support from the core build system. Now libart is the only supported runtime and we don't need the build variables PRODUCT_RUNTIMES and DALVIK_VM_LIB. Bug: 18465297 Change-Id: Ibfda931cde0649163d79b584fb5ccad927a9bc2b --- core/dex_preopt.mk | 9 ++---- core/dex_preopt_odex_install.mk | 15 --------- core/java_library.mk | 6 ---- core/main.mk | 12 +++---- core/product.mk | 1 - core/product_config.mk | 30 ----------------- target/product/core_minimal.mk | 3 +- target/product/core_tiny.mk | 3 +- target/product/full_mips64.mk | 2 -- target/product/full_x86_64.mk | 2 -- target/product/runtime_common.mk | 41 ------------------------ target/product/runtime_libart.mk | 34 ++++++++++++++++---- target/product/runtime_libart_default.mk | 21 ------------ target/product/runtime_libdvm.mk | 24 -------------- target/product/runtime_libdvm_default.mk | 21 ------------ 15 files changed, 38 insertions(+), 186 deletions(-) delete mode 100644 target/product/runtime_common.mk delete mode 100644 target/product/runtime_libart_default.mk delete mode 100644 target/product/runtime_libdvm.mk delete mode 100644 target/product/runtime_libdvm_default.mk diff --git a/core/dex_preopt.mk b/core/dex_preopt.mk index 231a04e5f..8b555e090 100644 --- a/core/dex_preopt.mk +++ b/core/dex_preopt.mk @@ -3,8 +3,6 @@ # #################################### -ifneq ($(DALVIK_VM_LIB),) - # list of boot classpath jars for dexpreopt DEXPREOPT_BOOT_JARS := $(subst $(space),:,$(PRODUCT_BOOT_JARS)) DEXPREOPT_BOOT_JARS_MODULES := $(PRODUCT_BOOT_JARS) @@ -18,6 +16,9 @@ DEXPREOPT_PRODUCT_DIR := $(patsubst $(DEXPREOPT_BUILD_DIR)/%,%,$(DEXPREOPT_PRODU DEXPREOPT_BOOT_JAR_DIR := system/framework DEXPREOPT_BOOT_JAR_DIR_FULL_PATH := $(DEXPREOPT_PRODUCT_DIR_FULL_PATH)/$(DEXPREOPT_BOOT_JAR_DIR) +# The default value for LOCAL_DEX_PREOPT +DEX_PREOPT_DEFAULT ?= true + # $(1): the .jar or .apk to remove classes.dex define dexpreopt-remove-classes.dex $(hide) zip --quiet --delete $(1) classes.dex; \ @@ -60,7 +61,3 @@ DEXPREOPT_ONE_FILE_DEPENDENCY_BUILT_BOOT_PREOPT := $(DEFAULT_DEX_PREOPT_BUILT_IM ifdef TARGET_2ND_ARCH $(TARGET_2ND_ARCH_VAR_PREFIX)DEXPREOPT_ONE_FILE_DEPENDENCY_BUILT_BOOT_PREOPT := $($(TARGET_2ND_ARCH_VAR_PREFIX)DEFAULT_DEX_PREOPT_BUILT_IMAGE_FILENAME) endif # TARGET_2ND_ARCH -else -$(warning No DALVIK_VM_LIB, disable dexpreopt.) -WITH_DEXPREOPT := false -endif # DALVIK_VM_LIB is defined. diff --git a/core/dex_preopt_odex_install.mk b/core/dex_preopt_odex_install.mk index cb38261ab..f8f772375 100644 --- a/core/dex_preopt_odex_install.mk +++ b/core/dex_preopt_odex_install.mk @@ -50,26 +50,12 @@ built_installed_odex := ifdef LOCAL_DEX_PREOPT dexpreopt_boot_jar_module := $(filter $(DEXPREOPT_BOOT_JARS_MODULES),$(LOCAL_MODULE)) ifdef dexpreopt_boot_jar_module -ifeq ($(DALVIK_VM_LIB),libdvm.so) -built_odex := $(basename $(LOCAL_BUILT_MODULE)).odex -installed_odex := $(basename $(LOCAL_INSTALLED_MODULE)).odex -built_installed_odex := $(built_odex):$(installed_odex) -else # libdvm.so # For libart, the boot jars' odex files are replaced by $(DEFAULT_DEX_PREOPT_INSTALLED_IMAGE). # We use this installed_odex trick to get boot.art installed. installed_odex := $(DEFAULT_DEX_PREOPT_INSTALLED_IMAGE) # Append the odex for the 2nd arch if we have one. installed_odex += $($(TARGET_2ND_ARCH_VAR_PREFIX)DEFAULT_DEX_PREOPT_INSTALLED_IMAGE) -endif # libdvm.so else # boot jar -ifeq ($(DALVIK_VM_LIB),libdvm.so) -built_odex := $(basename $(LOCAL_BUILT_MODULE)).odex -installed_odex := $(basename $(LOCAL_INSTALLED_MODULE)).odex -built_installed_odex := $(built_odex):$(installed_odex) - -$(built_odex) : $(DEXPREOPT_ONE_FILE_DEPENDENCY_BUILT_BOOT_PREOPT) \ - $(DEXPREOPT_ONE_FILE_DEPENDENCY_TOOLS) -else # libart ifeq ($(LOCAL_MODULE_CLASS),JAVA_LIBRARIES) # For a Java library, we build odex for both 1st arch and 2nd arch, if we have one. # ################################################# @@ -95,7 +81,6 @@ include $(BUILD_SYSTEM)/setup_one_odex.mk endif # LOCAL_MULTILIB is both endif # TARGET_2ND_ARCH endif # LOCAL_MODULE_CLASS -endif # libart endif # boot jar ifdef built_odex diff --git a/core/java_library.mk b/core/java_library.mk index dffc7d90a..5f7c784ac 100644 --- a/core/java_library.mk +++ b/core/java_library.mk @@ -85,12 +85,6 @@ $(LOCAL_BUILT_MODULE) : $(dexpreopted_boot_jar) | $(ACP) $(call copy-file-to-target) # For libart boot jars, we don't have .odex files. -ifeq ($(DALVIK_VM_LIB),libdvm.so) -dexpreopted_boot_odex := $(DEXPREOPT_BOOT_JAR_DIR_FULL_PATH)/$(dexpreopt_boot_jar_module).odex -$(built_odex) : $(dexpreopted_boot_odex) | $(ACP) - $(call copy-file-to-target) -endif - else # ! boot jar $(built_odex): PRIVATE_MODULE := $(LOCAL_MODULE) # Use pattern rule - we may have multiple built odex files. diff --git a/core/main.mk b/core/main.mk index 7f4b21712..8ed46ac39 100644 --- a/core/main.mk +++ b/core/main.mk @@ -307,6 +307,7 @@ endif # Add build properties for ART. These define system properties used by installd # to pass flags to dex2oat. +ADDITIONAL_BUILD_PROPERTIES += persist.sys.dalvik.vm.lib.2=libart ADDITIONAL_BUILD_PROPERTIES += dalvik.vm.isa.$(TARGET_ARCH).variant=$(DEX2OAT_TARGET_CPU_VARIANT) ifneq ($(DEX2OAT_TARGET_INSTRUCTION_SET_FEATURES),) ADDITIONAL_BUILD_PROPERTIES += dalvik.vm.isa.$(TARGET_ARCH).features=$(DEX2OAT_TARGET_INSTRUCTION_SET_FEATURES) @@ -336,15 +337,14 @@ ifneq (,$(user_variant)) enable_target_debugging := endif - # Turn on Dalvik preoptimization for libdvm.so user builds, but only if not + # Turn on Dalvik preoptimization for user builds, but only if not # explicitly disabled and the build is running on Linux (since host # Dalvik isn't built for non-Linux hosts). ifeq (,$(WITH_DEXPREOPT)) - ifeq ($(DALVIK_VM_LIB),libdvm.so) - ifeq ($(user_variant),user) - ifeq ($(HOST_OS),linux) - WITH_DEXPREOPT := true - endif + ifeq ($(user_variant),user) + ifeq ($(HOST_OS),linux) + # TODO: turn on WITH_DEXPREOPT for libart user builds. + # WITH_DEXPREOPT := true endif endif endif diff --git a/core/product.mk b/core/product.mk index a7a1fb2ea..f901a388a 100644 --- a/core/product.mk +++ b/core/product.mk @@ -98,7 +98,6 @@ _product_var_list := \ PRODUCT_VENDOR_KERNEL_HEADERS \ PRODUCT_FACTORY_RAMDISK_MODULES \ PRODUCT_FACTORY_BUNDLE_MODULES \ - PRODUCT_RUNTIMES \ PRODUCT_BOOT_JARS \ PRODUCT_SUPPORTS_VERITY \ PRODUCT_OEM_PROPERTIES \ diff --git a/core/product_config.mk b/core/product_config.mk index d4ba3643b..2e823818e 100644 --- a/core/product_config.mk +++ b/core/product_config.mk @@ -247,36 +247,6 @@ all_product_makefiles := all_product_configs := -############################################################################# -# TODO: Remove this hack once only 1 runtime is left. -# Include the runtime product makefile based on the product's PRODUCT_RUNTIMES -$(call clear-var-list, $(_product_var_list)) - -# Set PRODUCT_RUNTIMES, allowing buildspec to override using OVERRIDE_RUNTIMES -product_runtimes := $(sort $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_RUNTIMES)) -ifneq ($(OVERRIDE_RUNTIMES),) - $(info Overriding PRODUCT_RUNTIMES=$(product_runtimes) with $(OVERRIDE_RUNTIMES)) - product_runtimes := $(OVERRIDE_RUNTIMES) -endif -$(foreach runtime, $(product_runtimes), $(eval include $(SRC_TARGET_DIR)/product/$(runtime).mk)) -$(foreach v, $(_product_var_list), $(if $($(v)),\ - $(eval PRODUCTS.$(INTERNAL_PRODUCT).$(v) += $(sort $($(v)))))) - -$(call clear-var-list, $(_product_var_list)) -# Now we can assign to PRODUCT_RUNTIMES -PRODUCT_RUNTIMES := $(product_runtimes) -product_runtimes := - -PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PROPERTY_OVERRIDES += persist.sys.dalvik.vm.lib.2=$(DALVIK_VM_LIB) - -ifeq ($(words $(PRODUCT_RUNTIMES)),1) - # If we only have one runtime, we can strip classes.dex by default during dex_preopt - DEX_PREOPT_DEFAULT := true -else - # If we have more than one, we leave the classes.dex alone for post-boot analysis - DEX_PREOPT_DEFAULT := nostripping -endif - ############################################################################# # A list of module names of BOOTCLASSPATH (jar files) diff --git a/target/product/core_minimal.mk b/target/product/core_minimal.mk index 4c08cb027..9c5a13b0c 100644 --- a/target/product/core_minimal.mk +++ b/target/product/core_minimal.mk @@ -100,11 +100,10 @@ PRODUCT_SYSTEM_SERVER_JARS := \ ethernet-service \ wifi-service -PRODUCT_RUNTIMES := runtime_libart_default - PRODUCT_DEFAULT_PROPERTY_OVERRIDES += \ ro.zygote=zygote32 PRODUCT_COPY_FILES += \ system/core/rootdir/init.zygote32.rc:root/init.zygote32.rc +$(call inherit-product, $(SRC_TARGET_DIR)/product/runtime_libart.mk) $(call inherit-product, $(SRC_TARGET_DIR)/product/base.mk) diff --git a/target/product/core_tiny.mk b/target/product/core_tiny.mk index d6dbe9899..4f948f131 100644 --- a/target/product/core_tiny.mk +++ b/target/product/core_tiny.mk @@ -100,8 +100,6 @@ PRODUCT_SYSTEM_SERVER_JARS := \ services \ wifi-service -PRODUCT_RUNTIMES := runtime_libart_default - PRODUCT_DEFAULT_PROPERTY_OVERRIDES += \ ro.zygote=zygote32 PRODUCT_COPY_FILES += \ @@ -110,6 +108,7 @@ PRODUCT_COPY_FILES += \ PRODUCT_PROPERTY_OVERRIDES += \ ro.carrier=unknown +$(call inherit-product, $(SRC_TARGET_DIR)/product/runtime_libart.mk) $(call inherit-product, $(SRC_TARGET_DIR)/product/base.mk) $(call inherit-product-if-exists, frameworks/base/data/fonts/fonts.mk) diff --git a/target/product/full_mips64.mk b/target/product/full_mips64.mk index 408e81c10..e813e41b3 100644 --- a/target/product/full_mips64.mk +++ b/target/product/full_mips64.mk @@ -23,8 +23,6 @@ $(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) -PRODUCT_RUNTIMES := runtime_libart_default - include $(SRC_TARGET_DIR)/product/emulator.mk # Overrides diff --git a/target/product/full_x86_64.mk b/target/product/full_x86_64.mk index d9c0c1ea5..051a86ed6 100755 --- a/target/product/full_x86_64.mk +++ b/target/product/full_x86_64.mk @@ -27,8 +27,6 @@ $(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) -PRODUCT_RUNTIMES := runtime_libart_default - include $(SRC_TARGET_DIR)/product/emulator.mk ifdef NET_ETH0_STARTONBOOT diff --git a/target/product/runtime_common.mk b/target/product/runtime_common.mk deleted file mode 100644 index 9ae182a37..000000000 --- a/target/product/runtime_common.mk +++ /dev/null @@ -1,41 +0,0 @@ -# -# Copyright (C) 2013 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. -# - -# Common runtime modules for both Dalvik and ART - -PRODUCT_PACKAGES += \ - apache-xml \ - bouncycastle \ - cacerts \ - conscrypt \ - core-junit \ - dalvikvm \ - dexdeps \ - dexdump \ - dexlist \ - dmtracedump \ - dx \ - ext \ - hprof-conv \ - libcrypto \ - libexpat \ - libicui18n \ - libicuuc \ - libjavacore \ - libnativehelper \ - libssl \ - libz \ - okhttp diff --git a/target/product/runtime_libart.mk b/target/product/runtime_libart.mk index e4200b30f..a35122b06 100644 --- a/target/product/runtime_libart.mk +++ b/target/product/runtime_libart.mk @@ -17,11 +17,33 @@ # Provides a functioning ART environment without Android frameworks PRODUCT_PACKAGES += \ - core-libart \ - libart \ - dex2oat \ - oatdump \ - patchoat + apache-xml \ + bouncycastle \ + cacerts \ + conscrypt \ + core-junit \ + core-libart \ + dalvikvm \ + dex2oat \ + dexdeps \ + dexdump \ + dexlist \ + dmtracedump \ + dx \ + ext \ + hprof-conv \ + libart \ + libcrypto \ + libexpat \ + libicui18n \ + libicuuc \ + libjavacore \ + libnativehelper \ + libssl \ + libz \ + oatdump \ + okhttp \ + patchoat PRODUCT_DEFAULT_PROPERTY_OVERRIDES += \ dalvik.vm.image-dex2oat-Xms=64m \ @@ -29,5 +51,3 @@ PRODUCT_DEFAULT_PROPERTY_OVERRIDES += \ dalvik.vm.dex2oat-Xms=64m \ dalvik.vm.dex2oat-Xmx=512m \ ro.dalvik.vm.native.bridge=0 \ - -include $(SRC_TARGET_DIR)/product/runtime_common.mk diff --git a/target/product/runtime_libart_default.mk b/target/product/runtime_libart_default.mk deleted file mode 100644 index 2d4c7934a..000000000 --- a/target/product/runtime_libart_default.mk +++ /dev/null @@ -1,21 +0,0 @@ -# -# Copyright (C) 2013 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. -# - -# Set ART as the default runtime environment - -DALVIK_VM_LIB := libart.so - -include $(SRC_TARGET_DIR)/product/runtime_libart.mk diff --git a/target/product/runtime_libdvm.mk b/target/product/runtime_libdvm.mk deleted file mode 100644 index 638d7d793..000000000 --- a/target/product/runtime_libdvm.mk +++ /dev/null @@ -1,24 +0,0 @@ -# -# Copyright (C) 2013 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. -# - -# Provides a functioning Dalvik environment without Android frameworks - -PRODUCT_PACKAGES += \ - core \ - libdvm \ - dexopt - -include $(SRC_TARGET_DIR)/product/runtime_common.mk diff --git a/target/product/runtime_libdvm_default.mk b/target/product/runtime_libdvm_default.mk deleted file mode 100644 index b581ce5ec..000000000 --- a/target/product/runtime_libdvm_default.mk +++ /dev/null @@ -1,21 +0,0 @@ -# -# Copyright (C) 2013 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. -# - -# Set Dalvik as the default runtime environment - -DALVIK_VM_LIB := libdvm.so - -include $(SRC_TARGET_DIR)/product/runtime_libdvm.mk