Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit 47b5470

Browse files
eberman-quicSteve Muckle
authored andcommitted
FROMLIST: kbuild: Add dtc flag test
Host dtc may not support the same flags as kernel's copy of dtc. Test if dtc supports each flag when the dtc comes from host. Bug: 162811113 Link: https://lore.kernel.org/linux-devicetree/[email protected]/ Change-Id: Iab4e95c7100817c8b4ad40dcaafa6e6c29a85163 Signed-off-by: Elliot Berman <[email protected]>
1 parent 3f49381 commit 47b5470

File tree

1 file changed

+22
-12
lines changed

1 file changed

+22
-12
lines changed

scripts/Makefile.lib

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -274,25 +274,35 @@ quiet_cmd_gzip = GZIP $@
274274

275275
# DTC
276276
# ---------------------------------------------------------------------------
277+
ifeq ("$(origin DTC)", "command line")
278+
PHONY += $(DTC)
279+
dtc-option = $(call try-run, $(DTC) $1 -v,$1)
280+
else
281+
# Just add the flag. DTC is compiled later as a prerequisite, so there's no dtc
282+
# to test the flag against. This is okay because we're not testing flags which
283+
# aren't supported by in-kernel dtc to begin with.
284+
dtc-option = $1
285+
endif
286+
277287
DTC ?= $(objtree)/scripts/dtc/dtc
278-
DTC_FLAGS += -Wno-interrupt_provider
288+
DTC_FLAGS += $(call dtc-option,-Wno-interrupt_provider)
279289

280290
# Disable noisy checks by default
281291
ifeq ($(findstring 1,$(KBUILD_EXTRA_WARN)),)
282-
DTC_FLAGS += -Wno-unit_address_vs_reg \
283-
-Wno-unit_address_format \
284-
-Wno-avoid_unnecessary_addr_size \
285-
-Wno-alias_paths \
286-
-Wno-graph_child_address \
287-
-Wno-simple_bus_reg \
288-
-Wno-unique_unit_address \
289-
-Wno-pci_device_reg
292+
DTC_FLAGS += $(call dtc-option,-Wno-unit_address_vs_reg) \
293+
$(call dtc-option,-Wno-unit_address_format) \
294+
$(call dtc-option,-Wno-avoid_unnecessary_addr_size) \
295+
$(call dtc-option,-Wno-alias_paths) \
296+
$(call dtc-option,-Wno-graph_child_address) \
297+
$(call dtc-option,-Wno-simple_bus_reg) \
298+
$(call dtc-option,-Wno-unique_unit_address) \
299+
$(call dtc-option,-Wno-pci_device_reg)
290300
endif
291301

292302
ifneq ($(findstring 2,$(KBUILD_EXTRA_WARN)),)
293-
DTC_FLAGS += -Wnode_name_chars_strict \
294-
-Wproperty_name_chars_strict \
295-
-Winterrupt_provider
303+
DTC_FLAGS += $(call dtc-option,-Wnode_name_chars_strict) \
304+
$(call dtc-option,-Wproperty_name_chars_strict) \
305+
$(call dtc-option,-Winterrupt_provider)
296306
endif
297307

298308
DTC_FLAGS += $(DTC_FLAGS_$(basetarget))

0 commit comments

Comments
 (0)