mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* compile bug about banner and version macros.
@ 2015-09-15 11:49 Kevin Du Huanpeng
  2015-09-15 12:09 ` Kevin Du Huanpeng
  2015-09-16  5:27 ` Sascha Hauer
  0 siblings, 2 replies; 3+ messages in thread
From: Kevin Du Huanpeng @ 2015-09-15 11:49 UTC (permalink / raw)
  To: barebox

this patch fix a tiny compile bug.
1. how to reproduce the bug.
        $ export ARCH=mips
        $ export CROSS_COMPILE=mips-linux-gnu-
        $ make allnoconfig
- - - error msg - - -
du@L64:~/source/barebox$ make
  CHK     include/generated/version.h
  CHK     include/generated/utsrelease.h
  AS      arch/mips/boot/start.o
arch/mips/boot/start.S:25:31: fatal error: generated/compile.h: No
such file or directory
 #include <generated/compile.h>
                               ^
compilation terminated.
make[1]: *** [arch/mips/boot/start.o] Error 1
make: *** [arch/mips/boot] Error 2
- - - error msg - - -

2. huntting the bug.
after use grep, I find the file is depends on version.o in
        $ vi common/Makefile +81
                81 $(obj)/version.o: include/generated/compile.h
when the CONFIG_BANNER is not enabled, the version.o is not exsist,
so, the file was never genated.
                13 obj-$(CONFIG_BANNER)            += version.o
3. fix it.
add condition compile, or anyone have better sulotion?
----
diff --git a/arch/mips/boot/start.S b/arch/mips/boot/start.S
index 7e2ae5e..2b0ffa8 100644
--- a/arch/mips/boot/start.S
+++ b/arch/mips/boot/start.S
@@ -22,7 +22,9 @@
 #include <asm/mipsregs.h>
 #include <asm/asm.h>
 #include <asm-generic/memory_layout.h>
+#ifdef CONFIG_BANNER
 #include <generated/compile.h>
+#endif
 #include <generated/utsrelease.h>

        /*
@@ -56,7 +58,10 @@ EXPORT(_start)
         nop

        .org    0x10
-       .ascii  "barebox " UTS_RELEASE " " UTS_VERSION
+       .ascii  "barebox " UTS_RELEASE
+#ifdef CONFIG_BANNER
+       .ascii  " " UTS_VERSION
+#endif
        .byte   0

        .align 4

----
4. better sulotion?
I grep-ed compile.h, more than one source code use this file without
check the CONFIG_BANNER macro. so... maybe my patch need improved.
or allways genate compile.h? this just waste some time when compiling.

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: compile bug about banner and version macros.
  2015-09-15 11:49 compile bug about banner and version macros Kevin Du Huanpeng
@ 2015-09-15 12:09 ` Kevin Du Huanpeng
  2015-09-16  5:27 ` Sascha Hauer
  1 sibling, 0 replies; 3+ messages in thread
From: Kevin Du Huanpeng @ 2015-09-15 12:09 UTC (permalink / raw)
  To: barebox

if you can't reproduce this bug, maybe you have generated compile.h
before but make clean did't delete it.
Please pull a fresh source or
1 remove compile.h
2 disable CONFIG_BANNER

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: compile bug about banner and version macros.
  2015-09-15 11:49 compile bug about banner and version macros Kevin Du Huanpeng
  2015-09-15 12:09 ` Kevin Du Huanpeng
@ 2015-09-16  5:27 ` Sascha Hauer
  1 sibling, 0 replies; 3+ messages in thread
From: Sascha Hauer @ 2015-09-16  5:27 UTC (permalink / raw)
  To: Kevin Du Huanpeng; +Cc: barebox

On Tue, Sep 15, 2015 at 07:49:15PM +0800, Kevin Du Huanpeng wrote:
> this patch fix a tiny compile bug.
> 1. how to reproduce the bug.
>         $ export ARCH=mips
>         $ export CROSS_COMPILE=mips-linux-gnu-
>         $ make allnoconfig
> - - - error msg - - -
> du@L64:~/source/barebox$ make
>   CHK     include/generated/version.h
>   CHK     include/generated/utsrelease.h
>   AS      arch/mips/boot/start.o
> arch/mips/boot/start.S:25:31: fatal error: generated/compile.h: No
> such file or directory
>  #include <generated/compile.h>
>                                ^
> compilation terminated.
> make[1]: *** [arch/mips/boot/start.o] Error 1
> make: *** [arch/mips/boot] Error 2

include/generated/compile.h is autogenerated, but arch/mips/boot/start.o
does not have a dependency on that file, so depending on the number of
cores you have it might or might not exist when you compile start.S.
Just try building barebox again when it failed, it should work the
second time. The patch you post may work by accident, but is no proper
fix for this problem. Unfortunately I haven't found a working solution
yet other than removing UTS_VERSION from start.S

Sascha


-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

end of thread, other threads:[~2015-09-16  5:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-15 11:49 compile bug about banner and version macros Kevin Du Huanpeng
2015-09-15 12:09 ` Kevin Du Huanpeng
2015-09-16  5:27 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox