All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [RFC PATCH] ARM: print gcc version
@ 2010-12-20 16:38 Alexander Holler
  2011-01-09 21:03 ` Wolfgang Denk
  0 siblings, 1 reply; 8+ messages in thread
From: Alexander Holler @ 2010-12-20 16:38 UTC (permalink / raw)
  To: u-boot

It might be useful to see what compiler version was used to compile u-boot.
---
 arch/arm/lib/board.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/lib/board.c b/arch/arm/lib/board.c
index 96c0e30..df90b5e 100644
--- a/arch/arm/lib/board.c
+++ b/arch/arm/lib/board.c
@@ -75,7 +75,7 @@ extern void dataflash_print_info(void);
 #endif
 
 const char version_string[] =
-	U_BOOT_VERSION" (" U_BOOT_DATE " - " U_BOOT_TIME ")"CONFIG_IDENT_STRING;
+	U_BOOT_VERSION" (" U_BOOT_DATE " - " U_BOOT_TIME ", gcc " __VERSION__ ")"CONFIG_IDENT_STRING;
 
 #ifdef CONFIG_DRIVER_RTL8019
 extern void rtl8019_get_enetaddr (uchar * addr);
-- 
1.7.2.2

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

* [U-Boot] [RFC PATCH] ARM: print gcc version
  2010-12-20 16:38 [U-Boot] [RFC PATCH] ARM: print gcc version Alexander Holler
@ 2011-01-09 21:03 ` Wolfgang Denk
  2011-01-11  2:00   ` Alexander Holler
  0 siblings, 1 reply; 8+ messages in thread
From: Wolfgang Denk @ 2011-01-09 21:03 UTC (permalink / raw)
  To: u-boot

Dear Alexander Holler,

In message <1292863117-3175-1-git-send-email-holler@ahsoftware.de> you wrote:
> It might be useful to see what compiler version was used to compile u-boot.
> ---
>  arch/arm/lib/board.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/arch/arm/lib/board.c b/arch/arm/lib/board.c
> index 96c0e30..df90b5e 100644
> --- a/arch/arm/lib/board.c
> +++ b/arch/arm/lib/board.c
> @@ -75,7 +75,7 @@ extern void dataflash_print_info(void);
>  #endif
>  
>  const char version_string[] =
> -	U_BOOT_VERSION" (" U_BOOT_DATE " - " U_BOOT_TIME ")"CONFIG_IDENT_STRING;
> +	U_BOOT_VERSION" (" U_BOOT_DATE " - " U_BOOT_TIME ", gcc " __VERSION__ ")"CONFIG_IDENT_STRING;

I understand your intention, but I'm not really happy with it.

So far, the version_string is mostly architecture and system independent.
I haven't seen any comments about this, but I can imagine that we want
such information globally.

On the other hand, that would require changes to many files, and the
gcc __VERSION__ string is pretty long on some systems, which may cause
additional problems.

I also doubt that we need this information with each boot message
(where it just slows down booting).

Would it not be sufficient to add this to the code of do_version() so
we can get this information when we want it, i. e. when running the
"version" command?

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
As long as we're going to reinvent the wheel again, we might as  well
try making it round this time.                        - Mike Dennison

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

* [U-Boot] [RFC PATCH] ARM: print gcc version
  2011-01-09 21:03 ` Wolfgang Denk
@ 2011-01-11  2:00   ` Alexander Holler
  2011-01-17 22:28     ` Wolfgang Denk
  0 siblings, 1 reply; 8+ messages in thread
From: Alexander Holler @ 2011-01-11  2:00 UTC (permalink / raw)
  To: u-boot

Am 09.01.2011 22:03, schrieb Wolfgang Denk:
> Dear Alexander Holler,
>
> In message<1292863117-3175-1-git-send-email-holler@ahsoftware.de>  you wrote:
>> It might be useful to see what compiler version was used to compile u-boot.
>> ---
>>   arch/arm/lib/board.c |    2 +-
>>   1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/arch/arm/lib/board.c b/arch/arm/lib/board.c
>> index 96c0e30..df90b5e 100644
>> --- a/arch/arm/lib/board.c
>> +++ b/arch/arm/lib/board.c
>> @@ -75,7 +75,7 @@ extern void dataflash_print_info(void);
>>   #endif
>>
>>   const char version_string[] =
>> -	U_BOOT_VERSION" (" U_BOOT_DATE " - " U_BOOT_TIME ")"CONFIG_IDENT_STRING;
>> +	U_BOOT_VERSION" (" U_BOOT_DATE " - " U_BOOT_TIME ", gcc " __VERSION__ ")"CONFIG_IDENT_STRING;
>
> I understand your intention, but I'm not really happy with it.
>
> So far, the version_string is mostly architecture and system independent.
> I haven't seen any comments about this, but I can imagine that we want
> such information globally.
>
> On the other hand, that would require changes to many files, and the
> gcc __VERSION__ string is pretty long on some systems, which may cause
> additional problems.

Hmm, here it includes only "4.5.2", the plain version and not the vendor 
version. Therfore I was happy with that, because the vendor version 
would be too long to display at startup.

> I also doubt that we need this information with each boot message
> (where it just slows down booting).

Hmm, I haven't counted the time needed to display additional 9 
characters, but displaying the version at startup is handy for "screen 
dumps" (e.g. stuff pasted by people with problems).

> Would it not be sufficient to add this to the code of do_version() so
> we can get this information when we want it, i. e. when running the
> "version" command?

I would like that. But as you said, my intention was really only because 
of the current problems with gcc for arm.

Besides that, I would found it handy to see the used compiler for 
u-boot's where I don't have the source by hand, e.g. those already found 
on boards. But that might be because I'm curious by default. ;)

Anyway, I would found it a nice feature, at startup or when running the 
version command, but both aren't a must.

Regards,

Alexander

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

* [U-Boot] [RFC PATCH] ARM: print gcc version
  2011-01-11  2:00   ` Alexander Holler
@ 2011-01-17 22:28     ` Wolfgang Denk
  2011-01-18  9:16       ` Alexander Holler
  0 siblings, 1 reply; 8+ messages in thread
From: Wolfgang Denk @ 2011-01-17 22:28 UTC (permalink / raw)
  To: u-boot

Dear Alexander Holler,

In message <4D2BB9AC.1040504@ahsoftware.de> you wrote:
>
> > On the other hand, that would require changes to many files, and the
> > gcc __VERSION__ string is pretty long on some systems, which may cause
> > additional problems.
> 
> Hmm, here it includes only "4.5.2", the plain version and not the vendor 
> version. Therfore I was happy with that, because the vendor version 
> would be too long to display at startup.

Well, what I see is for example "4.5.1 20100924 (Red Hat 4.5.1-4)"
with the native GCC on Fedora 14; some other tool chains provide
similar long results.


> > I also doubt that we need this information with each boot message
> > (where it just slows down booting).
> 
> Hmm, I haven't counted the time needed to display additional 9 
> characters, but displaying the version at startup is handy for "screen 

It's about 1 millisecond at 115 kbps, or 10 milliseconds at 9600 ;-)

> dumps" (e.g. stuff pasted by people with problems).

I think we're already printing way too muc information- and still
people don't include even the most vital information like which
version of U-Boot they are running.

> > Would it not be sufficient to add this to the code of do_version() so
> > we can get this information when we want it, i. e. when running the
> > "version" command?
> 
> I would like that. But as you said, my intention was really only because 
> of the current problems with gcc for arm.

So will you prepare a patch? [TIA!]

> Besides that, I would found it handy to see the used compiler for 
> u-boot's where I don't have the source by hand, e.g. those already found 
> on boards. But that might be because I'm curious by default. ;)

Well, eventually we should print more than __VERSION__, then. Becasue
if you see "4.4.1" - what does it tell you? You don't see that this is
the Sourcery G++ Lite 2010q1-202 version of GCC, or that ""4.5.0
20100729 (prerelease)" is a specific Poky release?

> Anyway, I would found it a nice feature, at startup or when running the 
> version command, but both aren't a must.

I think it would be a really useful extension to the version command.
Looking forwad to seeing your patch.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
A conservative is a man who believes that nothing should be done for
the first time.                                   - Alfred E. Wiggam

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

* [U-Boot] [RFC PATCH] ARM: print gcc version
  2011-01-17 22:28     ` Wolfgang Denk
@ 2011-01-18  9:16       ` Alexander Holler
  2011-01-18 16:20         ` Peter Tyser
  0 siblings, 1 reply; 8+ messages in thread
From: Alexander Holler @ 2011-01-18  9:16 UTC (permalink / raw)
  To: u-boot

Hello,

Am 17.01.2011 23:28, schrieb Wolfgang Denk:

>> Anyway, I would found it a nice feature, at startup or when running the
>> version command, but both aren't a must.
>
> I think it would be a really useful extension to the version command.
> Looking forwad to seeing your patch.

Maybe if someone could feed me with what to use for the version. E.g. my 
gcc here defines __VERSION__ as "4.5.2" but when I'm looking at
u-boot/lib/asm-offsets.s I see

.ident  "GCC: (Gentoo 4.5.2 p1.0, pie-0.4.5) 4.5.2"

So I would like to display that which would be in line with the comment 
section of generated binaries.

But when I use "gcc -E -dM empty.c" to print all predefined macros, I 
don't see the text found in .ident. Not even something else which 
includes "Gentoo".

Regards,

Alexander

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

* [U-Boot] [RFC PATCH] ARM: print gcc version
  2011-01-18  9:16       ` Alexander Holler
@ 2011-01-18 16:20         ` Peter Tyser
  2011-01-18 17:04           ` Alexander Holler
  0 siblings, 1 reply; 8+ messages in thread
From: Peter Tyser @ 2011-01-18 16:20 UTC (permalink / raw)
  To: u-boot

> >> Anyway, I would found it a nice feature, at startup or when running the
> >> version command, but both aren't a must.
> >
> > I think it would be a really useful extension to the version command.
> > Looking forwad to seeing your patch.
> 
> Maybe if someone could feed me with what to use for the version. E.g. my 
> gcc here defines __VERSION__ as "4.5.2" but when I'm looking at
> u-boot/lib/asm-offsets.s I see
> 
> .ident  "GCC: (Gentoo 4.5.2 p1.0, pie-0.4.5) 4.5.2"
> 
> So I would like to display that which would be in line with the comment 
> section of generated binaries.
> 
> But when I use "gcc -E -dM empty.c" to print all predefined macros, I 
> don't see the text found in .ident. Not even something else which 
> includes "Gentoo".

I believe the output of "$(CC) --version" should contain the same data
as your .ident string.  You could echo it into a file like:
diff --git a/Makefile b/Makefile
index 0685ef9..e070d40 100644
--- a/Makefile
+++ b/Makefile
@@ -416,6 +416,8 @@ $(U_BOOT_ONENAND):  $(ONENAND_IPL) $(obj)u-boot.bin
 $(VERSION_FILE):
                @( printf '#define U_BOOT_VERSION "U-Boot %s%s"\n' "$(U_BOOT_VERSION)" \
                 '$(shell $(TOPDIR)/tools/setlocalversion $(TOPDIR))' ) > $@.tmp
+               @( printf '#define CC_VERSION_STRING "%s"\n' \
+                '$(shell $(CC) --version | head -1)' ) >> $@.tmp
                @cmp -s $@ $@.tmp && rm -f $@.tmp || mv -f $@.tmp $@
 
 $(TIMESTAMP_FILE):

Best,
Peter

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

* [U-Boot] [RFC PATCH] ARM: print gcc version
  2011-01-18 16:20         ` Peter Tyser
@ 2011-01-18 17:04           ` Alexander Holler
  2011-01-18 19:53             ` Wolfgang Denk
  0 siblings, 1 reply; 8+ messages in thread
From: Alexander Holler @ 2011-01-18 17:04 UTC (permalink / raw)
  To: u-boot

Am 18.01.2011 17:20, schrieb Peter Tyser:
>>>> Anyway, I would found it a nice feature, at startup or when running the
>>>> version command, but both aren't a must.
>>>
>>> I think it would be a really useful extension to the version command.
>>> Looking forwad to seeing your patch.
>>
>> Maybe if someone could feed me with what to use for the version. E.g. my
>> gcc here defines __VERSION__ as "4.5.2" but when I'm looking at
>> u-boot/lib/asm-offsets.s I see
>>
>> .ident  "GCC: (Gentoo 4.5.2 p1.0, pie-0.4.5) 4.5.2"
>>
>> So I would like to display that which would be in line with the comment
>> section of generated binaries.
>>
>> But when I use "gcc -E -dM empty.c" to print all predefined macros, I
>> don't see the text found in .ident. Not even something else which
>> includes "Gentoo".
>
> I believe the output of "$(CC) --version" should contain the same data
> as your .ident string.  You could echo it into a file like:
> diff --git a/Makefile b/Makefile
> index 0685ef9..e070d40 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -416,6 +416,8 @@ $(U_BOOT_ONENAND):  $(ONENAND_IPL) $(obj)u-boot.bin
>   $(VERSION_FILE):
>                  @( printf '#define U_BOOT_VERSION "U-Boot %s%s"\n' "$(U_BOOT_VERSION)" \
>                   '$(shell $(TOPDIR)/tools/setlocalversion $(TOPDIR))' )>  $@.tmp
> +               @( printf '#define CC_VERSION_STRING "%s"\n' \
> +                '$(shell $(CC) --version | head -1)' )>>  $@.tmp
>                  @cmp -s $@ $@.tmp&&  rm -f $@.tmp || mv -f $@.tmp $@
>
>   $(TIMESTAMP_FILE):

That would the trick. The first line of gcc --version includes here the 
correct string. Thanks. (Btw. I would use head -n 1)

But I will wait for a comment from one of the maintainers about defining 
CC_VERSION_STRING.

If someone gives me an ok, I will write a patch including your 
suggestion and will print that version in the command version.

Regards,

Alexander

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

* [U-Boot] [RFC PATCH] ARM: print gcc version
  2011-01-18 17:04           ` Alexander Holler
@ 2011-01-18 19:53             ` Wolfgang Denk
  0 siblings, 0 replies; 8+ messages in thread
From: Wolfgang Denk @ 2011-01-18 19:53 UTC (permalink / raw)
  To: u-boot

Dear Alexander Holler,

In message <4D35C836.3020400@ahsoftware.de> you wrote:
>
> > @@ -416,6 +416,8 @@ $(U_BOOT_ONENAND):  $(ONENAND_IPL) $(obj)u-boot.bin
> >   $(VERSION_FILE):
> >                  @( printf '#define U_BOOT_VERSION "U-Boot %s%s"\n' "$(U_BOOT_VERSION)" \
> >                   '$(shell $(TOPDIR)/tools/setlocalversion $(TOPDIR))' )>  $@.tmp
> > +               @( printf '#define CC_VERSION_STRING "%s"\n' \
> > +                '$(shell $(CC) --version | head -1)' )>>  $@.tmp
> >                  @cmp -s $@ $@.tmp&&  rm -f $@.tmp || mv -f $@.tmp $@
> >
> >   $(TIMESTAMP_FILE):
> 
> That would the trick. The first line of gcc --version includes here the 
> correct string. Thanks. (Btw. I would use head -n 1)
> 
> But I will wait for a comment from one of the maintainers about defining 
> CC_VERSION_STRING.
> 
> If someone gives me an ok, I will write a patch including your 
> suggestion and will print that version in the command version.

Looks good to me - please go on.

Hm... while we are at it... the bintuils (especially linker) version
is probably equally interesting, so eventually we should also add a
LD_VERSION_STRING.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
A right is not what someone gives you; it's what no one can take from
you.                                                   - Ramsey Clark

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

end of thread, other threads:[~2011-01-18 19:53 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-20 16:38 [U-Boot] [RFC PATCH] ARM: print gcc version Alexander Holler
2011-01-09 21:03 ` Wolfgang Denk
2011-01-11  2:00   ` Alexander Holler
2011-01-17 22:28     ` Wolfgang Denk
2011-01-18  9:16       ` Alexander Holler
2011-01-18 16:20         ` Peter Tyser
2011-01-18 17:04           ` Alexander Holler
2011-01-18 19:53             ` Wolfgang Denk

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.