All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] Makefile: fix dependency for imx targets
@ 2019-10-25 12:46 Heiko Schocher
  2019-10-25 16:13 ` Tom Rini
  2019-11-06 19:10 ` Tom Rini
  0 siblings, 2 replies; 3+ messages in thread
From: Heiko Schocher @ 2019-10-25 12:46 UTC (permalink / raw)
  To: u-boot

imx targets are defined in arch/arm/mach-imx/Makefile.
Some of them are dependent on targets defined in main
Makefile. For the Makefile in arch/arm/mach-imx this
targets must be finished before the imx targets are
build, if not you get for example the error:

make -f /home/hs/abb/mainlining/u-boot/scripts/Makefile.build obj=arch/arm/mach-imx u-boot-dtb.imx
make[2]: *** No rule to make target 'u-boot-fit-dtb.bin', needed by 'u-boot-dtb.imx'.  Stop.
make[1]: *** [/home/hs/abb/mainlining/u-boot/Makefile:1123: u-boot-dtb.imx] Error 2
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory '/work/hs/compile/u-boot/aristainetos2_defconfig'
make: *** [Makefile:148: sub-make] Error 2
compile failed

In above case of CONFIG_MULTI_DTB_FIT is defined, the
u-boot-dtb.imx is dependent on the u-boot-fit-dtb.bin
which may is not build yet ...

I could reproduce this error on a travis build also if
I build an out-of-tree build on a local machine with a
build directory on a "slow" slow storage device. If
building the same source target with a build dir on a
fast storage device, the build works.

I found no solution to tell the arch/arm/mach-imx/Makefile
to find the targets in main Makefile, if there is a way
this would be the better fix.

I solved it by adding a IMX_DEPS var, which holds a list
of main u-boot targets, which must be finished, before
calling imx targets and fixed the build for imx
targets which enabled CONFIG_MULTI_DTB_FIT.

I think it is just luck, that imx targets with
CONFIG_OF_SEPARATE enabled build, because the
u-boot-dtb.imx target depends on u-boot-dtb.bin
which gets build early enough before starting with
u-boot-dtb.imx. May this targets should be fixed too.

Signed-off-by: Heiko Schocher <hs@denx.de>

---
travis build:
https://travis-ci.org/hsdenx/u-boot-test/builds/602656876

 Makefile | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index cbacf1cfe2..1d2c778bd5 100644
--- a/Makefile
+++ b/Makefile
@@ -1119,7 +1119,15 @@ u-boot.bin: u-boot-nodtb.bin FORCE
 	$(call if_changed,copy)
 endif
 
-%.imx: %.bin
+# we call Makefile in arch/arm/mach-imx which
+# has targets which are dependent on targets defined
+# here. make could not resolve them and we must ensure
+# that they are finished before calling imx targets
+ifeq ($(CONFIG_MULTI_DTB_FIT),y)
+IMX_DEPS = u-boot-fit-dtb.bin
+endif
+
+%.imx: $(IMX_DEPS) %.bin
 	$(Q)$(MAKE) $(build)=arch/arm/mach-imx $@
 	$(BOARD_SIZE_CHECK)
 
-- 
2.21.0

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

* [U-Boot] [PATCH] Makefile: fix dependency for imx targets
  2019-10-25 12:46 [U-Boot] [PATCH] Makefile: fix dependency for imx targets Heiko Schocher
@ 2019-10-25 16:13 ` Tom Rini
  2019-11-06 19:10 ` Tom Rini
  1 sibling, 0 replies; 3+ messages in thread
From: Tom Rini @ 2019-10-25 16:13 UTC (permalink / raw)
  To: u-boot

On Fri, Oct 25, 2019 at 02:46:54PM +0200, Heiko Schocher wrote:

> imx targets are defined in arch/arm/mach-imx/Makefile.
> Some of them are dependent on targets defined in main
> Makefile. For the Makefile in arch/arm/mach-imx this
> targets must be finished before the imx targets are
> build, if not you get for example the error:
> 
> make -f /home/hs/abb/mainlining/u-boot/scripts/Makefile.build obj=arch/arm/mach-imx u-boot-dtb.imx
> make[2]: *** No rule to make target 'u-boot-fit-dtb.bin', needed by 'u-boot-dtb.imx'.  Stop.
> make[1]: *** [/home/hs/abb/mainlining/u-boot/Makefile:1123: u-boot-dtb.imx] Error 2
> make[1]: *** Waiting for unfinished jobs....
> make[1]: Leaving directory '/work/hs/compile/u-boot/aristainetos2_defconfig'
> make: *** [Makefile:148: sub-make] Error 2
> compile failed
> 
> In above case of CONFIG_MULTI_DTB_FIT is defined, the
> u-boot-dtb.imx is dependent on the u-boot-fit-dtb.bin
> which may is not build yet ...
> 
> I could reproduce this error on a travis build also if
> I build an out-of-tree build on a local machine with a
> build directory on a "slow" slow storage device. If
> building the same source target with a build dir on a
> fast storage device, the build works.
> 
> I found no solution to tell the arch/arm/mach-imx/Makefile
> to find the targets in main Makefile, if there is a way
> this would be the better fix.
> 
> I solved it by adding a IMX_DEPS var, which holds a list
> of main u-boot targets, which must be finished, before
> calling imx targets and fixed the build for imx
> targets which enabled CONFIG_MULTI_DTB_FIT.
> 
> I think it is just luck, that imx targets with
> CONFIG_OF_SEPARATE enabled build, because the
> u-boot-dtb.imx target depends on u-boot-dtb.bin
> which gets build early enough before starting with
> u-boot-dtb.imx. May this targets should be fixed too.
> 
> Signed-off-by: Heiko Schocher <hs@denx.de>

Reviewed-by: Tom Rini <trini@konsulko.com>

Good work figuring this out!  I'll pick it up directly soon as I know it
was blocking other stuff.

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20191025/54e4f6e4/attachment.sig>

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

* [U-Boot] [PATCH] Makefile: fix dependency for imx targets
  2019-10-25 12:46 [U-Boot] [PATCH] Makefile: fix dependency for imx targets Heiko Schocher
  2019-10-25 16:13 ` Tom Rini
@ 2019-11-06 19:10 ` Tom Rini
  1 sibling, 0 replies; 3+ messages in thread
From: Tom Rini @ 2019-11-06 19:10 UTC (permalink / raw)
  To: u-boot

On Fri, Oct 25, 2019 at 02:46:54PM +0200, Heiko Schocher wrote:

> imx targets are defined in arch/arm/mach-imx/Makefile.
> Some of them are dependent on targets defined in main
> Makefile. For the Makefile in arch/arm/mach-imx this
> targets must be finished before the imx targets are
> build, if not you get for example the error:
> 
> make -f /home/hs/abb/mainlining/u-boot/scripts/Makefile.build obj=arch/arm/mach-imx u-boot-dtb.imx
> make[2]: *** No rule to make target 'u-boot-fit-dtb.bin', needed by 'u-boot-dtb.imx'.  Stop.
> make[1]: *** [/home/hs/abb/mainlining/u-boot/Makefile:1123: u-boot-dtb.imx] Error 2
> make[1]: *** Waiting for unfinished jobs....
> make[1]: Leaving directory '/work/hs/compile/u-boot/aristainetos2_defconfig'
> make: *** [Makefile:148: sub-make] Error 2
> compile failed
> 
> In above case of CONFIG_MULTI_DTB_FIT is defined, the
> u-boot-dtb.imx is dependent on the u-boot-fit-dtb.bin
> which may is not build yet ...
> 
> I could reproduce this error on a travis build also if
> I build an out-of-tree build on a local machine with a
> build directory on a "slow" slow storage device. If
> building the same source target with a build dir on a
> fast storage device, the build works.
> 
> I found no solution to tell the arch/arm/mach-imx/Makefile
> to find the targets in main Makefile, if there is a way
> this would be the better fix.
> 
> I solved it by adding a IMX_DEPS var, which holds a list
> of main u-boot targets, which must be finished, before
> calling imx targets and fixed the build for imx
> targets which enabled CONFIG_MULTI_DTB_FIT.
> 
> I think it is just luck, that imx targets with
> CONFIG_OF_SEPARATE enabled build, because the
> u-boot-dtb.imx target depends on u-boot-dtb.bin
> which gets build early enough before starting with
> u-boot-dtb.imx. May this targets should be fixed too.
> 
> Signed-off-by: Heiko Schocher <hs@denx.de>
> Reviewed-by: Tom Rini <trini@konsulko.com>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20191106/aaddce53/attachment.sig>

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

end of thread, other threads:[~2019-11-06 19:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-25 12:46 [U-Boot] [PATCH] Makefile: fix dependency for imx targets Heiko Schocher
2019-10-25 16:13 ` Tom Rini
2019-11-06 19:10 ` Tom Rini

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.