Set pools manually for rules that can run in RBE or goma
Use .KATI_NINJA_POOL := none to mark rules that can run in RBE or
goma when they are enabled, which along with passing
--default_pool=local_pool will allow moving remoteable jobs into
the remote pool without relying on hacks in kati.
Fixes: 143938974
Test: inspect pools in build-${TARGET-PRODUCT}.ninja for m USE_RBE=true
Test: inspect pools in build-${TARGET-PRODUCT}.ninja for m USE_GOMA=true
Change-Id: I08615ae1f2eaef9ff0ba253b8aa3d83ab57ebb27
This commit is contained in:
@@ -64,6 +64,13 @@ my_export_c_include_dirs := $(LOCAL_EXPORT_C_INCLUDE_DIRS)
|
||||
my_export_c_include_deps := $(LOCAL_EXPORT_C_INCLUDE_DEPS)
|
||||
my_arflags :=
|
||||
|
||||
# Configure the pool to use for clang rules.
|
||||
# If LOCAL_CC or LOCAL_CXX is set don't use goma or RBE.
|
||||
my_pool :=
|
||||
ifeq (,$(strip $(my_cc))$(strip $(my_cxx)))
|
||||
my_pool := $(GOMA_OR_RBE_POOL)
|
||||
endif
|
||||
|
||||
ifneq (,$(strip $(foreach dir,$(COVERAGE_PATHS),$(filter $(dir)%,$(LOCAL_PATH)))))
|
||||
ifeq (,$(strip $(foreach dir,$(COVERAGE_EXCLUDE_PATHS),$(filter $(dir)%,$(LOCAL_PATH)))))
|
||||
my_native_coverage := true
|
||||
@@ -469,8 +476,8 @@ ifneq ($(filter true always, $(LOCAL_FDO_SUPPORT)),)
|
||||
endif
|
||||
# Disable ccache (or other compiler wrapper) except gomacc, which
|
||||
# can handle -fprofile-use properly.
|
||||
my_cc_wrapper := $(filter $(GOMA_CC),$(my_cc_wrapper))
|
||||
my_cxx_wrapper := $(filter $(GOMA_CC),$(my_cxx_wrapper))
|
||||
my_cc_wrapper := $(filter $(GOMA_CC) $(RBE_WRAPPER),$(my_cc_wrapper))
|
||||
my_cxx_wrapper := $(filter $(GOMA_CC) $(RBE_WRAPPER),$(my_cxx_wrapper))
|
||||
endif
|
||||
|
||||
###########################################################
|
||||
@@ -874,7 +881,8 @@ dotdot_objects :=
|
||||
$(foreach s,$(dotdot_sources),\
|
||||
$(eval $(call compile-dotdot-cpp-file,$(s),\
|
||||
$(my_additional_dependencies),\
|
||||
dotdot_objects)))
|
||||
dotdot_objects,\
|
||||
$(my_pool))))
|
||||
$(call track-src-file-obj,$(dotdot_sources),$(dotdot_objects))
|
||||
|
||||
cpp_normal_sources := $(filter-out ../%,$(filter %$(LOCAL_CPP_EXTENSION),$(my_src_files)))
|
||||
@@ -885,6 +893,7 @@ $(dotdot_objects) $(cpp_objects): PRIVATE_ARM_MODE := $(normal_objects_mode)
|
||||
$(dotdot_objects) $(cpp_objects): PRIVATE_ARM_CFLAGS := $(normal_objects_cflags)
|
||||
|
||||
ifneq ($(strip $(cpp_objects)),)
|
||||
$(cpp_objects): .KATI_NINJA_POOL := $(my_pool)
|
||||
$(cpp_objects): $(intermediates)/%.o: \
|
||||
$(TOPDIR)$(LOCAL_PATH)/%$(LOCAL_CPP_EXTENSION) \
|
||||
$(my_additional_dependencies) $(CLANG_CXX)
|
||||
@@ -904,6 +913,7 @@ $(call track-gen-file-obj,$(gen_cpp_sources),$(gen_cpp_objects))
|
||||
|
||||
ifneq ($(strip $(gen_cpp_objects)),)
|
||||
# Compile all generated files as thumb.
|
||||
$(gen_cpp_objects): .KATI_NINJA_POOL := $(my_pool)
|
||||
$(gen_cpp_objects): PRIVATE_ARM_MODE := $(normal_objects_mode)
|
||||
$(gen_cpp_objects): PRIVATE_ARM_CFLAGS := $(normal_objects_cflags)
|
||||
$(gen_cpp_objects): $(intermediates)/%.o: \
|
||||
@@ -922,6 +932,7 @@ gen_S_objects := $(gen_S_sources:%.S=%.o)
|
||||
$(call track-gen-file-obj,$(gen_S_sources),$(gen_S_objects))
|
||||
|
||||
ifneq ($(strip $(gen_S_sources)),)
|
||||
$(gen_S_objects): .KATI_NINJA_POOL := $(my_pool)
|
||||
$(gen_S_objects): $(intermediates)/%.o: $(intermediates)/%.S \
|
||||
$(my_additional_dependencies) $(CLANG)
|
||||
$(transform-$(PRIVATE_HOST)s-to-o)
|
||||
@@ -933,6 +944,7 @@ gen_s_objects := $(gen_s_sources:%.s=%.o)
|
||||
$(call track-gen-file-obj,$(gen_s_sources),$(gen_s_objects))
|
||||
|
||||
ifneq ($(strip $(gen_s_objects)),)
|
||||
$(gen_s_objects): .KATI_NINJA_POOL := $(my_pool)
|
||||
$(gen_s_objects): $(intermediates)/%.o: $(intermediates)/%.s \
|
||||
$(my_additional_dependencies) $(CLANG)
|
||||
$(transform-$(PRIVATE_HOST)s-to-o)
|
||||
@@ -960,7 +972,8 @@ dotdot_objects :=
|
||||
$(foreach s, $(dotdot_sources),\
|
||||
$(eval $(call compile-dotdot-c-file,$(s),\
|
||||
$(my_additional_dependencies),\
|
||||
dotdot_objects)))
|
||||
dotdot_objects,\
|
||||
$(my_pool))))
|
||||
$(call track-src-file-obj,$(dotdot_sources),$(dotdot_objects))
|
||||
|
||||
c_normal_sources := $(filter-out ../%,$(filter %.c,$(my_src_files)))
|
||||
@@ -971,6 +984,7 @@ $(dotdot_objects) $(c_objects): PRIVATE_ARM_MODE := $(normal_objects_mode)
|
||||
$(dotdot_objects) $(c_objects): PRIVATE_ARM_CFLAGS := $(normal_objects_cflags)
|
||||
|
||||
ifneq ($(strip $(c_objects)),)
|
||||
$(c_objects): .KATI_NINJA_POOL := $(my_pool)
|
||||
$(c_objects): $(intermediates)/%.o: $(TOPDIR)$(LOCAL_PATH)/%.c \
|
||||
$(my_additional_dependencies) $(CLANG)
|
||||
$(transform-$(PRIVATE_HOST)c-to-o)
|
||||
@@ -989,6 +1003,7 @@ $(call track-gen-file-obj,$(gen_c_sources),$(gen_c_objects))
|
||||
|
||||
ifneq ($(strip $(gen_c_objects)),)
|
||||
# Compile all generated files as thumb.
|
||||
$(gen_c_objects): .KATI_NINJA_POOL := $(my_pool)
|
||||
$(gen_c_objects): PRIVATE_ARM_MODE := $(normal_objects_mode)
|
||||
$(gen_c_objects): PRIVATE_ARM_CFLAGS := $(normal_objects_cflags)
|
||||
$(gen_c_objects): $(intermediates)/%.o: $(intermediates)/%.c \
|
||||
@@ -1007,6 +1022,7 @@ $(call track-src-file-obj,$(objc_sources),$(objc_objects))
|
||||
|
||||
ifneq ($(strip $(objc_objects)),)
|
||||
my_soong_problems += objc
|
||||
$(objc_objects): .KATI_NINJA_POOL := $(my_pool)
|
||||
$(objc_objects): $(intermediates)/%.o: $(TOPDIR)$(LOCAL_PATH)/%.m \
|
||||
$(my_additional_dependencies) $(CLANG)
|
||||
$(transform-$(PRIVATE_HOST)m-to-o)
|
||||
@@ -1022,6 +1038,7 @@ objcpp_objects := $(addprefix $(intermediates)/,$(objcpp_sources:.mm=.o))
|
||||
$(call track-src-file-obj,$(objcpp_sources),$(objcpp_objects))
|
||||
|
||||
ifneq ($(strip $(objcpp_objects)),)
|
||||
$(objcpp_objects): .KATI_NINJA_POOL := $(my_pool)
|
||||
$(objcpp_objects): $(intermediates)/%.o: $(TOPDIR)$(LOCAL_PATH)/%.mm \
|
||||
$(my_additional_dependencies) $(CLANG_CXX)
|
||||
$(transform-$(PRIVATE_HOST)mm-to-o)
|
||||
@@ -1042,10 +1059,12 @@ dotdot_objects_S :=
|
||||
$(foreach s,$(dotdot_sources),\
|
||||
$(eval $(call compile-dotdot-s-file,$(s),\
|
||||
$(my_additional_dependencies),\
|
||||
dotdot_objects_S)))
|
||||
dotdot_objects_S,\
|
||||
$(my_pool))))
|
||||
$(call track-src-file-obj,$(dotdot_sources),$(dotdot_objects_S))
|
||||
|
||||
ifneq ($(strip $(asm_objects_S)),)
|
||||
$(asm_objects_S): .KATI_NINJA_POOL := $(my_pool)
|
||||
$(asm_objects_S): $(intermediates)/%.o: $(TOPDIR)$(LOCAL_PATH)/%.S \
|
||||
$(my_additional_dependencies) $(CLANG)
|
||||
$(transform-$(PRIVATE_HOST)s-to-o)
|
||||
@@ -1062,10 +1081,12 @@ dotdot_objects_s :=
|
||||
$(foreach s,$(dotdot_sources),\
|
||||
$(eval $(call compile-dotdot-s-file-no-deps,$(s),\
|
||||
$(my_additional_dependencies),\
|
||||
dotdot_objects_s)))
|
||||
dotdot_objects_s,\
|
||||
$(my_pool))))
|
||||
$(call track-src-file-obj,$(dotdot_sources),$(dotdot_objects_s))
|
||||
|
||||
ifneq ($(strip $(asm_objects_s)),)
|
||||
$(asm_objects_s): .KATI_NINJA_POOL := $(my_pool)
|
||||
$(asm_objects_s): $(intermediates)/%.o: $(TOPDIR)$(LOCAL_PATH)/%.s \
|
||||
$(my_additional_dependencies) $(CLANG)
|
||||
$(transform-$(PRIVATE_HOST)s-to-o)
|
||||
|
||||
Reference in New Issue
Block a user