Re: compiling modules with gcc 3.2

Jakub Jelinek (jakub@redhat.com)
Fri, 25 Apr 2003 06:59:26 -0400


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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/