diff options
author | Ying Wang <wangying@google.com> | 2014-05-23 17:39:40 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2014-05-23 17:39:40 +0000 |
commit | 6cb69bd4f20ac3ae3a7d5b5cc323c4480cf8ef75 (patch) | |
tree | 20af26c323be53d7bccdbcbeaf25a5382d1a840c /core | |
parent | e45c8607b3e2cf7a428a91898aea2752a54389a1 (diff) | |
parent | 966c1e0cae6a59f15264d3b542af08e21e2dc06c (diff) | |
download | build-6cb69bd4f20ac3ae3a7d5b5cc323c4480cf8ef75.zip build-6cb69bd4f20ac3ae3a7d5b5cc323c4480cf8ef75.tar.gz build-6cb69bd4f20ac3ae3a7d5b5cc323c4480cf8ef75.tar.bz2 |
Merge "Add HOST_PREFER_32_BIT to support 32-bit-by-default multilib build"
Diffstat (limited to 'core')
-rw-r--r-- | core/base_rules.mk | 8 | ||||
-rw-r--r-- | core/configure_module_stem.mk | 22 | ||||
-rw-r--r-- | core/definitions.mk | 3 | ||||
-rw-r--r-- | core/dex_preopt_libart.mk | 5 | ||||
-rw-r--r-- | core/dynamic_binary.mk | 6 | ||||
-rw-r--r-- | core/envsetup.mk | 10 | ||||
-rw-r--r-- | core/host_executable.mk | 7 | ||||
-rw-r--r-- | core/host_shared_library.mk | 7 | ||||
-rw-r--r-- | core/host_static_library.mk | 7 | ||||
-rw-r--r-- | core/install_jni_libs.mk | 2 | ||||
-rw-r--r-- | core/main.mk | 8 |
11 files changed, 54 insertions, 31 deletions
diff --git a/core/base_rules.mk b/core/base_rules.mk index 801e2c8..8b3614a 100644 --- a/core/base_rules.mk +++ b/core/base_rules.mk @@ -173,11 +173,11 @@ ifdef OVERRIDE_BUILT_MODULE_PATH else built_module_path := $(intermediates) endif -LOCAL_BUILT_MODULE := $(built_module_path)/$(LOCAL_BUILT_MODULE_STEM) +LOCAL_BUILT_MODULE := $(built_module_path)/$(my_built_module_stem) built_module_path := ifneq (true,$(LOCAL_UNINSTALLABLE_MODULE)) - LOCAL_INSTALLED_MODULE := $(my_module_path)/$(LOCAL_INSTALLED_MODULE_STEM) + LOCAL_INSTALLED_MODULE := $(my_module_path)/$(my_installed_module_stem) endif # Assemble the list of targets to create PRIVATE_ variables for. @@ -569,10 +569,12 @@ endif ifdef LOCAL_DONT_CHECK_MODULE LOCAL_CHECKED_MODULE := endif -# Don't check build the module defined for the 2nd arch +# Don't check build target module defined for the 2nd arch +ifndef LOCAL_IS_HOST_MODULE ifdef LOCAL_2ND_ARCH_VAR_PREFIX LOCAL_CHECKED_MODULE := endif +endif ########################################################### ## Register with ALL_MODULES diff --git a/core/configure_module_stem.mk b/core/configure_module_stem.mk index 1560055..48b7787 100644 --- a/core/configure_module_stem.mk +++ b/core/configure_module_stem.mk @@ -1,16 +1,20 @@ my_multilib_stem := $(LOCAL_MODULE_STEM_$(if $($(LOCAL_2ND_ARCH_VAR_PREFIX)$(my_prefix)IS_64_BIT),64,32)) ifdef my_multilib_stem -LOCAL_MODULE_STEM := $(my_multilib_stem) + my_module_stem := $(my_multilib_stem) +else ifdef LOCAL_MODULE_STEM + my_module_stem := $(LOCAL_MODULE_STEM) +else + my_module_stem := $(LOCAL_MODULE) endif -ifndef LOCAL_MODULE_STEM - LOCAL_MODULE_STEM := $(LOCAL_MODULE) +ifdef LOCAL_BUILT_MODULE_STEM + my_built_module_stem := $(LOCAL_BUILT_MODULE_STEM) +else + my_built_module_stem := $(my_module_stem)$(LOCAL_MODULE_SUFFIX) endif -ifndef LOCAL_BUILT_MODULE_STEM - LOCAL_BUILT_MODULE_STEM := $(LOCAL_MODULE_STEM)$(LOCAL_MODULE_SUFFIX) -endif - -ifndef LOCAL_INSTALLED_MODULE_STEM - LOCAL_INSTALLED_MODULE_STEM := $(LOCAL_MODULE_STEM)$(LOCAL_MODULE_SUFFIX) +ifdef LOCAL_INSTALLED_MODULE_STEM + my_installed_module_stem := $(LOCAL_INSTALLED_MODULE_STEM) +else + my_installed_module_stem := $(my_module_stem)$(LOCAL_MODULE_SUFFIX) endif diff --git a/core/definitions.mk b/core/definitions.mk index a024c9a..e35d36f 100644 --- a/core/definitions.mk +++ b/core/definitions.mk @@ -84,8 +84,9 @@ ALL_GPL_MODULE_LICENSE_FILES:= # Target and host installed module's dependencies on shared libraries. # They are list of "<module_name>:<installed_file>:lib1,lib2...". TARGET_DEPENDENCIES_ON_SHARED_LIBRARIES := -2ND_TARGET_DEPENDENCIES_ON_SHARED_LIBRARIES := +$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_DEPENDENCIES_ON_SHARED_LIBRARIES := HOST_DEPENDENCIES_ON_SHARED_LIBRARIES := +$(HOST_2ND_ARCH_VAR_PREFIX)HOST_DEPENDENCIES_ON_SHARED_LIBRARIES := # Generated class file names for Android resource. # They are escaped and quoted so can be passed safely to a bash command. diff --git a/core/dex_preopt_libart.mk b/core/dex_preopt_libart.mk index 7d8cee0..411af75 100644 --- a/core/dex_preopt_libart.mk +++ b/core/dex_preopt_libart.mk @@ -6,20 +6,15 @@ DEX2OAT := $(HOST_OUT_EXECUTABLES)/dex2oat$(HOST_EXECUTABLE_SUFFIX) DEX2OATD := $(HOST_OUT_EXECUTABLES)/dex2oatd$(HOST_EXECUTABLE_SUFFIX) -LIBART_COMPILER := $(HOST_OUT_SHARED_LIBRARIES)/libart-compiler$(HOST_SHLIB_SUFFIX) -LIBARTD_COMPILER := $(HOST_OUT_SHARED_LIBRARIES)/libartd-compiler$(HOST_SHLIB_SUFFIX) - # By default, do not run rerun dex2oat if the tool changes. # Comment out the | to force dex2oat to rerun on after all changes. DEX2OAT_DEPENDENCY := art/runtime/oat.cc # dependency on oat version number DEX2OAT_DEPENDENCY += art/runtime/image.cc # dependency on image version number DEX2OAT_DEPENDENCY += | DEX2OAT_DEPENDENCY += $(DEX2OAT) -DEX2OAT_DEPENDENCY += $(LIBART_COMPILER) DEX2OATD_DEPENDENCY := $(DEX2OAT_DEPENDENCY) DEX2OATD_DEPENDENCY += $(DEX2OATD) -DEX2OATD_DEPENDENCY += $(LIBARTD_COMPILER) PRELOADED_CLASSES := frameworks/base/preloaded-classes diff --git a/core/dynamic_binary.mk b/core/dynamic_binary.mk index e538d1e..396199c 100644 --- a/core/dynamic_binary.mk +++ b/core/dynamic_binary.mk @@ -26,7 +26,7 @@ guessed_intermediates := $(call local-intermediates-dir,,$(LOCAL_2ND_ARCH_VAR_PR # The basename of this target must be the same as the final output # binary name, because it's used to set the "soname" in the binary. # The includer of this file will define a rule to build this target. -linked_module := $(guessed_intermediates)/LINKED/$(LOCAL_BUILT_MODULE_STEM) +linked_module := $(guessed_intermediates)/LINKED/$(my_built_module_stem) ALL_ORIGINAL_DYNAMIC_BINARIES += $(linked_module) @@ -57,7 +57,7 @@ endif ifeq ($(LOCAL_COMPRESS_MODULE_SYMBOLS),true) $(error Symbol compression not yet supported.) -compress_output := $(intermediates)/COMPRESSED-$(LOCAL_BUILT_MODULE_STEM) +compress_output := $(intermediates)/COMPRESSED-$(my_built_module_stem) #TODO: write the real $(STRIPPER) rule. #TODO: define a rule to build TARGET_SYMBOL_FILTER_FILE, and @@ -79,7 +79,7 @@ else my_unstripped_path := $(LOCAL_UNSTRIPPED_PATH) endif symbolic_input := $(compress_output) -symbolic_output := $(my_unstripped_path)/$(LOCAL_INSTALLED_MODULE_STEM) +symbolic_output := $(my_unstripped_path)/$(my_installed_module_stem) $(symbolic_output) : $(symbolic_input) | $(ACP) @echo "target Symbolic: $(PRIVATE_MODULE) ($@)" $(copy-file-to-target) diff --git a/core/envsetup.mk b/core/envsetup.mk index df76c51..a228fc7 100644 --- a/core/envsetup.mk +++ b/core/envsetup.mk @@ -67,6 +67,10 @@ ifeq ($(HOST_OS),) $(error Unable to determine HOST_OS from uname -sm: $(UNAME)!) endif +ifeq ($(HOST_PREFER_32_BIT),true) +# User asks for multilib build, but use 32-bit as preferred arch. +BUILD_HOST_64bit := true +endif # HOST_ARCH ifneq (,$(findstring x86_64,$(UNAME))) @@ -228,7 +232,13 @@ HOST_2ND_ARCH_VAR_PREFIX := 2ND_ HOST_2ND_ARCH_MODULE_SUFFIX := _32 $(HOST_2ND_ARCH_VAR_PREFIX)HOST_OUT_INTERMEDIATES := $(HOST_OUT)/obj32 $(HOST_2ND_ARCH_VAR_PREFIX)HOST_OUT_INTERMEDIATE_LIBRARIES := $($(HOST_2ND_ARCH_VAR_PREFIX)HOST_OUT_INTERMEDIATES)/lib +ifeq ($(HOST_PREFER_32_BIT),true) +# To keep path compatibility, put 32-bit libs in lib/ and 64-bit libs in lib64/. +HOST_OUT_SHARED_LIBRARIES := $(HOST_OUT)/lib64 +$(HOST_2ND_ARCH_VAR_PREFIX)HOST_OUT_SHARED_LIBRARIES := $(HOST_OUT)/lib +else $(HOST_2ND_ARCH_VAR_PREFIX)HOST_OUT_SHARED_LIBRARIES := $(HOST_OUT)/lib32 +endif $(HOST_2ND_ARCH_VAR_PREFIX)HOST_OUT_EXECUTABLES := $(HOST_OUT_EXECUTABLES) diff --git a/core/host_executable.mk b/core/host_executable.mk index 874bf87..53b5fd1 100644 --- a/core/host_executable.mk +++ b/core/host_executable.mk @@ -3,9 +3,13 @@ my_prefix := HOST_ include $(BUILD_SYSTEM)/multilib.mk ifndef my_module_multilib +ifeq ($(HOST_PREFER_32_BIT),true) +my_module_multilib := 32 +else # By default we only build host module for the first arch. my_module_multilib := first endif +endif ifeq ($(my_module_multilib),both) ifeq ($(LOCAL_MODULE_PATH_32)$(LOCAL_MODULE_STEM_32),) @@ -33,9 +37,6 @@ ifeq ($(my_module_arch_supported),true) OVERRIDE_BUILT_MODULE_PATH := LOCAL_BUILT_MODULE := LOCAL_INSTALLED_MODULE := -LOCAL_MODULE_STEM := -LOCAL_BUILT_MODULE_STEM := -LOCAL_INSTALLED_MODULE_STEM := LOCAL_INTERMEDIATE_TARGETS := include $(BUILD_SYSTEM)/host_executable_internal.mk diff --git a/core/host_shared_library.mk b/core/host_shared_library.mk index de5e6ad..2fdf61f 100644 --- a/core/host_shared_library.mk +++ b/core/host_shared_library.mk @@ -2,9 +2,13 @@ my_prefix := HOST_ include $(BUILD_SYSTEM)/multilib.mk ifndef my_module_multilib +ifeq ($(HOST_PREFER_32_BIT),true) +my_module_multilib := 32 +else # By default we only build host module for the first arch. my_module_multilib := first endif +endif LOCAL_2ND_ARCH_VAR_PREFIX := include $(BUILD_SYSTEM)/module_arch_supported.mk @@ -21,9 +25,6 @@ ifeq ($(my_module_arch_supported),true) OVERRIDE_BUILT_MODULE_PATH := LOCAL_BUILT_MODULE := LOCAL_INSTALLED_MODULE := -LOCAL_MODULE_STEM := -LOCAL_BUILT_MODULE_STEM := -LOCAL_INSTALLED_MODULE_STEM := LOCAL_INTERMEDIATE_TARGETS := include $(BUILD_SYSTEM)/host_shared_library_internal.mk diff --git a/core/host_static_library.mk b/core/host_static_library.mk index ab3f16e..c40cf7d 100644 --- a/core/host_static_library.mk +++ b/core/host_static_library.mk @@ -2,9 +2,13 @@ my_prefix := HOST_ include $(BUILD_SYSTEM)/multilib.mk ifndef my_module_multilib +ifeq ($(HOST_PREFER_32_BIT),true) +my_module_multilib := 32 +else # By default we only build host module for the first arch. my_module_multilib := first endif +endif LOCAL_2ND_ARCH_VAR_PREFIX := include $(BUILD_SYSTEM)/module_arch_supported.mk @@ -21,9 +25,6 @@ ifeq ($(my_module_arch_supported),true) OVERRIDE_BUILT_MODULE_PATH := LOCAL_BUILT_MODULE := LOCAL_INSTALLED_MODULE := -LOCAL_MODULE_STEM := -LOCAL_BUILT_MODULE_STEM := -LOCAL_INSTALLED_MODULE_STEM := LOCAL_INTERMEDIATE_TARGETS := include $(BUILD_SYSTEM)/host_static_library_internal.mk diff --git a/core/install_jni_libs.mk b/core/install_jni_libs.mk index b9e70b1..700d106 100644 --- a/core/install_jni_libs.mk +++ b/core/install_jni_libs.mk @@ -36,7 +36,7 @@ my_embed_jni := true endif # App-specific lib path. -my_app_lib_path := $($(LOCAL_2ND_ARCH_VAR_PREFIX)TARGET$(partition_tag)_OUT_SHARED_LIBRARIES)/$(basename $(LOCAL_INSTALLED_MODULE_STEM)) +my_app_lib_path := $($(LOCAL_2ND_ARCH_VAR_PREFIX)TARGET$(partition_tag)_OUT_SHARED_LIBRARIES)/$(basename $(my_installed_module_stem)) my_extracted_jni_libs := ifdef my_embed_jni diff --git a/core/main.mk b/core/main.mk index fa8e872..b07d5a1 100644 --- a/core/main.mk +++ b/core/main.mk @@ -647,6 +647,14 @@ $(foreach m,$($(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_DEPENDENCIES_ON_SHARED_LIBRARI $(subst $(comma),$(space),$(lastword $(p))))))) \ $(eval $(call add-required-deps,$(word 2,$(p)),$(r)))) endif +ifdef HOST_2ND_ARCH +$(foreach m,$($(HOST_2ND_ARCH_VAR_PREFIX)HOST_DEPENDENCIES_ON_SHARED_LIBRARIES), \ + $(eval p := $(subst :,$(space),$(m))) \ + $(eval r := $(filter $(HOST_OUT_ROOT)/%,$(call module-installed-files,\ + $(addsuffix $(HOST_2ND_ARCH_MODULE_SUFFIX), \ + $(subst $(comma),$(space),$(lastword $(p))))))) \ + $(eval $(call add-required-deps,$(word 2,$(p)),$(r)))) +endif m := r := |