linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* compiling modules with gcc 3.2
@ 2003-04-25  6:31 devnetfs
  2003-04-25  9:06 ` Arjan van de Ven
  0 siblings, 1 reply; 4+ messages in thread
From: devnetfs @ 2003-04-25  6:31 UTC (permalink / raw)
  To: linux-kernel

Hello,

Will kernel modules compiled with gcc 3.2 load in kernel compiled with
gcc 2.96 (RH system)?  The RH 8.0 release notes state that 2.96
compiled modules can't be loaded on RH8.0 (as its compiled using gcc
3.2). So
does the reverse also hold true?

Either way why is this so? AFAIK gcc 3.2 has abi incompatiblities
w.r.t. C++ and not C (which the kernel+modules are written in). I did
try searching on google but could not find the exact set of
incompatibilies w.r.t C. Can somebody *please* point me to a link or a
thread.

Thanks a lot in advamce

Regards,
A.

PS: I am not subscribed to lkml. please Cc: me the replies.


__________________________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo
http://search.yahoo.com

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

* Re: compiling modules with gcc 3.2
  2003-04-25  6:31 compiling modules with gcc 3.2 devnetfs
@ 2003-04-25  9:06 ` Arjan van de Ven
  2003-04-25 10:46   ` devnetfs
  0 siblings, 1 reply; 4+ messages in thread
From: Arjan van de Ven @ 2003-04-25  9:06 UTC (permalink / raw)
  To: devnetfs; +Cc: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 751 bytes --]

On Fri, 2003-04-25 at 08:31, devnetfs wrote:
> Hello,
> 
> Will kernel modules compiled with gcc 3.2 load in kernel compiled with
> gcc 2.96 (RH system)?  The RH 8.0 release notes state that 2.96
> compiled modules can't be loaded on RH8.0 (as its compiled using gcc
> 3.2). So
> does the reverse also hold true?

yes

> Either way why is this so? AFAIK gcc 3.2 has abi incompatiblities
> w.r.t. C++ and not C (which the kernel+modules are written in).

there are some cornercase C ABI changes but nobody except DAC960 will
ever hit those. The more serious change is that the kernel contains
workarounds for older compilers (the test used is major < 3) that
changes the size of structures etc etc, and that breaks the module
stuff.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

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

* Re: compiling modules with gcc 3.2
  2003-04-25  9:06 ` Arjan van de Ven
@ 2003-04-25 10:46   ` devnetfs
  2003-04-25 10:59     ` Jakub Jelinek
  0 siblings, 1 reply; 4+ messages in thread
From: devnetfs @ 2003-04-25 10:46 UTC (permalink / raw)
  To: arjanv; +Cc: linux-kernel

--- Arjan van de Ven <arjanv@redhat.com> wrote:

Thanks for the quick reply :)

> > Either way why is this so? AFAIK gcc 3.2 has abi incompatiblities
> > w.r.t. C++ and not C (which the kernel+modules are written in).
> 
> there are some cornercase C ABI changes but nobody except DAC960 will
> ever hit those. 

what are these? i am just curious about the change as i dont
see them (probably did not search hard) documented/listed on
gcc site. C++ ABI changes have some mention on some sites, but 
NOT on C ABI. 

> The more serious change is that the kernel contains
> workarounds for older compilers (the test used is major < 3) that
> changes the size of structures etc etc, and that breaks the module
> stuff.

so does this mean that: these workarounds now fixed in gcc 3.X?
and its just that the workaround employed in kernel source (for 
gcc 2.X) is different than the way gcc 3.X fixes them and hence 
objects generated from gcc 3.X and 2.X (w.r.t kernel sources+modules)
dont mix well?

thanks
A.

__________________________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo
http://search.yahoo.com

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

* Re: compiling modules with gcc 3.2
  2003-04-25 10:46   ` devnetfs
@ 2003-04-25 10:59     ` Jakub Jelinek
  0 siblings, 0 replies; 4+ messages in thread
From: Jakub Jelinek @ 2003-04-25 10:59 UTC (permalink / raw)
  To: devnetfs; +Cc: arjanv, linux-kernel

On Fri, Apr 25, 2003 at 03:46:15AM -0700, devnetfs wrote:
> --- Arjan van de Ven <arjanv@redhat.com> wrote:
> 
> Thanks for the quick reply :)
> 
> > > Either way why is this so? AFAIK gcc 3.2 has abi incompatiblities
> > > w.r.t. C++ and not C (which the kernel+modules are written in).
> > 
> > there are some cornercase C ABI changes but nobody except DAC960 will
> > ever hit those. 
> 
> what are these? i am just curious about the change as i dont
> see them (probably did not search hard) documented/listed on
> gcc site. C++ ABI changes have some mention on some sites, but 
> NOT on C ABI. 

If I remember well, long long bitfields, oversided bitfields, etc.

> so does this mean that: these workarounds now fixed in gcc 3.X?
> and its just that the workaround employed in kernel source (for 
> gcc 2.X) is different than the way gcc 3.X fixes them and hence 
> objects generated from gcc 3.X and 2.X (w.r.t kernel sources+modules)
> dont mix well?

There are couple of places in kernel which do things like:

#if (__GNUC__ > 2)
  typedef struct { } spinlock_t;
  #define SPIN_LOCK_UNLOCKED (spinlock_t) { }
#else
  typedef struct { int gcc_is_buggy; } spinlock_t;
  #define SPIN_LOCK_UNLOCKED (spinlock_t) { 0 }
#endif

Obviously you cannot mix modules/kernels using any structure like that.

	Jakub

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

end of thread, other threads:[~2003-04-25 10:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-04-25  6:31 compiling modules with gcc 3.2 devnetfs
2003-04-25  9:06 ` Arjan van de Ven
2003-04-25 10:46   ` devnetfs
2003-04-25 10:59     ` Jakub Jelinek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).