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

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