[PATCH] powerpc/boot: Copy serial.c in Makefile

Michael Ellerman mpe at ellerman.id.au
Thu Nov 29 22:04:45 AEDT 2018


Hi dja,

Daniel Axtens <dja at axtens.net> writes:
> 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.

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

diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile
index 39354365f54a..ed9883169190 100644
--- a/arch/powerpc/boot/Makefile
+++ b/arch/powerpc/boot/Makefile
@@ -197,7 +197,7 @@ $(addprefix $(obj)/,$(libfdt) $(libfdtheader)): $(obj)/%: $(srctree)/scripts/dtc
 $(obj)/zImage.coff.lds $(obj)/zImage.ps3.lds : $(obj)/%: $(srctree)/$(src)/%.S
 	$(Q)cp $< $@
 
-$(obj)/serial.c: $(obj)/autoconf.h
+$(srctree)/$(src)/serial.c: $(obj)/autoconf.h
 
 $(obj)/autoconf.h: $(obj)/%: $(objtree)/include/generated/%
 	$(Q)cp $< $@


More information about the Linuxppc-dev mailing list