diff --git a/core/64_bit_blacklist.mk b/core/64_bit_blacklist.mk new file mode 100644 index 000000000..71a5cf312 --- /dev/null +++ b/core/64_bit_blacklist.mk @@ -0,0 +1,53 @@ +ifneq ($(TARGET_2ND_ARCH),) + +# JNI - needs 64-bit VM +_64_bit_directory_blacklist += \ + external/conscrypt \ + external/neven \ + external/svox \ + libcore \ + packages \ + +# Chromium/V8: needs 64-bit support +_64_bit_directory_blacklist += \ + external/chromium \ + external/chromium-libpac \ + external/chromium_org \ + external/skia \ + external/v8 \ + frameworks/webview \ + +# misc build errors +_64_bit_directory_blacklist += \ + external/bluetooth/bluedroid \ + external/oprofile/opcontrol \ + external/tcpdump \ + frameworks/av \ + frameworks/base \ + frameworks/ex \ + frameworks/ml \ + frameworks/opt \ + frameworks/wilhelm \ + device/generic/goldfish/opengl \ + device/generic/goldfish/camera \ + +# depends on libnl_2 +_64_bit_directory_blacklist += \ + external/android-clat \ + external/wpa_suplicant_8 + +# depends on frameworks/av +_64_bit_directory_blacklist += \ + external/srec \ + hardware/libhardware_legacy/audio \ + hardware/libhardware/modules/audio_remote_submix \ + +_64_bit_directory_blacklist_pattern := $(addsuffix %,$(_64_bit_directory_blacklist)) + +define directory_is_64_bit_blacklisted +$(if $(filter $(_64_bit_directory_blacklist_pattern),$(1)),true) +endef +else +define directory_is_64_bit_blacklisted +endef +endif diff --git a/core/Makefile b/core/Makefile index 2bcf0cf97..d76aca6d8 100644 --- a/core/Makefile +++ b/core/Makefile @@ -644,6 +644,10 @@ ifeq (,$(filter true, $(TARGET_NO_KERNEL) $(TARGET_NO_RECOVERY))) INSTALLED_RECOVERYIMAGE_TARGET := $(PRODUCT_OUT)/recovery.img +# HACK: clear LOCAL_PATH from including last build target before calling +# intermedites-dir-for +LOCAL_PATH := $(call my-dir) + recovery_initrc := $(call include-path-for, recovery)/etc/init.rc recovery_kernel := $(INSTALLED_KERNEL_TARGET) # same as a non-recovery system recovery_ramdisk := $(PRODUCT_OUT)/ramdisk-recovery.img diff --git a/core/definitions.mk b/core/definitions.mk index e0e960841..cb324dda9 100644 --- a/core/definitions.mk +++ b/core/definitions.mk @@ -450,11 +450,13 @@ $(strip \ $(if $(_idfName),, \ $(error $(LOCAL_PATH): Name not defined in call to intermediates-dir-for)) \ $(eval _idfPrefix := $(if $(strip $(3)),HOST,TARGET)) \ - $(eval _idf2ndArchPrefix := $(if $(strip $(5)),$(TARGET_2ND_ARCH_VAR_PREFIX))) \ + $(eval _idf2ndArchPrefix := $(if $(call directory_is_64_bit_blacklisted,$(LOCAL_PATH))$(strip $(5)),$(TARGET_2ND_ARCH_VAR_PREFIX))) \ $(if $(filter $(_idfPrefix)-$(_idfClass),$(COMMON_MODULE_CLASSES))$(4), \ $(eval _idfIntBase := $($(_idfPrefix)_OUT_COMMON_INTERMEDIATES)) \ - , \ - $(eval _idfIntBase := $($(_idf2ndArchPrefix)$(_idfPrefix)_OUT_INTERMEDIATES)) \ + ,$(if $(filter $(_idfPrefix)-$(_idfClass),TARGET-SHARED_LIBRARIES TARGET-STATIC_LIBRARIES TARGET-EXECUTABLES),\ + $(eval _idfIntBase := $($(_idf2ndArchPrefix)$(_idfPrefix)_OUT_INTERMEDIATES)) \ + ,$(eval _idfIntBase := $($(_idfPrefix)_OUT_INTERMEDIATES)) \ + ) \ ) \ $(_idfIntBase)/$(_idfClass)/$(_idfName)_intermediates \ ) diff --git a/core/main.mk b/core/main.mk index 871f51b40..ee22a9173 100644 --- a/core/main.mk +++ b/core/main.mk @@ -92,6 +92,8 @@ include $(BUILD_SYSTEM)/help.mk # and host information. include $(BUILD_SYSTEM)/config.mk +include $(BUILD_SYSTEM)/64_bit_blacklist.mk + # This allows us to force a clean build - included after the config.mk # environment setup is done, but before we generate any dependencies. This # file does the rm -rf inline so the deps which are all done below will diff --git a/core/module_arch_supported.mk b/core/module_arch_supported.mk index 49cf8ddde..ddfd67dfd 100644 --- a/core/module_arch_supported.mk +++ b/core/module_arch_supported.mk @@ -22,6 +22,8 @@ my_module_arch_supported := true ifeq ($(LOCAL_2ND_ARCH_VAR_PREFIX),) ifeq ($(TARGET_IS_64_BIT)|$(LOCAL_32_BIT_ONLY),true|true) my_module_arch_supported := false +else ifeq ($(call directory_is_64_bit_blacklisted,$(LOCAL_PATH)),true) +my_module_arch_supported := false endif else # LOCAL_2ND_ARCH_VAR_PREFIX ifeq ($(LOCAL_NO_2ND_ARCH),true) diff --git a/core/tasks/vendor_module_check.mk b/core/tasks/vendor_module_check.mk index c51a40c28..96557e38e 100644 --- a/core/tasks/vendor_module_check.mk +++ b/core/tasks/vendor_module_check.mk @@ -71,11 +71,12 @@ _vendor_check_copy_files := $(foreach m, $(_vendor_check_modules), \ $(if $(filter vendor/%, $(ALL_MODULES.$(m).PATH)),\ - $(if $(filter $(_vendor_owner_whitelist), $(ALL_MODULES.$(m).OWNER)),,\ - $(error Error: vendor module "$(m)" in $(ALL_MODULES.$(m).PATH) with unknown owner \ - "$(ALL_MODULES.$(m).OWNER)" in product "$(TARGET_PRODUCT)"))\ - $(if $(ALL_MODULES.$(m).INSTALLED),\ - $(eval _vendor_module_owner_info += $(patsubst $(PRODUCT_OUT)/%,%,$(ALL_MODULES.$(m).INSTALLED)):$(ALL_MODULES.$(m).OWNER))))) + $(if $(filter-out FAKE, $(ALL_MODULES.$(m).CLASS)),\ + $(if $(filter $(_vendor_owner_whitelist), $(ALL_MODULES.$(m).OWNER)),,\ + $(error Error: vendor module "$(m)" in $(ALL_MODULES.$(m).PATH) with unknown owner \ + "$(ALL_MODULES.$(m).OWNER)" in product "$(TARGET_PRODUCT)"))\ + $(if $(ALL_MODULES.$(m).INSTALLED),\ + $(eval _vendor_module_owner_info += $(patsubst $(PRODUCT_OUT)/%,%,$(ALL_MODULES.$(m).INSTALLED)):$(ALL_MODULES.$(m).OWNER)))))) endif