From 4b1c95d8d2217d877a0f89c55cb08b3caa243e36 Mon Sep 17 00:00:00 2001 From: Ying Wang Date: Tue, 8 Jul 2014 17:07:36 -0700 Subject: [PATCH] More consistent use of 64-bit build variable. Set up TARGET_IS_64_BIT and HOST_IS_64_BIT early so we don't need 2 mechanisms to judge if it's 64-bit build; Remove the unnecessary 32-bit host variables. Change-Id: I08d6d4d9ea70f91135fe2ee05463fb9a0d1cee42 --- core/combo/HOST_darwin-x86_64.mk | 2 -- core/combo/HOST_linux-x86_64.mk | 2 -- core/combo/HOST_windows-x86_64.mk | 2 -- core/combo/TARGET_linux-arm64.mk | 2 -- core/combo/TARGET_linux-mips64.mk | 2 -- core/combo/TARGET_linux-x86_64.mk | 2 -- core/envsetup.mk | 24 +++++++++++------------- core/target_test_internal.mk | 4 ++-- 8 files changed, 13 insertions(+), 27 deletions(-) diff --git a/core/combo/HOST_darwin-x86_64.mk b/core/combo/HOST_darwin-x86_64.mk index 8ad3ba76f..0bc022779 100644 --- a/core/combo/HOST_darwin-x86_64.mk +++ b/core/combo/HOST_darwin-x86_64.mk @@ -17,8 +17,6 @@ # Configuration for Darwin (Mac OS X) on x86_64. # Included by combo/select.mk -HOST_IS_64_BIT := true - HOST_GLOBAL_CFLAGS += -m64 HOST_GLOBAL_LDFLAGS += -m64 diff --git a/core/combo/HOST_linux-x86_64.mk b/core/combo/HOST_linux-x86_64.mk index 8f3a31106..53a3ae8c2 100644 --- a/core/combo/HOST_linux-x86_64.mk +++ b/core/combo/HOST_linux-x86_64.mk @@ -17,8 +17,6 @@ # Configuration for builds hosted on linux-x86_64. # Included by combo/select.mk -HOST_IS_64_BIT := true - ifeq ($(strip $(HOST_TOOLCHAIN_PREFIX)),) HOST_TOOLCHAIN_PREFIX := prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.6/bin/x86_64-linux- endif diff --git a/core/combo/HOST_windows-x86_64.mk b/core/combo/HOST_windows-x86_64.mk index 9edc6195a..c77d82caa 100644 --- a/core/combo/HOST_windows-x86_64.mk +++ b/core/combo/HOST_windows-x86_64.mk @@ -22,8 +22,6 @@ TOOLS_PREFIX := #prebuilt/windows/host/bin/ TOOLS_EXE_SUFFIX := .exe -HOST_IS_64_BIT := true - # Settings to use MinGW has a cross-compiler under Linux ifneq ($(findstring Linux,$(UNAME)),) ifneq ($(strip $(USE_MINGW)),) diff --git a/core/combo/TARGET_linux-arm64.mk b/core/combo/TARGET_linux-arm64.mk index bca69a597..02c4b9969 100644 --- a/core/combo/TARGET_linux-arm64.mk +++ b/core/combo/TARGET_linux-arm64.mk @@ -43,8 +43,6 @@ else TARGET_GCC_VERSION := $(TARGET_GCC_VERSION_EXP) endif -TARGET_IS_64_BIT := true - TARGET_ARCH_SPECIFIC_MAKEFILE := $(BUILD_COMBOS)/arch/$(TARGET_ARCH)/$(TARGET_ARCH_VARIANT).mk ifeq ($(strip $(wildcard $(TARGET_ARCH_SPECIFIC_MAKEFILE))),) $(error Unknown ARM architecture version: $(TARGET_ARCH_VARIANT)) diff --git a/core/combo/TARGET_linux-mips64.mk b/core/combo/TARGET_linux-mips64.mk index c53cf4bdc..aa456efae 100644 --- a/core/combo/TARGET_linux-mips64.mk +++ b/core/combo/TARGET_linux-mips64.mk @@ -43,8 +43,6 @@ else TARGET_GCC_VERSION := $(TARGET_GCC_VERSION_EXP) endif -TARGET_IS_64_BIT := true - TARGET_ARCH_SPECIFIC_MAKEFILE := $(BUILD_COMBOS)/arch/$(TARGET_ARCH)/$(TARGET_ARCH_VARIANT).mk ifeq ($(strip $(wildcard $(TARGET_ARCH_SPECIFIC_MAKEFILE))),) $(error Unknown MIPS architecture variant: $(TARGET_ARCH_VARIANT)) diff --git a/core/combo/TARGET_linux-x86_64.mk b/core/combo/TARGET_linux-x86_64.mk index 2933e54e6..f6a9fc86e 100644 --- a/core/combo/TARGET_linux-x86_64.mk +++ b/core/combo/TARGET_linux-x86_64.mk @@ -31,8 +31,6 @@ else TARGET_GCC_VERSION := $(TARGET_GCC_VERSION_EXP) endif -TARGET_IS_64_BIT := true - # Include the arch-variant-specific configuration file. # Its role is to define various ARCH_X86_HAVE_XXX feature macros, # plus initial values for TARGET_GLOBAL_CFLAGS diff --git a/core/envsetup.mk b/core/envsetup.mk index 9caf7c006..d0b58465e 100644 --- a/core/envsetup.mk +++ b/core/envsetup.mk @@ -72,19 +72,13 @@ endif ifeq (,$(BUILD_HOST_64bit)) # Default to 32-bit-by-default multilib host build. HOST_PREFER_32_BIT := true -ifeq ($(HOST_PREFER_32_BIT),true) -BUILD_HOST_64bit := true -endif endif # HOST_ARCH ifneq (,$(findstring x86_64,$(UNAME))) HOST_ARCH := x86_64 HOST_2ND_ARCH := x86 -else ifneq (,$(findstring 86,$(UNAME))) - # It's not officially supported! - HOST_ARCH := x86 - HOST_2ND_ARCH := + HOST_IS_64_BIT := true endif ifeq ($(HOST_PREFER_32_BIT),true) @@ -170,6 +164,9 @@ board_config_mk := TARGET_OS := linux # TARGET_ARCH should be set by BoardConfig.mk and will be checked later +ifneq ($(filter %64,$(TARGET_ARCH)),) +TARGET_IS_64_BIT := true +endif # the target build type defaults to release ifneq ($(TARGET_BUILD_TYPE),debug) @@ -218,11 +215,7 @@ OUT_DOCS := $(TARGET_COMMON_OUT_ROOT)/docs BUILD_OUT_EXECUTABLES := $(BUILD_OUT)/bin HOST_OUT_EXECUTABLES := $(HOST_OUT)/bin -ifeq (x86_64,$(HOST_ARCH)) HOST_OUT_SHARED_LIBRARIES := $(HOST_OUT)/lib64 -else -HOST_OUT_SHARED_LIBRARIES := $(HOST_OUT)/lib -endif HOST_OUT_JAVA_LIBRARIES := $(HOST_OUT)/framework HOST_OUT_SDK_ADDON := $(HOST_OUT)/sdk_addon @@ -258,7 +251,7 @@ TARGET_OUT_COMMON_GEN := $(TARGET_COMMON_OUT_ROOT)/gen TARGET_OUT := $(PRODUCT_OUT)/$(TARGET_COPY_OUT_SYSTEM) TARGET_OUT_EXECUTABLES := $(TARGET_OUT)/bin TARGET_OUT_OPTIONAL_EXECUTABLES := $(TARGET_OUT)/xbin -ifneq ($(filter %64,$(TARGET_ARCH)),) +ifeq ($(TARGET_IS_64_BIT),true) # /system/lib always contains 32-bit libraries, # and /system/lib64 (if present) always contains 64-bit libraries. TARGET_OUT_SHARED_LIBRARIES := $(TARGET_OUT)/lib64 @@ -292,19 +285,24 @@ TARGET_OUT_DATA_APPS := $(TARGET_OUT_DATA)/app TARGET_OUT_DATA_KEYLAYOUT := $(TARGET_OUT_KEYLAYOUT) TARGET_OUT_DATA_KEYCHARS := $(TARGET_OUT_KEYCHARS) TARGET_OUT_DATA_ETC := $(TARGET_OUT_ETC) +ifeq ($(TARGET_IS_64_BIT),true) +TARGET_OUT_DATA_NATIVE_TESTS := $(TARGET_OUT_DATA)/nativetest64 +else TARGET_OUT_DATA_NATIVE_TESTS := $(TARGET_OUT_DATA)/nativetest +endif TARGET_OUT_DATA_FAKE := $(TARGET_OUT_DATA)/fake_packages $(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_DATA_EXECUTABLES := $(TARGET_OUT_DATA_EXECUTABLES) $(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_DATA_SHARED_LIBRARIES := $($(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_SHARED_LIBRARIES) $(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_DATA_APPS := $(TARGET_OUT_DATA_APPS) +$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_DATA_NATIVE_TESTS := $(TARGET_OUT_DATA)/nativetest TARGET_OUT_CACHE := $(PRODUCT_OUT)/cache TARGET_OUT_VENDOR := $(PRODUCT_OUT)/$(TARGET_COPY_OUT_VENDOR) TARGET_OUT_VENDOR_EXECUTABLES := $(TARGET_OUT_VENDOR)/bin TARGET_OUT_VENDOR_OPTIONAL_EXECUTABLES := $(TARGET_OUT_VENDOR)/xbin -ifneq ($(filter %64,$(TARGET_ARCH)),) +ifeq ($(TARGET_IS_64_BIT),true) TARGET_OUT_VENDOR_SHARED_LIBRARIES := $(TARGET_OUT_VENDOR)/lib64 else TARGET_OUT_VENDOR_SHARED_LIBRARIES := $(TARGET_OUT_VENDOR)/lib diff --git a/core/target_test_internal.mk b/core/target_test_internal.mk index 87503ea7c..95d415989 100644 --- a/core/target_test_internal.mk +++ b/core/target_test_internal.mk @@ -31,5 +31,5 @@ ifdef LOCAL_MODULE_PATH_64 $(error $(LOCAL_PATH): Do not set LOCAL_MODULE_PATH_64 when building test $(LOCAL_MODULE)) endif -LOCAL_MODULE_PATH_32 := $(TARGET_OUT_DATA_NATIVE_TESTS)/$(LOCAL_MODULE) -LOCAL_MODULE_PATH_64 := $(TARGET_OUT_DATA_NATIVE_TESTS)64/$(LOCAL_MODULE) +LOCAL_MODULE_PATH_64 := $(TARGET_OUT_DATA_NATIVE_TESTS)/$(LOCAL_MODULE) +LOCAL_MODULE_PATH_32 := $($(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_DATA_NATIVE_TESTS)/$(LOCAL_MODULE)