Skip to contentSkip to conversation

compiling modules with gcc 3.2

DISCUSSION devnetfs 3 participants 4 messages Apr 25, 2003

lore
Share & tools
lore

devnetfs

author
#0 lore raw

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

#1 lore raw
Quoted 7 lines · devnetfs

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

Quoted 2 lines

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.

author
#2 lore raw

--- Arjan van de Ven <[email protected]> wrote:

Thanks for the quick reply :)

Quoted 5 lines
Quoted 2 lines

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.

Quoted 4 lines

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

#3 lore raw
Quoted 7 lines · devnetfs

--- Arjan van de Ven <[email protected]> wrote:

Thanks for the quick reply :)

Quoted 3 lines
Quoted 2 lines

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).

Quoted 7 lines
Quoted 2 lines

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.

Quoted 5 lines

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