Merge "Enable toc optimization for host builds" am: 5d8c73e373
am: 4276c12d20
Change-Id: I5bd72f5d2f8e689152d7f496b39afcacf5850371
This commit is contained in:
@@ -269,9 +269,6 @@ LOCAL_INTERMEDIATE_TARGETS += $(LOCAL_BUILT_MODULE)
|
|||||||
# dependent binaries of a .toc file will be rebuilt only when the content of
|
# dependent binaries of a .toc file will be rebuilt only when the content of
|
||||||
# the .toc file is changed.
|
# the .toc file is changed.
|
||||||
###########################################################
|
###########################################################
|
||||||
ifndef LOCAL_IS_HOST_MODULE
|
|
||||||
# Disable .toc optimization for host modules: we may run the host binaries during the build process
|
|
||||||
# and the libraries' implementation matters.
|
|
||||||
ifeq ($(LOCAL_MODULE_CLASS),SHARED_LIBRARIES)
|
ifeq ($(LOCAL_MODULE_CLASS),SHARED_LIBRARIES)
|
||||||
LOCAL_INTERMEDIATE_TARGETS += $(LOCAL_BUILT_MODULE).toc
|
LOCAL_INTERMEDIATE_TARGETS += $(LOCAL_BUILT_MODULE).toc
|
||||||
$(LOCAL_BUILT_MODULE).toc: $(LOCAL_BUILT_MODULE)
|
$(LOCAL_BUILT_MODULE).toc: $(LOCAL_BUILT_MODULE)
|
||||||
@@ -283,7 +280,6 @@ $(LOCAL_BUILT_MODULE).toc: $(LOCAL_BUILT_MODULE)
|
|||||||
# Build .toc file when using mm, mma, or make $(my_register_name)
|
# Build .toc file when using mm, mma, or make $(my_register_name)
|
||||||
$(my_all_targets): $(LOCAL_BUILT_MODULE).toc
|
$(my_all_targets): $(LOCAL_BUILT_MODULE).toc
|
||||||
endif
|
endif
|
||||||
endif
|
|
||||||
|
|
||||||
###########################################################
|
###########################################################
|
||||||
## logtags: Add .logtags files to global list
|
## logtags: Add .logtags files to global list
|
||||||
|
@@ -1507,13 +1507,7 @@ built_shared_libraries := \
|
|||||||
$(addprefix $($(LOCAL_2ND_ARCH_VAR_PREFIX)$(my_prefix)OUT_INTERMEDIATE_LIBRARIES)/, \
|
$(addprefix $($(LOCAL_2ND_ARCH_VAR_PREFIX)$(my_prefix)OUT_INTERMEDIATE_LIBRARIES)/, \
|
||||||
$(addsuffix $(so_suffix), \
|
$(addsuffix $(so_suffix), \
|
||||||
$(installed_shared_library_module_names)))
|
$(installed_shared_library_module_names)))
|
||||||
ifdef LOCAL_IS_HOST_MODULE
|
|
||||||
# Disable .toc optimization for host modules: we may run the host binaries during the build process
|
|
||||||
# and the libraries' implementation matters.
|
|
||||||
built_shared_library_deps := $(built_shared_libraries)
|
|
||||||
else
|
|
||||||
built_shared_library_deps := $(addsuffix .toc, $(built_shared_libraries))
|
built_shared_library_deps := $(addsuffix .toc, $(built_shared_libraries))
|
||||||
endif
|
|
||||||
my_system_shared_libraries_fullpath :=
|
my_system_shared_libraries_fullpath :=
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
12
core/main.mk
12
core/main.mk
@@ -660,6 +660,14 @@ define add-required-deps
|
|||||||
$(1): | $(2)
|
$(1): | $(2)
|
||||||
endef
|
endef
|
||||||
|
|
||||||
|
# Use a normal dependency instead of an order-only dependency when installing
|
||||||
|
# host dynamic binaries so that the timestamp of the final binary always
|
||||||
|
# changes, even if the toc optimization has skipped relinking the binary
|
||||||
|
# and its dependant shared libraries.
|
||||||
|
define add-required-host-so-deps
|
||||||
|
$(1): $(2)
|
||||||
|
endef
|
||||||
|
|
||||||
$(foreach m,$(ALL_MODULES), \
|
$(foreach m,$(ALL_MODULES), \
|
||||||
$(eval r := $(ALL_MODULES.$(m).REQUIRED)) \
|
$(eval r := $(ALL_MODULES.$(m).REQUIRED)) \
|
||||||
$(if $(r), \
|
$(if $(r), \
|
||||||
@@ -702,7 +710,9 @@ $(foreach m,$($(if $(2),$($(1)2ND_ARCH_VAR_PREFIX))$(1)DEPENDENCIES_ON_SHARED_LI
|
|||||||
$(if $(3),$(eval deps := $(addprefix host_cross_,$(deps))))\
|
$(if $(3),$(eval deps := $(addprefix host_cross_,$(deps))))\
|
||||||
$(eval r := $(filter $($(root))/%,$(call module-installed-files,\
|
$(eval r := $(filter $($(root))/%,$(call module-installed-files,\
|
||||||
$(deps))))\
|
$(deps))))\
|
||||||
$(eval $(call add-required-deps,$(word 2,$(p)),$(r)))\
|
$(if $(filter $(1),HOST_),\
|
||||||
|
$(eval $(call add-required-host-so-deps,$(word 2,$(p)),$(r))),\
|
||||||
|
$(eval $(call add-required-deps,$(word 2,$(p)),$(r))))\
|
||||||
$(eval ALL_MODULES.$(mod).REQUIRED += $(deps)))
|
$(eval ALL_MODULES.$(mod).REQUIRED += $(deps)))
|
||||||
endef
|
endef
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user