linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] powerpc/boot: Copy serial.c in Makefile
@ 2018-11-28  4:34 Daniel Axtens
  2018-11-28 21:23 ` kbuild test robot
  2018-11-29  4:45 ` Daniel Axtens
  0 siblings, 2 replies; 5+ messages in thread
From: Daniel Axtens @ 2018-11-28  4:34 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Joel Stanley, Daniel Axtens

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 <dja@axtens.net>
---
 arch/powerpc/boot/Makefile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile
index 111f97b1ccec..3d5b24b02228 100644
--- a/arch/powerpc/boot/Makefile
+++ b/arch/powerpc/boot/Makefile
@@ -203,6 +203,7 @@ $(obj)/zImage.coff.lds $(obj)/zImage.ps3.lds : $(obj)/%: $(srctree)/$(src)/%.S
 	$(Q)cp $< $@
 
 $(obj)/serial.c: $(obj)/autoconf.h
+	$(Q)cp $< $@
 
 $(obj)/autoconf.h: $(obj)/%: $(objtree)/include/generated/%
 	$(Q)cp $< $@
-- 
2.17.1


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

* Re: [PATCH] powerpc/boot: Copy serial.c in Makefile
  2018-11-28  4:34 [PATCH] powerpc/boot: Copy serial.c in Makefile Daniel Axtens
@ 2018-11-28 21:23 ` kbuild test robot
  2018-11-29  4:45 ` Daniel Axtens
  1 sibling, 0 replies; 5+ messages in thread
From: kbuild test robot @ 2018-11-28 21:23 UTC (permalink / raw)
  To: Daniel Axtens; +Cc: Daniel Axtens, linuxppc-dev, kbuild-all, Joel Stanley

[-- Attachment #1: Type: text/plain, Size: 1153 bytes --]

Hi Daniel,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on powerpc/next]
[also build test ERROR on v4.20-rc4 next-20181128]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Daniel-Axtens/powerpc-boot-Copy-serial-c-in-Makefile/20181129-025021
base:   https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git next
config: powerpc-defconfig (attached as .config)
compiler: powerpc64-linux-gnu-gcc (Debian 7.2.0-11) 7.2.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        GCC_VERSION=7.2.0 make.cross ARCH=powerpc 

All errors (new ones prefixed by >>):

   arch/powerpc/boot/epapr.o: In function `epapr_platform_init':
>> epapr.c:(.text+0x184): undefined reference to `serial_console_init'

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 24179 bytes --]

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

* Re: [PATCH] powerpc/boot: Copy serial.c in Makefile
  2018-11-28  4:34 [PATCH] powerpc/boot: Copy serial.c in Makefile Daniel Axtens
  2018-11-28 21:23 ` kbuild test robot
@ 2018-11-29  4:45 ` Daniel Axtens
  2018-11-29 11:04   ` Michael Ellerman
  1 sibling, 1 reply; 5+ messages in thread
From: Daniel Axtens @ 2018-11-29  4:45 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Joel Stanley

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



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

* Re: [PATCH] powerpc/boot: Copy serial.c in Makefile
  2018-11-29  4:45 ` Daniel Axtens
@ 2018-11-29 11:04   ` Michael Ellerman
  2018-11-29 11:42     ` Daniel Axtens
  0 siblings, 1 reply; 5+ messages in thread
From: Michael Ellerman @ 2018-11-29 11:04 UTC (permalink / raw)
  To: Daniel Axtens, linuxppc-dev; +Cc: Joel Stanley

Hi dja,

Daniel Axtens <dja@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 $< $@

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

* Re: [PATCH] powerpc/boot: Copy serial.c in Makefile
  2018-11-29 11:04   ` Michael Ellerman
@ 2018-11-29 11:42     ` Daniel Axtens
  0 siblings, 0 replies; 5+ messages in thread
From: Daniel Axtens @ 2018-11-29 11:42 UTC (permalink / raw)
  To: Michael Ellerman, linuxppc-dev; +Cc: Joel Stanley

Hi mpe,

>> 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

> 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 $< $@

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

end of thread, other threads:[~2018-11-29 11:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-28  4:34 [PATCH] powerpc/boot: Copy serial.c in Makefile Daniel Axtens
2018-11-28 21:23 ` kbuild test robot
2018-11-29  4:45 ` Daniel Axtens
2018-11-29 11:04   ` Michael Ellerman
2018-11-29 11:42     ` Daniel Axtens

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).