am 79b46720: am 02f98a26: Merge "Fix loophole in module expansion."
* commit '79b46720e606e3db5fff87f672b73613a9a19c69': Fix loophole in module expansion.
This commit is contained in:
commit
dceddd91d9
|
@ -209,7 +209,7 @@ installed_shared_library_module_names := $(sort $(installed_shared_library_modul
|
||||||
ifdef LOCAL_INSTALLED_MODULE
|
ifdef LOCAL_INSTALLED_MODULE
|
||||||
ifdef installed_shared_library_module_names
|
ifdef installed_shared_library_module_names
|
||||||
$(LOCAL_2ND_ARCH_VAR_PREFIX)$(my_prefix)DEPENDENCIES_ON_SHARED_LIBRARIES += \
|
$(LOCAL_2ND_ARCH_VAR_PREFIX)$(my_prefix)DEPENDENCIES_ON_SHARED_LIBRARIES += \
|
||||||
$(LOCAL_MODULE):$(LOCAL_INSTALLED_MODULE):$(subst $(space),$(comma),$(installed_shared_library_module_names))
|
$(my_register_name):$(LOCAL_INSTALLED_MODULE):$(subst $(space),$(comma),$(installed_shared_library_module_names))
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
|
@ -2120,20 +2120,6 @@ define set-inherited-package-variables-internal
|
||||||
,)
|
,)
|
||||||
endef
|
endef
|
||||||
|
|
||||||
###########################################################
|
|
||||||
## Expand a module name list with REQUIRED modules
|
|
||||||
###########################################################
|
|
||||||
# $(1): The variable name that holds the initial module name list.
|
|
||||||
# the variable will be modified to hold the expanded results.
|
|
||||||
# $(2): The initial module name list.
|
|
||||||
# Returns empty string (maybe with some whitespaces).
|
|
||||||
define expand-required-modules
|
|
||||||
$(eval _erm_new_modules := $(sort $(filter-out $($(1)),\
|
|
||||||
$(foreach m,$(2),$(ALL_MODULES.$(m).REQUIRED)))))\
|
|
||||||
$(if $(_erm_new_modules),$(eval $(1) += $(_erm_new_modules))\
|
|
||||||
$(call expand-required-modules,$(1),$(_erm_new_modules)))
|
|
||||||
endef
|
|
||||||
|
|
||||||
###########################################################
|
###########################################################
|
||||||
## API Check
|
## API Check
|
||||||
###########################################################
|
###########################################################
|
||||||
|
|
60
core/main.mk
60
core/main.mk
|
@ -630,37 +630,36 @@ h_m :=
|
||||||
t_r :=
|
t_r :=
|
||||||
h_r :=
|
h_r :=
|
||||||
|
|
||||||
# Resolve the dependencies on shared libraries.
|
# Establish the dependecies on the shared libraries.
|
||||||
$(foreach m,$(TARGET_DEPENDENCIES_ON_SHARED_LIBRARIES), \
|
# It also adds the shared library module names to ALL_MODULES.$(m).REQUIRED,
|
||||||
$(eval p := $(subst :,$(space),$(m))) \
|
# so they can be expanded to product_MODULES later.
|
||||||
$(eval r := $(filter $(TARGET_OUT_ROOT)/%,$(call module-installed-files,\
|
# $(1): TARGET_ or HOST_.
|
||||||
$(subst $(comma),$(space),$(lastword $(p)))))) \
|
# $(2): non-empty for 2nd arch.
|
||||||
$(eval $(call add-required-deps,$(word 2,$(p)),$(r))))
|
define resolve-shared-libs-depes
|
||||||
$(foreach m,$(HOST_DEPENDENCIES_ON_SHARED_LIBRARIES), \
|
$(foreach m,$($(if $(2),$($(1)2ND_ARCH_VAR_PREFIX))$(1)DEPENDENCIES_ON_SHARED_LIBRARIES),\
|
||||||
$(eval p := $(subst :,$(space),$(m))) \
|
$(eval p := $(subst :,$(space),$(m)))\
|
||||||
$(eval r := $(filter $(HOST_OUT_ROOT)/%,$(call module-installed-files,\
|
$(eval mod := $(firstword $(p)))\
|
||||||
$(subst $(comma),$(space),$(lastword $(p)))))) \
|
$(eval deps := $(subst $(comma),$(space),$(lastword $(p))))\
|
||||||
$(eval $(call add-required-deps,$(word 2,$(p)),$(r))))
|
$(if $(2),$(eval deps := $(addsuffix $($(1)2ND_ARCH_MODULE_SUFFIX),$(deps))))\
|
||||||
|
$(eval r := $(filter $($(1)OUT_ROOT)/%,$(call module-installed-files,\
|
||||||
|
$(deps))))\
|
||||||
|
$(eval $(call add-required-deps,$(word 2,$(p)),$(r)))\
|
||||||
|
$(eval ALL_MODULES.$(mod).REQUIRED += $(deps)))
|
||||||
|
endef
|
||||||
|
|
||||||
|
$(call resolve-shared-libs-depes,TARGET_)
|
||||||
ifdef TARGET_2ND_ARCH
|
ifdef TARGET_2ND_ARCH
|
||||||
$(foreach m,$($(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_DEPENDENCIES_ON_SHARED_LIBRARIES), \
|
$(call resolve-shared-libs-depes,TARGET_,true)
|
||||||
$(eval p := $(subst :,$(space),$(m))) \
|
|
||||||
$(eval r := $(filter $(TARGET_OUT_ROOT)/%,$(call module-installed-files,\
|
|
||||||
$(addsuffix $(TARGET_2ND_ARCH_MODULE_SUFFIX), \
|
|
||||||
$(subst $(comma),$(space),$(lastword $(p))))))) \
|
|
||||||
$(eval $(call add-required-deps,$(word 2,$(p)),$(r))))
|
|
||||||
endif
|
endif
|
||||||
|
$(call resolve-shared-libs-depes,HOST_)
|
||||||
ifdef HOST_2ND_ARCH
|
ifdef HOST_2ND_ARCH
|
||||||
$(foreach m,$($(HOST_2ND_ARCH_VAR_PREFIX)HOST_DEPENDENCIES_ON_SHARED_LIBRARIES), \
|
$(call resolve-shared-libs-depes,HOST_,true)
|
||||||
$(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
|
endif
|
||||||
|
|
||||||
m :=
|
m :=
|
||||||
r :=
|
r :=
|
||||||
p :=
|
p :=
|
||||||
|
deps :=
|
||||||
add-required-deps :=
|
add-required-deps :=
|
||||||
|
|
||||||
# -------------------------------------------------------------------
|
# -------------------------------------------------------------------
|
||||||
|
@ -669,6 +668,20 @@ add-required-deps :=
|
||||||
# Of the modules defined by the component makefiles,
|
# Of the modules defined by the component makefiles,
|
||||||
# determine what we actually want to build.
|
# determine what we actually want to build.
|
||||||
|
|
||||||
|
###########################################################
|
||||||
|
## Expand a module name list with REQUIRED modules
|
||||||
|
###########################################################
|
||||||
|
# $(1): The variable name that holds the initial module name list.
|
||||||
|
# the variable will be modified to hold the expanded results.
|
||||||
|
# $(2): The initial module name list.
|
||||||
|
# Returns empty string (maybe with some whitespaces).
|
||||||
|
define expand-required-modules
|
||||||
|
$(eval _erm_new_modules := $(sort $(filter-out $($(1)),\
|
||||||
|
$(foreach m,$(2),$(ALL_MODULES.$(m).REQUIRED)))))\
|
||||||
|
$(if $(_erm_new_modules),$(eval $(1) += $(_erm_new_modules))\
|
||||||
|
$(call expand-required-modules,$(1),$(_erm_new_modules)))
|
||||||
|
endef
|
||||||
|
|
||||||
ifdef FULL_BUILD
|
ifdef FULL_BUILD
|
||||||
# The base list of modules to build for this product is specified
|
# The base list of modules to build for this product is specified
|
||||||
# by the appropriate product definition file, which was included
|
# by the appropriate product definition file, which was included
|
||||||
|
@ -693,6 +706,7 @@ ifdef FULL_BUILD
|
||||||
endif
|
endif
|
||||||
|
|
||||||
$(call expand-required-modules,product_MODULES,$(product_MODULES))
|
$(call expand-required-modules,product_MODULES,$(product_MODULES))
|
||||||
|
|
||||||
product_FILES := $(call module-installed-files, $(product_MODULES))
|
product_FILES := $(call module-installed-files, $(product_MODULES))
|
||||||
ifeq (0,1)
|
ifeq (0,1)
|
||||||
$(info product_FILES for $(TARGET_DEVICE) ($(INTERNAL_PRODUCT)):)
|
$(info product_FILES for $(TARGET_DEVICE) ($(INTERNAL_PRODUCT)):)
|
||||||
|
|
|
@ -92,7 +92,7 @@ endif # prebuilt_module_is_a_library
|
||||||
ifdef LOCAL_INSTALLED_MODULE
|
ifdef LOCAL_INSTALLED_MODULE
|
||||||
ifdef LOCAL_SHARED_LIBRARIES
|
ifdef LOCAL_SHARED_LIBRARIES
|
||||||
$(LOCAL_2ND_ARCH_VAR_PREFIX)$(my_prefix)DEPENDENCIES_ON_SHARED_LIBRARIES += \
|
$(LOCAL_2ND_ARCH_VAR_PREFIX)$(my_prefix)DEPENDENCIES_ON_SHARED_LIBRARIES += \
|
||||||
$(LOCAL_MODULE):$(LOCAL_INSTALLED_MODULE):$(subst $(space),$(comma),$(LOCAL_SHARED_LIBRARIES))
|
$(my_register_name):$(LOCAL_INSTALLED_MODULE):$(subst $(space),$(comma),$(LOCAL_SHARED_LIBRARIES))
|
||||||
|
|
||||||
# We also need the LOCAL_BUILT_MODULE dependency,
|
# We also need the LOCAL_BUILT_MODULE dependency,
|
||||||
# since we use -rpath-link which points to the built module's path.
|
# since we use -rpath-link which points to the built module's path.
|
||||||
|
|
|
@ -39,20 +39,7 @@ _vendor_owner_whitelist := \
|
||||||
|
|
||||||
ifneq (,$(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_RESTRICT_VENDOR_FILES))
|
ifneq (,$(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_RESTRICT_VENDOR_FILES))
|
||||||
|
|
||||||
_vendor_check_modules := $(sort $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PACKAGES))
|
_vendor_check_modules := $(product_MODULES)
|
||||||
$(call expand-required-modules,_vendor_check_modules,$(_vendor_check_modules))
|
|
||||||
|
|
||||||
# Expand the target modules installed via LOCAL_SHARED_LIBRARIES
|
|
||||||
# $(1): the list of modules to expand.
|
|
||||||
define expand-required-shared-libraries
|
|
||||||
$(eval _ersl_new_modules := $(filter $(addsuffix :%,$(1)),$(TARGET_DEPENDENCIES_ON_SHARED_LIBRARIES)))\
|
|
||||||
$(eval _ersl_new_modules := $(foreach p,$(_ersl_new_modules),$(word 3,$(subst :,$(space),$(p)))))\
|
|
||||||
$(eval _ersl_new_modules := $(sort $(subst $(comma),$(space),$(_ersl_new_modules))))\
|
|
||||||
$(eval _ersl_new_modules := $(filter-out $(_vendor_check_modules),$(_ersl_new_modules)))\
|
|
||||||
$(if $(_ersl_new_modules),$(eval _vendor_check_modules += $(_ersl_new_modules))\
|
|
||||||
$(call expand-required-shared-libraries,$(_ersl_new_modules)))
|
|
||||||
endef
|
|
||||||
$(call expand-required-shared-libraries,$(_vendor_check_modules))
|
|
||||||
|
|
||||||
_vendor_module_owner_info :=
|
_vendor_module_owner_info :=
|
||||||
# Restrict owners
|
# Restrict owners
|
||||||
|
|
Loading…
Reference in New Issue