Skip to contentSkip to conversation

kbuild: Cleanup DT Overlay intermediate files as appropriate

PATCH Applied Andrew Davis 4 participants 4 messages Nov 14, 2022 – Nov 18, 2022 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kbuild: Cleanup DT Overlay intermediate files as appropriate

%.dtbo.o and %.dtbo.S files are used to build-in DT Overlay. They should should not be removed by Make or the kernel will be needlessly rebuilt.

These should be removed by "clean" and ignored by git like other intermediate files.

---
 .gitignore             | 1 +
 Makefile               | 4 +++-
 scripts/Makefile.build | 2 ++
 3 files changed, 6 insertions(+), 1 deletion(-)
.gitignore +1 -0
index 5da004814678d..3ec73ead6757e 100644
@@ -20,6 +20,7 @@
 *.dtb
 *.dtbo
 *.dtb.S
+*.dtbo.S
 *.dwo
 *.elf
 *.gcno
Makefile +3 -1
index 3735d5996c637..0dd7e8d022289 100644
@@ -2003,7 +2003,9 @@ clean: $(clean-dirs)
 	@find $(or $(KBUILD_EXTMOD), .) $(RCS_FIND_IGNORE) \
 		\( -name '*.[aios]' -o -name '*.rsi' -o -name '*.ko' -o -name '.*.cmd' \
 		-o -name '*.ko.*' \
-		-o -name '*.dtb' -o -name '*.dtbo' -o -name '*.dtb.S' -o -name '*.dt.yaml' \
+		-o -name '*.dtb' -o -name '*.dtbo' \
+		-o -name '*.dtb.S' -o -name '*.dtbo.S' \
+		-o -name '*.dt.yaml' \
 		-o -name '*.dwo' -o -name '*.lst' \
 		-o -name '*.su' -o -name '*.mod' -o -name '*.usyms' \
 		-o -name '.*.d' -o -name '.*.tmp' -o -name '*.mod.c' \
scripts/Makefile.build +2 -0
index 41f3602fc8de7..3ceab076127b7 100644
@@ -468,10 +468,12 @@ intermediate_targets = $(foreach sfx, $(2), \
 					$(filter %$(strip $(1)), $(targets))))
 # %.asn1.o <- %.asn1.[ch] <- %.asn1
 # %.dtb.o <- %.dtb.S <- %.dtb <- %.dts
+# %.dtbo.o <- %.dtbo.S <- %.dtbo <- %.dtso
 # %.lex.o <- %.lex.c <- %.l
 # %.tab.o <- %.tab.[ch] <- %.y
 targets += $(call intermediate_targets, .asn1.o, .asn1.c .asn1.h) \
 	   $(call intermediate_targets, .dtb.o, .dtb.S .dtb) \
+	   $(call intermediate_targets, .dtbo.o, .dtbo.S .dtbo) \
 	   $(call intermediate_targets, .lex.o, .lex.c) \
 	   $(call intermediate_targets, .tab.o, .tab.c .tab.h)
 
Signature · 1 line
2.38.1
Tested-by on v1 1/1
#1 lore raw
Quoted 5 lines · Andrew Davis

%.dtbo.o and %.dtbo.S files are used to build-in DT Overlay. They should should not be removed by Make or the kernel will be needlessly rebuilt.

These should be removed by "clean" and ignored by git like other intermediate files.

Fixes 941214a512d8 ("kbuild: Allow DTB overlays to built into .dtbo.S files")
Quoted 55 lines
---
 .gitignore             | 1 +
 Makefile               | 4 +++-
 scripts/Makefile.build | 2 ++
 3 files changed, 6 insertions(+), 1 deletion(-)
.gitignore +1 -0
index 5da004814678d..3ec73ead6757e 100644
@@ -20,6 +20,7 @@
 *.dtb
 *.dtbo
 *.dtb.S
+*.dtbo.S
 *.dwo
 *.elf
 *.gcno
Makefile +3 -1
index 3735d5996c637..0dd7e8d022289 100644
@@ -2003,7 +2003,9 @@ clean: $(clean-dirs)
 	@find $(or $(KBUILD_EXTMOD), .) $(RCS_FIND_IGNORE) \
 		\( -name '*.[aios]' -o -name '*.rsi' -o -name '*.ko' -o -name '.*.cmd' \
 		-o -name '*.ko.*' \
-		-o -name '*.dtb' -o -name '*.dtbo' -o -name '*.dtb.S' -o -name '*.dt.yaml' \
+		-o -name '*.dtb' -o -name '*.dtbo' \
+		-o -name '*.dtb.S' -o -name '*.dtbo.S' \
+		-o -name '*.dt.yaml' \
 		-o -name '*.dwo' -o -name '*.lst' \
 		-o -name '*.su' -o -name '*.mod' -o -name '*.usyms' \
 		-o -name '.*.d' -o -name '.*.tmp' -o -name '*.mod.c' \
scripts/Makefile.build +2 -0
index 41f3602fc8de7..3ceab076127b7 100644
@@ -468,10 +468,12 @@ intermediate_targets = $(foreach sfx, $(2), \
 					$(filter %$(strip $(1)), $(targets))))
 # %.asn1.o <- %.asn1.[ch] <- %.asn1
 # %.dtb.o <- %.dtb.S <- %.dtb <- %.dts
+# %.dtbo.o <- %.dtbo.S <- %.dtbo <- %.dtso
 # %.lex.o <- %.lex.c <- %.l
 # %.tab.o <- %.tab.[ch] <- %.y
 targets += $(call intermediate_targets, .asn1.o, .asn1.c .asn1.h) \
 	   $(call intermediate_targets, .dtb.o, .dtb.S .dtb) \
+	   $(call intermediate_targets, .dtbo.o, .dtbo.S .dtbo) \
 	   $(call intermediate_targets, .lex.o, .lex.c) \
 	   $(call intermediate_targets, .tab.o, .tab.c .tab.h)
 
Signature · 1 line
2.38.1
Signature · 2 lines
With Best Regards,
Andy Shevchenko
#2 lore raw
Quoted 5 lines · Andy Shevchenko
Quoted 3 lines · Andrew Davis

%.dtbo.o and %.dtbo.S files are used to build-in DT Overlay. They should should not be removed by Make or the kernel will be needlessly rebuilt.

Quoted 9 lines
Quoted 2 lines

These should be removed by "clean" and ignored by git like other intermediate files.

Fixes 941214a512d8 ("kbuild: Allow DTB overlays to built into .dtbo.S files")
Quoted 2 lines
Signature · 7 lines
Best Regards
Masahiro Yamada

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Applied
#3 lore raw
In reply to Andrew Davis
Quoted 6 lines · Andrew Davis

%.dtbo.o and %.dtbo.S files are used to build-in DT Overlay. They should should not be removed by Make or the kernel will be needlessly rebuilt.

These should be removed by "clean" and ignored by git like other intermediate files.

Quoted 7 lines
---
 .gitignore             | 1 +
 Makefile               | 4 +++-
 scripts/Makefile.build | 2 ++
 3 files changed, 6 insertions(+), 1 deletion(-)

Applied, thanks!