mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Kevin Du Huanpeng <u74147@gmail.com>
To: "barebox@lists.infradead.org" <barebox@lists.infradead.org>
Subject: compile bug about banner and version macros.
Date: Tue, 15 Sep 2015 19:49:15 +0800	[thread overview]
Message-ID: <CANvTkNYaWMG0biCUXs+hZNBoPBg6dvS8artP8eo+5pvU_MGSdg@mail.gmail.com> (raw)

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

             reply	other threads:[~2015-09-15 11:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-15 11:49 Kevin Du Huanpeng [this message]
2015-09-15 12:09 ` Kevin Du Huanpeng
2015-09-16  5:27 ` Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CANvTkNYaWMG0biCUXs+hZNBoPBg6dvS8artP8eo+5pvU_MGSdg@mail.gmail.com \
    --to=u74147@gmail.com \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox