From 042dd43a1b2a5dbefca6f5e3454a9dcfb486942e Mon Sep 17 00:00:00 2001 From: Daniel Mentz Date: Thu, 16 Sep 2021 13:36:34 -0700 Subject: [PATCH] Revert "FROMLIST: kbuild: Add dtc flag test" This reverts commit 47b5470fd1be67460ff2147f0fc910ea7ac36c33. 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 (cherry picked from commit e4f264787cc9fbe1280fb4c4ad0e7e0d6a2a899b) --- scripts/Makefile.lib | 34 ++++++++++++---------------------- 1 file changed, 12 insertions(+), 22 deletions(-) diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index d519ebbf0c0a..a4f4906160b7 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -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))