Revert "FROMLIST: kbuild: Add dtc flag test"

This reverts commit 47b5470fd1.

The variable DTC_FLAGS is a recursively expanded makefile variable which
means that it is re-expanded every time it is referenced. In other
words, a try-run is performed every time this variable is referenced
which is wasteful because the result will always be the same.  In
addition, if dtc is invoked with $(call if_changed_dep,dtc,dtb),
DTC_FLAGS is apparently expanded three times. As a result, we observe 3
try-runs per dtc-option of which there are 8. This means that every
compilation of a device tree file is preceded by 24 try-runs! Every
invocation of dtc turns into 25 invocations!  Additionally, it appears
as if Make prohibits parallelization if a recipe contains a reference to
the $(shell ....) function.

Bug: 198176779
Change-Id: Iae1a1d2266563727f1a7b67660c7b8fa7e1c7247
Signed-off-by: Daniel Mentz <danielmentz@google.com>
(cherry picked from commit e4f264787c)
This commit is contained in:
Daniel Mentz
2021-09-16 13:36:34 -07:00
parent 3fe1cb62e4
commit 042dd43a1b

View File

@@ -304,35 +304,25 @@ quiet_cmd_gzip = GZIP $@
# DTC
# ---------------------------------------------------------------------------
ifeq ("$(origin DTC)", "command line")
PHONY += $(DTC)
dtc-option = $(call try-run, $(DTC) $1 -v,$1)
else
# Just add the flag. DTC is compiled later as a prerequisite, so there's no dtc
# to test the flag against. This is okay because we're not testing flags which
# aren't supported by in-kernel dtc to begin with.
dtc-option = $1
endif
DTC ?= $(objtree)/scripts/dtc/dtc
DTC_FLAGS += $(call dtc-option,-Wno-interrupt_provider)
DTC_FLAGS += -Wno-interrupt_provider
# Disable noisy checks by default
ifeq ($(findstring 1,$(KBUILD_EXTRA_WARN)),)
DTC_FLAGS += $(call dtc-option,-Wno-unit_address_vs_reg) \
$(call dtc-option,-Wno-unit_address_format) \
$(call dtc-option,-Wno-avoid_unnecessary_addr_size) \
$(call dtc-option,-Wno-alias_paths) \
$(call dtc-option,-Wno-graph_child_address) \
$(call dtc-option,-Wno-simple_bus_reg) \
$(call dtc-option,-Wno-unique_unit_address) \
$(call dtc-option,-Wno-pci_device_reg)
DTC_FLAGS += -Wno-unit_address_vs_reg \
-Wno-unit_address_format \
-Wno-avoid_unnecessary_addr_size \
-Wno-alias_paths \
-Wno-graph_child_address \
-Wno-simple_bus_reg \
-Wno-unique_unit_address \
-Wno-pci_device_reg
endif
ifneq ($(findstring 2,$(KBUILD_EXTRA_WARN)),)
DTC_FLAGS += $(call dtc-option,-Wnode_name_chars_strict) \
$(call dtc-option,-Wproperty_name_chars_strict) \
$(call dtc-option,-Winterrupt_provider)
DTC_FLAGS += -Wnode_name_chars_strict \
-Wproperty_name_chars_strict \
-Winterrupt_provider
endif
DTC_FLAGS += $(DTC_FLAGS_$(basetarget))