2006-08-13 04:48:43

by Andi Kleen

[permalink] [raw]
Subject: module compiler version check still needed?


Does anybody know of any reason why we would still need the compiler version
check during module loading? AFAIK on i386 it was only needed to handle
2.95 (which got dropped) and on x86-64 it was never needed. Is there
a need on any other architecture for it?

-Andi


2006-08-13 04:59:15

by Keith Owens

[permalink] [raw]
Subject: Re: module compiler version check still needed?

Andi Kleen (on Sun, 13 Aug 2006 06:48:36 +0200) wrote:
>
>Does anybody know of any reason why we would still need the compiler version
>check during module loading? AFAIK on i386 it was only needed to handle
>2.95 (which got dropped) and on x86-64 it was never needed. Is there
>a need on any other architecture for it?

IA64 still needs the check. include/asm-ia64/spinlock.h generates
different calls to the out of line spinlock handler, depending on the
version of gcc.

2006-08-13 20:27:36

by Andi Kleen

[permalink] [raw]
Subject: Re: module compiler version check still needed?

On Sunday 13 August 2006 06:59, Keith Owens wrote:
> Andi Kleen (on Sun, 13 Aug 2006 06:48:36 +0200) wrote:
> >
> >Does anybody know of any reason why we would still need the compiler version
> >check during module loading? AFAIK on i386 it was only needed to handle
> >2.95 (which got dropped) and on x86-64 it was never needed. Is there
> >a need on any other architecture for it?
>
> IA64 still needs the check. include/asm-ia64/spinlock.h generates
> different calls to the out of line spinlock handler, depending on the
> version of gcc.

Thanks. But I guess it could be used to MODULE_ARCH_VERMAGIC for ia64 only then.
If nobody else complains I will do that.

-Andi

2006-08-13 22:04:35

by Adrian Bunk

[permalink] [raw]
Subject: Re: module compiler version check still needed?

On Sun, Aug 13, 2006 at 10:27:24PM +0200, Andi Kleen wrote:
> On Sunday 13 August 2006 06:59, Keith Owens wrote:
> > Andi Kleen (on Sun, 13 Aug 2006 06:48:36 +0200) wrote:
> > >
> > >Does anybody know of any reason why we would still need the compiler version
> > >check during module loading? AFAIK on i386 it was only needed to handle
> > >2.95 (which got dropped) and on x86-64 it was never needed. Is there
> > >a need on any other architecture for it?
> >
> > IA64 still needs the check. include/asm-ia64/spinlock.h generates
> > different calls to the out of line spinlock handler, depending on the
> > version of gcc.
>
> Thanks. But I guess it could be used to MODULE_ARCH_VERMAGIC for ia64 only then.
> If nobody else complains I will do that.

People might not complain until this is for some time in a released
kernel.

Why don't you check yourself?

grep -r __GNUC__ *
grep -r cc-version *

There are over 100 results, but it's easy to spot the few requiring a
deeper look.

> -Andi

cu
Adrian

--

Gentoo kernels are 42 times more popular than SUSE kernels among
KLive users (a service by SUSE contractor Andrea Arcangeli that
gathers data about kernels from many users worldwide).

There are three kinds of lies: Lies, Damn Lies, and Statistics.
Benjamin Disraeli

2006-08-13 22:14:59

by Matthew Wilcox

[permalink] [raw]
Subject: Re: module compiler version check still needed?

On Sun, Aug 13, 2006 at 10:27:24PM +0200, Andi Kleen wrote:
> On Sunday 13 August 2006 06:59, Keith Owens wrote:
> > IA64 still needs the check. include/asm-ia64/spinlock.h generates
> > different calls to the out of line spinlock handler, depending on the
> > version of gcc.
>
> Thanks. But I guess it could be used to MODULE_ARCH_VERMAGIC for ia64 only then.
> If nobody else complains I will do that.

Will we remember to add the check back in when we introduce new
dependencies on compiler versions?

2006-08-14 05:00:28

by Andi Kleen

[permalink] [raw]
Subject: Re: module compiler version check still needed?

On Monday 14 August 2006 00:14, Matthew Wilcox wrote:
> On Sun, Aug 13, 2006 at 10:27:24PM +0200, Andi Kleen wrote:
> > On Sunday 13 August 2006 06:59, Keith Owens wrote:
> > > IA64 still needs the check. include/asm-ia64/spinlock.h generates
> > > different calls to the out of line spinlock handler, depending on the
> > > version of gcc.
> >
> > Thanks. But I guess it could be used to MODULE_ARCH_VERMAGIC for ia64 only then.
> > If nobody else complains I will do that.
>
> Will we remember to add the check back in when we introduce new
> dependencies on compiler versions?

If something breaks it be readded. I see it only as a special
hack for some extraordinary, and hopefully these problems won't happen again.

-Andi

2006-08-14 05:38:53

by Sam Ravnborg

[permalink] [raw]
Subject: Re: module compiler version check still needed?

On Mon, Aug 14, 2006 at 06:59:49AM +0200, Andi Kleen wrote:
>
> > Will we remember to add the check back in when we introduce new
> > dependencies on compiler versions?
>
> If something breaks it be readded. I see it only as a special
> hack for some extraordinary, and hopefully these problems won't happen again.
What we should add should be some kind of cabability mask.
There is no need to require that modules are built with exactly the same
compiler as the kernel when it is only a very few compiler versions that
causes layout/ABI differences.

Sam

2006-08-14 05:45:23

by Andi Kleen

[permalink] [raw]
Subject: Re: module compiler version check still needed?

On Monday 14 August 2006 07:38, Sam Ravnborg wrote:
> On Mon, Aug 14, 2006 at 06:59:49AM +0200, Andi Kleen wrote:
> >
> > > Will we remember to add the check back in when we introduce new
> > > dependencies on compiler versions?
> >
> > If something breaks it be readded. I see it only as a special
> > hack for some extraordinary, and hopefully these problems won't happen again.
> What we should add should be some kind of cabability mask.

It would be probably overkill.

> There is no need to require that modules are built with exactly the same
> compiler as the kernel when it is only a very few compiler versions that
> causes layout/ABI differences.

On i386/x86-64 that's not the case anymore as far as I know.

-Andi

2006-08-14 09:06:20

by Arjan van de Ven

[permalink] [raw]
Subject: Re: module compiler version check still needed?

On Sun, 2006-08-13 at 06:48 +0200, Andi Kleen wrote:
> Does anybody know of any reason why we would still need the compiler version
> check during module loading? AFAIK on i386 it was only needed to handle
> 2.95 (which got dropped) and on x86-64 it was never needed. Is there
> a need on any other architecture for it?

is there any harm in doing this check? Checking this for sure rules out
MANY nasty and really hard to debug corner cases... and there shouldn't
be any valid reason for doing this ever anyway...

2006-08-14 09:20:05

by Andi Kleen

[permalink] [raw]
Subject: Re: module compiler version check still needed?

On Monday 14 August 2006 11:06, Arjan van de Ven wrote:
> On Sun, 2006-08-13 at 06:48 +0200, Andi Kleen wrote:
> > Does anybody know of any reason why we would still need the compiler version
> > check during module loading? AFAIK on i386 it was only needed to handle
> > 2.95 (which got dropped) and on x86-64 it was never needed. Is there
> > a need on any other architecture for it?
>
> is there any harm in doing this check?

Yes, it can cause lots of trouble when you try to compile external
modules on a different system with different compiler than on the
system where the kernel was compiled.

e.g. you upgrade a distribution kernel but now you can compile
modules for it because the new rpm was compiled with a newer
compiler.

Happens to me regularly.

-Andi

2006-08-14 22:11:04

by Adrian Bunk

[permalink] [raw]
Subject: Re: module compiler version check still needed?

On Mon, Aug 14, 2006 at 11:19:46AM +0200, Andi Kleen wrote:
>...
> e.g. you upgrade a distribution kernel but now you can compile
> modules for it because the new rpm was compiled with a newer
> compiler.
>
> Happens to me regularly.

Regularly means once a year?

> -Andi

cu
Adrian

--

Gentoo kernels are 42 times more popular than SUSE kernels among
KLive users (a service by SUSE contractor Andrea Arcangeli that
gathers data about kernels from many users worldwide).

There are three kinds of lies: Lies, Damn Lies, and Statistics.
Benjamin Disraeli