public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 4/9] UML - Export gcov symbol based on gcc version
@ 2005-03-10  2:16 Jeff Dike
  2005-03-10 22:53 ` Adrian Bunk
  2005-03-11 19:35 ` [uml-devel] " Blaisorblade
  0 siblings, 2 replies; 13+ messages in thread
From: Jeff Dike @ 2005-03-10  2:16 UTC (permalink / raw)
  To: torvalds; +Cc: akpm, linux-kernel, user-mode-linux-devel

The init function called by gcc when gcov is enabled is __gcov_init or
__bb_init_func, depending on the gcc version.  Anton is using 3.3.4 and 
seeing __gcov_init.  I'm using 3.3.2 and seeing __bb_init_func, so we need
to close that gap a bit.

Signed-off-by: Jeff Dike <jdike@addtoit.com>

Index: linux-2.6.11/arch/um/kernel/gmon_syms.c
===================================================================
--- linux-2.6.11.orig/arch/um/kernel/gmon_syms.c	2005-03-07 10:53:03.000000000 -0500
+++ linux-2.6.11/arch/um/kernel/gmon_syms.c	2005-03-07 16:29:37.000000000 -0500
@@ -5,8 +5,14 @@
 
 #include "linux/module.h"
 
+#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 3) || \
+	(__GNUC__ == 3 && __GNUC_MINOR__ == 3 && __GNUC_PATCHLEVEL__ >= 4)
+extern void __gcov_init(void *);
+EXPORT_SYMBOL(__gcov_init);
+#else
 extern void __bb_init_func(void *);
 EXPORT_SYMBOL(__bb_init_func);
+#endif
 
 /*
  * Overrides for Emacs so that we follow Linus's tabbing style.


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

* Re: [PATCH 4/9] UML - Export gcov symbol based on gcc version
  2005-03-10  2:16 [PATCH 4/9] UML - Export gcov symbol based on gcc version Jeff Dike
@ 2005-03-10 22:53 ` Adrian Bunk
  2005-03-10 23:21   ` Linus Torvalds
                     ` (2 more replies)
  2005-03-11 19:35 ` [uml-devel] " Blaisorblade
  1 sibling, 3 replies; 13+ messages in thread
From: Adrian Bunk @ 2005-03-10 22:53 UTC (permalink / raw)
  To: Jeff Dike; +Cc: torvalds, akpm, linux-kernel, user-mode-linux-devel

On Wed, Mar 09, 2005 at 09:16:02PM -0500, Jeff Dike wrote:
> The init function called by gcc when gcov is enabled is __gcov_init or
> __bb_init_func, depending on the gcc version.  Anton is using 3.3.4 and 
> seeing __gcov_init.  I'm using 3.3.2 and seeing __bb_init_func, so we need
> to close that gap a bit.
> 
> Signed-off-by: Jeff Dike <jdike@addtoit.com>
> 
> Index: linux-2.6.11/arch/um/kernel/gmon_syms.c
> ===================================================================
> --- linux-2.6.11.orig/arch/um/kernel/gmon_syms.c	2005-03-07 10:53:03.000000000 -0500
> +++ linux-2.6.11/arch/um/kernel/gmon_syms.c	2005-03-07 16:29:37.000000000 -0500
> @@ -5,8 +5,14 @@
>  
>  #include "linux/module.h"
>  
> +#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 3) || \
> +	(__GNUC__ == 3 && __GNUC_MINOR__ == 3 && __GNUC_PATCHLEVEL__ >= 4)
>...

This patch is still wrong.

It seems my comment on this [1] was lost:

<--  snip  -->

This line has to be something like

( (__GNUC__ == 3 && __GNUC_MINOR__ == 3 && __GNUC_PATCHLEVEL__ >= 4) && \
   HEAVILY_PATCHED_SUSE_GCC ) 

I hope SuSE has added some #define to distinguish what they call 
"gcc 3.3.4" from GNU gcc 3.3.4

<--  snip  -->


cu
Adrian

[1] http://www.ussg.iu.edu/hypermail/linux/kernel/0503.0/1876.html

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed


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

* Re: [PATCH 4/9] UML - Export gcov symbol based on gcc version
  2005-03-10 22:53 ` Adrian Bunk
@ 2005-03-10 23:21   ` Linus Torvalds
  2005-03-11 17:00     ` [uml-devel] " Blaisorblade
  2005-03-11 18:47     ` Jeff Dike
  2005-03-11 17:01   ` [uml-devel] " Blaisorblade
  2005-03-11 18:48   ` Jeff Dike
  2 siblings, 2 replies; 13+ messages in thread
From: Linus Torvalds @ 2005-03-10 23:21 UTC (permalink / raw)
  To: Adrian Bunk; +Cc: Jeff Dike, akpm, linux-kernel, user-mode-linux-devel



On Thu, 10 Mar 2005, Adrian Bunk wrote:
> 
> This patch is still wrong.

Can't we just fix it by havign an alias for both names? It seems stupid to 
jump through hoops and worry about compiler versions, when afaik we could 
just do something like

	extern xxxx(...) __attribute__((alias("yyyy")));

instead. Exact details left to the reader who knows more about all the 
magic gcc/linker things..

		Linus

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

* Re: [PATCH 4/9] UML - Export gcov symbol based on gcc version
  2005-03-11 18:48   ` Jeff Dike
@ 2005-03-11 16:55     ` Adrian Bunk
  2005-03-11 17:00       ` [uml-devel] " stian
  2005-03-11 23:53       ` Jeff Dike
  0 siblings, 2 replies; 13+ messages in thread
From: Adrian Bunk @ 2005-03-11 16:55 UTC (permalink / raw)
  To: Jeff Dike; +Cc: torvalds, akpm, linux-kernel, user-mode-linux-devel

On Fri, Mar 11, 2005 at 01:48:54PM -0500, Jeff Dike wrote:
> bunk@stusta.de said:
> > This patch is still wrong.
> > It seems my comment on this [1] was lost:
> > <--  snip  -->
> > This line has to be something like
> > ( (__GNUC__ == 3 && __GNUC_MINOR__ == 3 && __GNUC_PATCHLEVEL__ >= 4)
> > && \
> >    HEAVILY_PATCHED_SUSE_GCC ) 
> 
> > I hope SuSE has added some #define to distinguish what they call  "gcc
> > 3.3.4" from GNU gcc 3.3.4 
> 
> It wasn't lost - I am just disinclined to cater to distros making their
> gcc lie about its version.

And therefore you added a patch that helps only those distros at the 
price of breaking other people and distros using sane compilers?

> 				Jeff

cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed


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

* Re: [uml-devel] Re: [PATCH 4/9] UML - Export gcov symbol based on  gcc version
  2005-03-11 16:55     ` Adrian Bunk
@ 2005-03-11 17:00       ` stian
  2005-03-11 23:53       ` Jeff Dike
  1 sibling, 0 replies; 13+ messages in thread
From: stian @ 2005-03-11 17:00 UTC (permalink / raw)
  To: Adrian Bunk
  Cc: Jeff Dike, torvalds, akpm, linux-kernel, user-mode-linux-devel

>> > ( (__GNUC__ == 3 && __GNUC_MINOR__ == 3 && __GNUC_PATCHLEVEL__ >= 4)
>> > && \
>> >    HEAVILY_PATCHED_SUSE_GCC )
>> > I hope SuSE has added some #define to distinguish what they call  "gcc
>> > 3.3.4" from GNU gcc 3.3.4
>> It wasn't lost - I am just disinclined to cater to distros making their
>> gcc lie about its version.
> And therefore you added a patch that helps only those distros at the
> price of breaking other people and distros using sane compilers?

A dirty method would be to use a configure prinsip to test-compile, and
have a define that depends on it. Perhaps dirty, conserning kbuild, but
resolves problems, unless the alias symbol works.

Stian

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

* Re: [uml-devel] Re: [PATCH 4/9] UML - Export gcov symbol based on gcc version
  2005-03-10 23:21   ` Linus Torvalds
@ 2005-03-11 17:00     ` Blaisorblade
  2005-03-11 18:47     ` Jeff Dike
  1 sibling, 0 replies; 13+ messages in thread
From: Blaisorblade @ 2005-03-11 17:00 UTC (permalink / raw)
  To: user-mode-linux-devel
  Cc: Linus Torvalds, Adrian Bunk, Jeff Dike, akpm, linux-kernel

On Friday 11 March 2005 00:21, Linus Torvalds wrote:
> On Thu, 10 Mar 2005, Adrian Bunk wrote:
> > This patch is still wrong.
>
> Can't we just fix it by havign an alias for both names?
No, because the patch is wrong. It should export both symbols in the second 
case.
> It seems stupid to 
> jump through hoops and worry about compiler versions, when afaik we could
> just do something like
>
>  extern xxxx(...) __attribute__((alias("yyyy")));
>
> instead. Exact details left to the reader who knows more about all the
> magic gcc/linker things..
>
>   Linus

-- 
Paolo Giarrusso, aka Blaisorblade
Linux registered user n. 292729
http://www.user-mode-linux.org/~blaisorblade



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

* Re: [uml-devel] Re: [PATCH 4/9] UML - Export gcov symbol based on gcc version
  2005-03-10 22:53 ` Adrian Bunk
  2005-03-10 23:21   ` Linus Torvalds
@ 2005-03-11 17:01   ` Blaisorblade
  2005-03-11 18:48   ` Jeff Dike
  2 siblings, 0 replies; 13+ messages in thread
From: Blaisorblade @ 2005-03-11 17:01 UTC (permalink / raw)
  To: user-mode-linux-devel
  Cc: Adrian Bunk, Jeff Dike, torvalds, akpm, linux-kernel

On Thursday 10 March 2005 23:53, Adrian Bunk wrote:
> On Wed, Mar 09, 2005 at 09:16:02PM -0500, Jeff Dike wrote:
> > The init function called by gcc when gcov is enabled is __gcov_init or
> > __bb_init_func, depending on the gcc version.  Anton is using 3.3.4 and
> > seeing __gcov_init.  I'm using 3.3.2 and seeing __bb_init_func, so we
> > need to close that gap a bit.
> >
> > Signed-off-by: Jeff Dike <jdike@addtoit.com>
> >
> > Index: linux-2.6.11/arch/um/kernel/gmon_syms.c
> > ===================================================================
> > --- linux-2.6.11.orig/arch/um/kernel/gmon_syms.c 2005-03-07
> > 10:53:03.000000000 -0500 +++
> > linux-2.6.11/arch/um/kernel/gmon_syms.c 2005-03-07 16:29:37.000000000
> > -0500 @@ -5,8 +5,14 @@
> >
> >  #include "linux/module.h"
> >
> > +#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 3) || \
> > + (__GNUC__ == 3 && __GNUC_MINOR__ == 3 && __GNUC_PATCHLEVEL__ >= 4)
> >...
>
> This patch is still wrong.
>
> It seems my comment on this [1] was lost:
>
> <--  snip  -->
>
> This line has to be something like
>
> ( (__GNUC__ == 3 && __GNUC_MINOR__ == 3 && __GNUC_PATCHLEVEL__ >= 4) && \
>    HEAVILY_PATCHED_SUSE_GCC )
>
> I hope SuSE has added some #define to distinguish what they call
> "gcc 3.3.4" from GNU gcc 3.3.4
"You hope" does not mean "it exists".
Secondly, the patch is wrong anyway, as I said elsewhere.
-- 
Paolo Giarrusso, aka Blaisorblade
Linux registered user n. 292729
http://www.user-mode-linux.org/~blaisorblade


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

* Re: [PATCH 4/9] UML - Export gcov symbol based on gcc version
  2005-03-10 23:21   ` Linus Torvalds
  2005-03-11 17:00     ` [uml-devel] " Blaisorblade
@ 2005-03-11 18:47     ` Jeff Dike
  1 sibling, 0 replies; 13+ messages in thread
From: Jeff Dike @ 2005-03-11 18:47 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Adrian Bunk, akpm, linux-kernel, user-mode-linux-devel, jdike

torvalds@osdl.org said:
> Can't we just fix it by havign an alias for both names? It seems
> stupid to  jump through hoops and worry about compiler versions, when
> afaik we could  just do something like

> 	extern xxxx(...) __attribute__((alias("yyyy")));

> instead. Exact details left to the reader who knows more about all the
>  magic gcc/linker things.. 

OK, this exceeds my current linker-fu, but I'll take a look and get a better
fix for this.

				Jeff


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

* Re: [PATCH 4/9] UML - Export gcov symbol based on gcc version
  2005-03-10 22:53 ` Adrian Bunk
  2005-03-10 23:21   ` Linus Torvalds
  2005-03-11 17:01   ` [uml-devel] " Blaisorblade
@ 2005-03-11 18:48   ` Jeff Dike
  2005-03-11 16:55     ` Adrian Bunk
  2 siblings, 1 reply; 13+ messages in thread
From: Jeff Dike @ 2005-03-11 18:48 UTC (permalink / raw)
  To: Adrian Bunk; +Cc: torvalds, akpm, linux-kernel, user-mode-linux-devel

bunk@stusta.de said:
> This patch is still wrong.
> It seems my comment on this [1] was lost:
> <--  snip  -->
> This line has to be something like
> ( (__GNUC__ == 3 && __GNUC_MINOR__ == 3 && __GNUC_PATCHLEVEL__ >= 4)
> && \
>    HEAVILY_PATCHED_SUSE_GCC ) 

> I hope SuSE has added some #define to distinguish what they call  "gcc
> 3.3.4" from GNU gcc 3.3.4 

It wasn't lost - I am just disinclined to cater to distros making their
gcc lie about its version.

				Jeff


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

* Re: [uml-devel] [PATCH 4/9] UML - Export gcov symbol based on gcc version
  2005-03-10  2:16 [PATCH 4/9] UML - Export gcov symbol based on gcc version Jeff Dike
  2005-03-10 22:53 ` Adrian Bunk
@ 2005-03-11 19:35 ` Blaisorblade
  1 sibling, 0 replies; 13+ messages in thread
From: Blaisorblade @ 2005-03-11 19:35 UTC (permalink / raw)
  To: user-mode-linux-devel; +Cc: Jeff Dike, torvalds, akpm, linux-kernel

On Thursday 10 March 2005 03:16, Jeff Dike wrote:
> The init function called by gcc when gcov is enabled is __gcov_init or
> __bb_init_func, depending on the gcc version.  Anton is using 3.3.4 and
> seeing __gcov_init.  I'm using 3.3.2 and seeing __bb_init_func, so we need
> to close that gap a bit.

I'll have to undo this patch... I said that you must export both symbols when 
GCC version is the right one.

And I can say this version is > 3.3.4, since my good Gentoo's 3.3.4 does not 
include this symbol.

We rediscussed this with Jeff, and I'll post a better patch: 
EXPORT_SYMBOL(__gcov_init), and weakly define it to an empty function. I'll 
do it tomorrow.

> Signed-off-by: Jeff Dike <jdike@addtoit.com>
>
> Index: linux-2.6.11/arch/um/kernel/gmon_syms.c
> ===================================================================
> --- linux-2.6.11.orig/arch/um/kernel/gmon_syms.c 2005-03-07
> 10:53:03.000000000 -0500 +++
> linux-2.6.11/arch/um/kernel/gmon_syms.c 2005-03-07 16:29:37.000000000 -0500
> @@ -5,8 +5,14 @@
>
>  #include "linux/module.h"
>
> +#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 3) || \
> + (__GNUC__ == 3 && __GNUC_MINOR__ == 3 && __GNUC_PATCHLEVEL__ >= 4)
> +extern void __gcov_init(void *);
> +EXPORT_SYMBOL(__gcov_init);
> +#else
>  extern void __bb_init_func(void *);
>  EXPORT_SYMBOL(__bb_init_func);
> +#endif
>
>  /*
>   * Overrides for Emacs so that we follow Linus's tabbing style.


-- 
Paolo Giarrusso, aka Blaisorblade
Linux registered user n. 292729
http://www.user-mode-linux.org/~blaisorblade


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

* Re: [PATCH 4/9] UML - Export gcov symbol based on gcc version
  2005-03-11 23:53       ` Jeff Dike
@ 2005-03-11 23:37         ` Adrian Bunk
  2005-03-12  3:45           ` Jeff Dike
  0 siblings, 1 reply; 13+ messages in thread
From: Adrian Bunk @ 2005-03-11 23:37 UTC (permalink / raw)
  To: Jeff Dike; +Cc: linux-kernel, user-mode-linux-devel

On Fri, Mar 11, 2005 at 06:53:15PM -0500, Jeff Dike wrote:
> bunk@stusta.de said:
> > And therefore you added a patch that helps only those distros at the
> > price of breaking other people and distros using sane compilers? 
> 
> Didn't you start this thread by pointing out that SuSE has a gcc 3.3.4
> which isn't?  I would call that a compiler which lies about its version, and
> for the purposes of this argument, I would say that it is not a sane
> compiler.

I said:

<--  snip  -->

This line has to be something like

( (__GNUC__ == 3 && __GNUC_MINOR__ == 3 && __GNUC_PATCHLEVEL__ >= 4) && \
   HEAVILY_PATCHES_SUSE_GCC ) 

<--  snip  -->

IOW:
Only heavily patches gcc 3.3 compiler define __gcov_init.


Anton's original report said that he needs __gcov_init with
SuSE gcc 3.3.4 .


> Given this, your original (correct) claim was that my patch would not help
> such compilers.  Are you now claiming that it does help such compilers, and
> no one else?

No, my claim is that no sane gcc 3.3 defines __gcov_init.

> 				Jeff

cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed


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

* Re: [PATCH 4/9] UML - Export gcov symbol based on gcc version
  2005-03-11 16:55     ` Adrian Bunk
  2005-03-11 17:00       ` [uml-devel] " stian
@ 2005-03-11 23:53       ` Jeff Dike
  2005-03-11 23:37         ` Adrian Bunk
  1 sibling, 1 reply; 13+ messages in thread
From: Jeff Dike @ 2005-03-11 23:53 UTC (permalink / raw)
  To: Adrian Bunk; +Cc: linux-kernel, user-mode-linux-devel

bunk@stusta.de said:
> And therefore you added a patch that helps only those distros at the
> price of breaking other people and distros using sane compilers? 

Didn't you start this thread by pointing out that SuSE has a gcc 3.3.4
which isn't?  I would call that a compiler which lies about its version, and
for the purposes of this argument, I would say that it is not a sane
compiler.

Given this, your original (correct) claim was that my patch would not help
such compilers.  Are you now claiming that it does help such compilers, and
no one else?

				Jeff



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

* Re: [PATCH 4/9] UML - Export gcov symbol based on gcc version
  2005-03-11 23:37         ` Adrian Bunk
@ 2005-03-12  3:45           ` Jeff Dike
  0 siblings, 0 replies; 13+ messages in thread
From: Jeff Dike @ 2005-03-12  3:45 UTC (permalink / raw)
  To: Adrian Bunk; +Cc: linux-kernel, user-mode-linux-devel

bunk@stusta.de said:
> No, my claim is that no sane gcc 3.3 defines __gcov_init. 

Ah, OK.  Thanks for the clarification.

				Jeff


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

end of thread, other threads:[~2005-03-12  1:18 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-03-10  2:16 [PATCH 4/9] UML - Export gcov symbol based on gcc version Jeff Dike
2005-03-10 22:53 ` Adrian Bunk
2005-03-10 23:21   ` Linus Torvalds
2005-03-11 17:00     ` [uml-devel] " Blaisorblade
2005-03-11 18:47     ` Jeff Dike
2005-03-11 17:01   ` [uml-devel] " Blaisorblade
2005-03-11 18:48   ` Jeff Dike
2005-03-11 16:55     ` Adrian Bunk
2005-03-11 17:00       ` [uml-devel] " stian
2005-03-11 23:53       ` Jeff Dike
2005-03-11 23:37         ` Adrian Bunk
2005-03-12  3:45           ` Jeff Dike
2005-03-11 19:35 ` [uml-devel] " Blaisorblade

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