From d6e3b841850d9a607eb9c841d9fa1836feedee5f Mon Sep 17 00:00:00 2001 From: Dan Willemsen Date: Tue, 9 Feb 2016 14:55:13 -0800 Subject: [PATCH] Tell Soong about HOST_CROSS_* This configures Soong to build windows binaries, which requires support for 64-bit windows binaries in BUILD_PREBUILT for USE_SOONG=true. module_arch_supported.mk did not support 64-bit being the secondary architecture when evaluating multilib conditionals. All other uses of HOST_*_IS_64_BIT already check the proper version. Change-Id: Iff664733e6991f4adbe8ddd620b091bbb55d1d86 --- core/module_arch_supported.mk | 17 ++++++++--------- core/prebuilt.mk | 20 ++++++++++++++++++++ core/soong.mk | 6 +++++- 3 files changed, 33 insertions(+), 10 deletions(-) diff --git a/core/module_arch_supported.mk b/core/module_arch_supported.mk index 9f05060fb..62e264331 100644 --- a/core/module_arch_supported.mk +++ b/core/module_arch_supported.mk @@ -12,7 +12,7 @@ ## LOCAL_MODULE_HOST_OS ## ## Inputs from build system: -## $(my_prefix)IS_64_BIT +## $(LOCAL_2ND_ARCH_VAR_PREFIX)$(my_prefix)IS_64_BIT ## LOCAL_2ND_ARCH_VAR_PREFIX ## ## Outputs: @@ -25,19 +25,18 @@ ifeq ($(my_module_multilib),none) my_module_arch_supported := false endif -ifeq ($(LOCAL_2ND_ARCH_VAR_PREFIX),) -ifeq ($($(my_prefix)IS_64_BIT)|$(my_module_multilib),true|32) -my_module_arch_supported := false -else ifeq ($($(my_prefix)IS_64_BIT)|$(my_module_multilib),|64) +ifeq ($($(LOCAL_2ND_ARCH_VAR_PREFIX)$(my_prefix)IS_64_BIT)|$(my_module_multilib),true|32) my_module_arch_supported := false endif -else # LOCAL_2ND_ARCH_VAR_PREFIX +ifeq ($($(LOCAL_2ND_ARCH_VAR_PREFIX)$(my_prefix)IS_64_BIT)|$(my_module_multilib),|64) +my_module_arch_supported := false +endif + +ifneq ($(LOCAL_2ND_ARCH_VAR_PREFIX),) ifeq ($(my_module_multilib),first) my_module_arch_supported := false -else ifeq ($(my_module_multilib),64) -my_module_arch_supported := false endif -endif # LOCAL_2ND_ARCH_VAR_PREFIX +endif ifneq (,$(LOCAL_MODULE_$(my_prefix)ARCH)) ifeq (,$(filter $($(my_prefix)$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH),$(LOCAL_MODULE_$(my_prefix)ARCH))) diff --git a/core/prebuilt.mk b/core/prebuilt.mk index ed25f71aa..caa990925 100644 --- a/core/prebuilt.mk +++ b/core/prebuilt.mk @@ -72,6 +72,26 @@ include $(BUILD_SYSTEM)/prebuilt_internal.mk endif LOCAL_HOST_PREFIX := endif + +ifdef HOST_CROSS_2ND_ARCH +my_prefix := HOST_CROSS_ +LOCAL_2ND_ARCH_VAR_PREFIX := $($(my_prefix)2ND_ARCH_VAR_PREFIX) +LOCAL_HOST_PREFIX := $(my_prefix) +include $(BUILD_SYSTEM)/module_arch_supported.mk +ifeq ($(my_module_arch_supported),true) +$(warning $(LOCAL_MODULE) $(LOCAL_2ND_ARCH_VAR_PREFIX)) +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)/prebuilt_internal.mk +endif +LOCAL_HOST_PREFIX := +LOCAL_2ND_ARCH_VAR_PREFIX := +endif endif endif diff --git a/core/soong.mk b/core/soong.mk index 646c68ed4..578aac933 100644 --- a/core/soong.mk +++ b/core/soong.mk @@ -45,7 +45,11 @@ $(SOONG_VARIABLES): FORCE echo ' "DeviceSecondaryAbi": ["$(TARGET_2ND_CPU_ABI)", "$(TARGET_2ND_CPU_ABI2)"],'; \ echo ''; \ echo ' "HostArch": "$(HOST_ARCH)",'; \ - echo ' "HostSecondaryArch": "$(HOST_2ND_ARCH)"'; \ + echo ' "HostSecondaryArch": "$(HOST_2ND_ARCH)",'; \ + echo ''; \ + echo ' "CrossHost": "$(HOST_CROSS_OS)",'; \ + echo ' "CrossHostArch": "$(HOST_CROSS_ARCH)",'; \ + echo ' "CrossHostSecondaryArch": "$(HOST_CROSS_2ND_ARCH)"'; \ echo '}') > $(SOONG_VARIABLES_TMP); \ if ! cmp -s $(SOONG_VARIABLES_TMP) $(SOONG_VARIABLES); then \ mv $(SOONG_VARIABLES_TMP) $(SOONG_VARIABLES); \