All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] kbuild: fix compilation of dtb specified on command-line without make rule
@ 2025-11-20 14:06 Thomas De Schampheleire
  2025-11-21  6:42 ` Nathan Chancellor
  2025-11-24 13:07 ` Rob Herring
  0 siblings, 2 replies; 8+ messages in thread
From: Thomas De Schampheleire @ 2025-11-20 14:06 UTC (permalink / raw)
  To: linux-kbuild
  Cc: Thomas De Schampheleire, Masahiro Yamada, Nathan Chancellor,
	Nicolas Schier, linux-kernel

Since commit e7e2941300d2 ("kbuild: split device tree build rules into
scripts/Makefile.dtbs"), it is no longer possible to compile a device tree
blob that is not specified in a make rule
like:
    dtb-$(CONFIG_FOO) += foo.dtb

Before the mentioned commit, one could copy a dts file to e.g.
arch/arm64/boot/dts/ (or a new subdirectory) and then convert it to a dtb
file using:
    make ARCH=arm64 foo.dtb

In this scenario, both 'dtb-y' and 'dtb-' are empty, and the inclusion of
scripts/Makefile.dtbs relies on 'targets' to contain the MAKECMDGOALS. The
value of 'targets', however, is only final later in the code.

Move the conditional include of scripts/Makefile.dtbs down to where the
value of 'targets' is final.

Fixes: e7e2941300d2 ("kbuild: split device tree build rules into scripts/Makefile.dtbs")
Signed-off-by: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
---
 scripts/Makefile.build | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index d0ee33a487be..6e0f9e922c68 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -527,10 +527,6 @@ ifneq ($(userprogs),)
 include $(srctree)/scripts/Makefile.userprogs
 endif
 
-ifneq ($(need-dtbslist)$(dtb-y)$(dtb-)$(filter %.dtb %.dtb.o %.dtbo.o,$(targets)),)
-include $(srctree)/scripts/Makefile.dtbs
-endif
-
 # Build
 # ---------------------------------------------------------------------------
 
@@ -568,6 +564,11 @@ FORCE:
 targets += $(filter-out $(single-subdir-goals), $(MAKECMDGOALS))
 targets := $(filter-out $(PHONY), $(targets))
 
+# Now that targets is fully known, include dtb rules if needed
+ifneq ($(need-dtbslist)$(dtb-y)$(dtb-)$(filter %.dtb %.dtb.o %.dtbo.o,$(targets)),)
+include $(srctree)/scripts/Makefile.dtbs
+endif
+
 # Read all saved command lines and dependencies for the $(targets) we
 # may be building above, using $(if_changed{,_dep}). As an
 # optimization, we don't need to read them if the target does not

base-commit: deab487e0f9b39ae4603e22d7d00908ebfc9753c
-- 
2.51.0


^ permalink raw reply related	[flat|nested] 8+ messages in thread
* Re: [PATCH] kbuild: fix compilation of dtb specified on command-line without make rule
@ 2025-11-20 15:18 kernel test robot
  0 siblings, 0 replies; 8+ messages in thread
From: kernel test robot @ 2025-11-20 15:18 UTC (permalink / raw)
  To: oe-kbuild; +Cc: lkp

:::::: 
:::::: Manual check reason: "only suspicious fbc files changed"
:::::: 

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
In-Reply-To: <20251120140645.478623-1-thomas.de_schampheleire@nokia.com>
References: <20251120140645.478623-1-thomas.de_schampheleire@nokia.com>
TO: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
TO: linux-kbuild@vger.kernel.org
CC: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
CC: Masahiro Yamada <masahiroy@kernel.org>
CC: Nathan Chancellor <nathan@kernel.org>
CC: Nicolas Schier <nsc@kernel.org>
CC: linux-kernel@vger.kernel.org

Hi Thomas,

kernel test robot noticed the following build errors:

[auto build test ERROR on deab487e0f9b39ae4603e22d7d00908ebfc9753c]

url:    https://github.com/intel-lab-lkp/linux/commits/Thomas-De-Schampheleire/kbuild-fix-compilation-of-dtb-specified-on-command-line-without-make-rule/20251120-220837
base:   deab487e0f9b39ae4603e22d7d00908ebfc9753c
patch link:    https://lore.kernel.org/r/20251120140645.478623-1-thomas.de_schampheleire%40nokia.com
patch subject: [PATCH] kbuild: fix compilation of dtb specified on command-line without make rule
:::::: branch date: 69 minutes ago
:::::: commit date: 69 minutes ago
config: mips-allnoconfig (https://download.01.org/0day-ci/archive/20251120/202511202354.csdBo9k9-lkp@intel.com/config)
compiler: mips-linux-gcc (GCC) 15.1.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251120/202511202354.csdBo9k9-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/r/202511202354.csdBo9k9-lkp@intel.com/

All errors (new ones prefixed by >>):

>> make[3]: *** No rule to make target 'arch/mips/boot/dts/dtbs-list', needed by '.builtin-dtbs-list'.
   make[3]: Target '__default' not remade because of errors.

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 8+ messages in thread
* Re: [PATCH] kbuild: fix compilation of dtb specified on command-line without make rule
@ 2025-11-20 15:29 kernel test robot
  0 siblings, 0 replies; 8+ messages in thread
From: kernel test robot @ 2025-11-20 15:29 UTC (permalink / raw)
  To: oe-kbuild; +Cc: lkp

:::::: 
:::::: Manual check reason: "only suspicious fbc files changed"
:::::: 

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
In-Reply-To: <20251120140645.478623-1-thomas.de_schampheleire@nokia.com>
References: <20251120140645.478623-1-thomas.de_schampheleire@nokia.com>
TO: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
TO: linux-kbuild@vger.kernel.org
CC: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
CC: Masahiro Yamada <masahiroy@kernel.org>
CC: Nathan Chancellor <nathan@kernel.org>
CC: Nicolas Schier <nsc@kernel.org>
CC: linux-kernel@vger.kernel.org

Hi Thomas,

kernel test robot noticed the following build errors:

[auto build test ERROR on deab487e0f9b39ae4603e22d7d00908ebfc9753c]

url:    https://github.com/intel-lab-lkp/linux/commits/Thomas-De-Schampheleire/kbuild-fix-compilation-of-dtb-specified-on-command-line-without-make-rule/20251120-220837
base:   deab487e0f9b39ae4603e22d7d00908ebfc9753c
patch link:    https://lore.kernel.org/r/20251120140645.478623-1-thomas.de_schampheleire%40nokia.com
patch subject: [PATCH] kbuild: fix compilation of dtb specified on command-line without make rule
:::::: branch date: 75 minutes ago
:::::: commit date: 75 minutes ago
config: openrisc-allnoconfig (https://download.01.org/0day-ci/archive/20251120/202511202330.fSUeokem-lkp@intel.com/config)
compiler: or1k-linux-gcc (GCC) 15.1.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251120/202511202330.fSUeokem-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/r/202511202330.fSUeokem-lkp@intel.com/

All errors (new ones prefixed by >>):

>> make[3]: *** No rule to make target 'arch/openrisc/boot/dts/dtbs-list', needed by '.builtin-dtbs-list'.
   make[3]: Target '__default' not remade because of errors.

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2025-11-25 13:26 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-20 14:06 [PATCH] kbuild: fix compilation of dtb specified on command-line without make rule Thomas De Schampheleire
2025-11-21  6:42 ` Nathan Chancellor
2025-11-21 19:46   ` Nicolas Schier
2025-11-24 13:07 ` Rob Herring
2025-11-25 10:52   ` Thomas De Schampheleire
2025-11-25 13:25     ` Rob Herring
  -- strict thread matches above, loose matches on Subject: below --
2025-11-20 15:18 kernel test robot
2025-11-20 15:29 kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.