Merge "Add HOST_PREFER_32_BIT to support 32-bit-by-default multilib build"

This commit is contained in:
Ying Wang 2014-05-23 17:39:40 +00:00 committed by Gerrit Code Review
commit 6cb69bd4f2
11 changed files with 54 additions and 31 deletions

View file

@ -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

View file

@ -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

View file

@ -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.

View file

@ -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

View file

@ -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)

View file

@ -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)

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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 :=