From: Daniel Axtens <hidden> Date: 2018-11-28 04:37:12
A couple of weeks ago, I found my powerpc64e builds were broken
when building out-of-tree with make O=../destination:
BOOTCC arch/powerpc/boot/serial.o
powerpc64-linux-gnu-gcc: error: arch/powerpc/boot/serial.c: No such file or directory
powerpc64-linux-gnu-gcc: fatal error: no input files
This is because 5e9dcb6188a4 ("powerpc/boot: Expose Kconfig symbols
to wrapper") adds a more specific rule for serial.c which doesn't
include a copy command. Add it.
Cc: Joel Stanley <joel@jms.id.au>
Fixes: 5e9dcb6188a4 ("powerpc/boot: Expose Kconfig symbols to wrapper")
Signed-off-by: Daniel Axtens <redacted>
---
arch/powerpc/boot/Makefile | 1 +
1 file changed, 1 insertion(+)
From: Daniel Axtens <hidden> Date: 2018-11-29 04:48:39
Right, so as both 0-day and snowpatch tell me, this patch is wrong.
It turns out that this:
$(obj)/serial.c: $(obj)/autoconf.h
+ $(Q)cp $< $@
is identical to:
cp arch/powerpc/boot/autoconf.h arch/powerpc/boot/serial.c
(Clearly my make mastery is inadequate.)
Amusingly this which works for my 64e uImage but obviously not for
anything that actually needs code from serial.c.
Further analysis suggests that making with -j1 triggers the issue, but
everything works with -j2 and above. That would make sense with the
timeline of when I discovered the issue because I changed my build
script to not build in parallel.
Regards,
Daniel
From: Michael Ellerman <mpe@ellerman.id.au> Date: 2018-11-29 11:07:58
Hi dja,
Daniel Axtens [off-list ref] writes:
Right, so as both 0-day and snowpatch tell me, this patch is wrong.
It turns out that this:
quoted
$(obj)/serial.c: $(obj)/autoconf.h
+ $(Q)cp $< $@
is identical to:
cp arch/powerpc/boot/autoconf.h arch/powerpc/boot/serial.c
(Clearly my make mastery is inadequate.)
Amusingly this which works for my 64e uImage but obviously not for
anything that actually needs code from serial.c.
Further analysis suggests that making with -j1 triggers the issue, but
everything works with -j2 and above. That would make sense with the
timeline of when I discovered the issue because I changed my build
script to not build in parallel.
I don't get why -j makes a difference, but that does explain why we
haven't seen it, none of my tests use -j 1 :)
I don't think we actually want to copy serial.c, we just want to specify
a dependency, does this work for you?
cheers
From: Daniel Axtens <hidden> Date: 2018-11-29 11:44:45
Hi mpe,
quoted
Further analysis suggests that making with -j1 triggers the issue, but
everything works with -j2 and above. That would make sense with the
timeline of when I discovered the issue because I changed my build
script to not build in parallel.
I don't get why -j makes a difference, but that does explain why we
haven't seen it, none of my tests use -j 1 :)
I don't understand either - only that with -j1 V=1 I get
powerpc64le-linux-gnu-gcc ... -c -o arch/powerpc/boot/serial.o arch/powerpc/boot/serial.c
and with -j2 I get:
powerpc64le-linux-gnu-gcc ... -c -o arch/powerpc/boot/serial.o /home/dja/dev/linux/linux/arch/powerpc/boot/serial.c
So for some reason j2 is getting the absolute path and j1 is getting a
relative path. I have absolutely no idea why this would be.
I don't think we actually want to copy serial.c, we just want to specify
a dependency, does this work for you?
Yeah I think you're right, I misunderstood the boot wrapper.
That patch works for me - it causes the full path to be used.
Thanks heaps!
Regards,
Daniel