Linux: Supporting Older GCC Releases

Submitted by Jeremy
on August 22, 2007 - 2:03am

A recent bug report led to a discussion about potentially dropping support for pre-4.0 versions of GCC. Adrian Bunk noted, "currently we support 6 different stable gcc release series, and it might be the right time to consider dropping support for the older ones. Are there any architectures still requiring a gcc < 4.0 ?" Russell King noted that on some architectures GCC 3.x is still preferable to the newer 4.x branch, "I want to keep support for gcc 3.4.3 for ARM for the foreseeable future. From my point of view, gcc 4 compilers have been something of a development thing as far as the ARM architecture goes. Also, gcc 3.4.3 is faster and significantly less noisy than gcc 4."

When it was asked how many kernel developers use older version of GCC, Linus Torvalds explained that it really doesn't matter, "it's NOT about 'kernel developers'. It's about random people testing kernels. If we make it harder for people to test kernels, we're going to lose. So no, I vote for *not* cutting off old gcc versions unless it's absolutely fatal."


From:	Adrian Bunk [email blocked]
Subject: RFC: drop support for gcc < 4.0
Date:	Tue, 21 Aug 2007 19:35:50 +0200

On Tue, Aug 21, 2007 at 09:31:03AM -0700, Randy Dunlap wrote:
> On Tue, 21 Aug 2007 15:20:38 +0200 Jarek Poplawski wrote:
> 
> > Here are some more of, probably well-known, warnings with attached
> > testing-only .config.
> >...
> > drivers/pci/msi.c:686: warning: weak declaration of `arch_msi_check_device' after first use results in unspecified behavior
> > drivers/pci/msi.c:698: warning: weak declaration of `arch_setup_msi_irqs' after first use results in unspecified behavior
> > drivers/pci/msi.c:718: warning: weak declaration of `arch_teardown_msi_irqs' after first use results in unspecified behavior
> >...
> 
> What gcc version?  I don't get the arch_ warnings in drivers/pci/msi.c.

Obviously a gcc <= 3.4 [1], and therefore no unit-at-a-time.

You can reproduce it with a more recent gcc when adding 
-fno-unit-at-a-time to the CFLAGS.

And it's becoming a real maintainance problem that not only this problem 
but also other problems like some section mismatches [2] are only 
present without unit-at-a-time.

Currently we support 6 different stable gcc release series, and it might 
be the right time to consider dropping support for the older ones.

Are there any architectures still requiring a gcc < 4.0 ?

> ~Randy

cu
Adrian

[1] unit-at-a-time was added in gcc 3.4, but on gcc 3.4 we disable it on
    i386 due to stack usage problems
[2] example: static __init function with exactly one caller, and this
             caller is non-__init

-- 

       "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



From: Russell King [email blocked] Subject: Re: RFC: drop support for gcc < 4.0 Date: Tue, 21 Aug 2007 18:54:53 +0100 On Tue, Aug 21, 2007 at 07:35:50PM +0200, Adrian Bunk wrote: > On Tue, Aug 21, 2007 at 09:31:03AM -0700, Randy Dunlap wrote: > > On Tue, 21 Aug 2007 15:20:38 +0200 Jarek Poplawski wrote: > > > > > Here are some more of, probably well-known, warnings with attached > > > testing-only .config. > > >... > > > drivers/pci/msi.c:686: warning: weak declaration of `arch_msi_check_device' after first use results in unspecified behavior > > > drivers/pci/msi.c:698: warning: weak declaration of `arch_setup_msi_irqs' after first use results in unspecified behavior > > > drivers/pci/msi.c:718: warning: weak declaration of `arch_teardown_msi_irqs' after first use results in unspecified behavior > > >... > > > > What gcc version? I don't get the arch_ warnings in drivers/pci/msi.c. > > Obviously a gcc <= 3.4 [1], and therefore no unit-at-a-time. > > You can reproduce it with a more recent gcc when adding > -fno-unit-at-a-time to the CFLAGS. > > And it's becoming a real maintainance problem that not only this problem > but also other problems like some section mismatches [2] are only > present without unit-at-a-time. > > Currently we support 6 different stable gcc release series, and it might > be the right time to consider dropping support for the older ones. > > Are there any architectures still requiring a gcc < 4.0 ? I want to keep support for gcc 3.4.3 for ARM for the forseeable future. From my point of view, gcc 4 compilers have been something of a development thing as far as the ARM architecture goes. Also, gcc 3.4.3 is faster and significantly less noisy than gcc 4. -- Russell King Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/ maintainer of:
From: Kyle McMartin [email blocked] Subject: Re: RFC: drop support for gcc < 4.0 Date: Tue, 21 Aug 2007 14:14:20 -0400 On Tue, Aug 21, 2007 at 06:54:53PM +0100, Russell King wrote: > I want to keep support for gcc 3.4.3 for ARM for the forseeable future. > From my point of view, gcc 4 compilers have been something of a development > thing as far as the ARM architecture goes. Also, gcc 3.4.3 is faster and > significantly less noisy than gcc 4. > +1, similar reasons, for parisc. Not that gcc4 doesn't work, but there's some cases where gcc 3.4 still generates better code... Regards, Kyle M.
From: Andi Kleen [email blocked] To: Adrian Bunk [email blocked] Subject: Re: RFC: drop support for gcc < 4.0 Date: Tue, 21 Aug 2007 21:19:59 +0200 On Tue, Aug 21, 2007 at 07:35:50PM +0200, Adrian Bunk wrote: > Obviously a gcc <= 3.4 [1], and therefore no unit-at-a-time. Actually there are widely used 3.3 variants that support unit-at-a-time (e.g. 3.3-hammer which was shipped by several distributions for some time) There are still a lot of systems around which use gcc 3.3 (less so with 3.4). Unless there's a major bug that is hard to work around I would prefer to keep it supported. Bogus warnings should be relatively harmless. > And it's becoming a real maintainance problem that not only this problem > but also other problems like some section mismatches [2] are only > present without unit-at-a-time. The unit-at-a-time output order is not defined, so even if it works with the current compiler a compiler change might still trigger that problem. So it would be better to fix those anyways. -Andi
From: Adrian Bunk [email blocked] To: Andi Kleen [email blocked] Subject: Re: RFC: drop support for gcc < 4.0 Date: Tue, 21 Aug 2007 21:54:33 +0200 On Tue, Aug 21, 2007 at 09:19:59PM +0200, Andi Kleen wrote: > On Tue, Aug 21, 2007 at 07:35:50PM +0200, Adrian Bunk wrote: > > Obviously a gcc <= 3.4 [1], and therefore no unit-at-a-time. > > Actually there are widely used 3.3 variants that support unit-at-a-time > (e.g. 3.3-hammer which was shipped by several distributions for some time) > > There are still a lot of systems around which use gcc 3.3 (less so with > 3.4). Unless there's a major bug that is hard to work around I would > prefer to keep it supported. > > Bogus warnings should be relatively harmless. How many kernel developers use such old gcc versions? And how many people notice the valid modpost warnings that can indicate a runtime Oops? > > And it's becoming a real maintainance problem that not only this problem > > but also other problems like some section mismatches [2] are only > > present without unit-at-a-time. > > The unit-at-a-time output order is not defined, so even if it works > with the current compiler a compiler change might still trigger > that problem. So it would be better to fix those anyways. The example [2] from my email is guaranteed to not be a problem with unit-at-a-time (as long as unit-at-a-time implies inline-functions-called-once - and that's although theoretically possible quite unlikely to change in practice). This example is for a bug that should be fixed, but my point is the maintainability, IOW: issues with older compilers might not be discovered and fixed before they go into a stable kernel. We currently support 6 different stable gcc release series plus heavily modified vendor branches like 3.3-hammer. We can discuss whether it is now already the right time, and where to make the cut, but medium-term we must reduce the number of supported compilers. > -Andi cu Adrian [2] example: static __init function with exactly one caller, and this caller is non-__init -- "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
From: Matthew Wilcox [email blocked] To: Adrian Bunk [email blocked] Subject: Re: [RFC][PATCH] introduce TASK_SIZE_OF() for all arches Date: Tue, 21 Aug 2007 14:07:11 -0600 On Tue, Aug 21, 2007 at 09:54:33PM +0200, Adrian Bunk wrote: > We currently support 6 different stable gcc release series plus heavily > modified vendor branches like 3.3-hammer. We can discuss whether it is > now already the right time, and where to make the cut, but medium-term > we must reduce the number of supported compilers. I don't think that's feasible. We're dealing with a situation where: - GCC aim to release a new compiler series every 6 months. Fortunately, they don't achieve this goal, but they do release every 12 months or thereabouts [1]. - Enterprise distros are supported for seven years - We still care about people being able to compile kernels on enterprise distros that are still supported by their vendor. Yes, it causes us some pain to support all these different compilers, but it's not *that* big a pain. [1] Release dates, according to the GCC website 2007-05-17 4.2.0 (14 months) 2006-02-28 4.1.0 (10 months) 2005-04-20 4.0.0 (12 months) 2004-04-20 3.4.0 (11 months) 2003-05-20 3.3 (12 months, ignoring gcc 3.2 which was really 3.1.2) 2002-05-15 3.1 (11 months) 2001-06-18 3.0 -- "Bill, look, we understand that you're interested in selling us this operating system, but compare it to ours. We can't possibly take such a retrograde step."
From: Linus Torvalds [email blocked] To: Adrian Bunk [email blocked] Subject: Re: RFC: drop support for gcc < 4.0 Date: Tue, 21 Aug 2007 13:08:25 -0700 (PDT) On Tue, 21 Aug 2007, Adrian Bunk wrote: > > > > Bogus warnings should be relatively harmless. > > How many kernel developers use such old gcc versions? It's NOT about "kernel developers". It's about random people testing kernels. If we make it harder for people to test kernels, we're going to lose. So no, I vote for *not* cutting off old gcc versions unless it's absolutely fatal. Linus
From: Adrian Bunk [email blocked] To: Linus Torvalds [email blocked] Subject: Re: RFC: drop support for gcc < 4.0 Date: Tue, 21 Aug 2007 22:21:13 +0200 On Tue, Aug 21, 2007 at 01:08:25PM -0700, Linus Torvalds wrote: > > > On Tue, 21 Aug 2007, Adrian Bunk wrote: > > > > > > Bogus warnings should be relatively harmless. > > > > How many kernel developers use such old gcc versions? > > It's NOT about "kernel developers". > > It's about random people testing kernels. > > If we make it harder for people to test kernels, we're going to lose. So > no, I vote for *not* cutting off old gcc versions unless it's absolutely > fatal. How many people e.g. test -rc kernels compiled with gcc 3.2? > Linus 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
From: Linus Torvalds [email blocked] To: Adrian Bunk [email blocked] Subject: Re: RFC: drop support for gcc < 4.0 Date: Tue, 21 Aug 2007 13:32:50 -0700 (PDT) On Tue, 21 Aug 2007, Adrian Bunk wrote: > > How many people e.g. test -rc kernels compiled with gcc 3.2? How could anybody know? Linus
From: Segher Boessenkool [email blocked] To: Adrian Bunk [email blocked] Subject: Re: RFC: drop support for gcc < 4.0 Date: Tue, 21 Aug 2007 22:49:49 +0200 > How many people e.g. test -rc kernels compiled with gcc 3.2? Why would that matter? It either works or not. If it doesn't work, it can either be fixed, or support for that old compiler version can be removed. The only other policy than "only remove support if things are badly broken" would be "only support what the GCC team supports", which would be >= 4.1 now; and there are very good arguments for supporting more than that with the Linux kernel. Segher
From: Adrian Bunk [email blocked] To: Segher Boessenkool [email blocked] Subject: Re: RFC: drop support for gcc < 4.0 Date: Tue, 21 Aug 2007 23:21:29 +0200 On Tue, Aug 21, 2007 at 10:49:49PM +0200, Segher Boessenkool wrote: >> How many people e.g. test -rc kernels compiled with gcc 3.2? > > Why would that matter? It either works or not. If it doesn't > work, it can either be fixed, or support for that old compiler > version can be removed. One bug report "kernel doesn't work / crash / ... when compiled with gcc 3.2, but works when compiled with gcc 4.2" will most likely be lost in the big pile of unhandled bugs, not cause the removal of gcc 3.2 support... > The only other policy than "only remove support if things are > badly broken" would be "only support what the GCC team supports", > which would be >= 4.1 now; and there are very good arguments for > supporting more than that with the Linux kernel. No, it's not about bugs in gcc, it's about kernel+gcc combinations that are mostly untested but officially supported. E.g. how many kernel developers use kernels compiled without unit-at-a-time? And unit-at-a-time does paper over some bugs, e.g. at about half a dozen section mismatch bugs I've fixed recently are not present with it. But as the discussions have shown gcc 4.0 is currently too high for making a cut, and it is not yet the right time for raising the minimum required gcc version. > Segher 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
From: James Bottomley [email blocked] Subject: Re: RFC: drop support for gcc < 4.0 Date: Tue, 21 Aug 2007 16:49:38 -0500 On Tue, 2007-08-21 at 23:21 +0200, Adrian Bunk wrote: > On Tue, Aug 21, 2007 at 10:49:49PM +0200, Segher Boessenkool wrote: > >> How many people e.g. test -rc kernels compiled with gcc 3.2? > > > > Why would that matter? It either works or not. If it doesn't > > work, it can either be fixed, or support for that old compiler > > version can be removed. > > One bug report "kernel doesn't work / crash / ... when compiled with > gcc 3.2, but works when compiled with gcc 4.2" will most likely be lost > in the big pile of unhandled bugs, not cause the removal of gcc 3.2 > support... What's the bugzilla or pointer to this report please? Those of us who use gcc-3 as the default kernel compiler will take it seriously (if it looks to have an impact to our kernel builds) otherwise we can tell you it's unreproducible/not a problem etc. James
From: Adrian Bunk [email blocked] Subject: Re: RFC: drop support for gcc < 4.0 Date: Wed, 22 Aug 2007 00:09:52 +0200 On Tue, Aug 21, 2007 at 04:49:38PM -0500, James Bottomley wrote: > On Tue, 2007-08-21 at 23:21 +0200, Adrian Bunk wrote: > > On Tue, Aug 21, 2007 at 10:49:49PM +0200, Segher Boessenkool wrote: > > >> How many people e.g. test -rc kernels compiled with gcc 3.2? > > > > > > Why would that matter? It either works or not. If it doesn't > > > work, it can either be fixed, or support for that old compiler > > > version can be removed. > > > > One bug report "kernel doesn't work / crash / ... when compiled with > > gcc 3.2, but works when compiled with gcc 4.2" will most likely be lost > > in the big pile of unhandled bugs, not cause the removal of gcc 3.2 > > support... > > What's the bugzilla or pointer to this report please? Those of us who > use gcc-3 as the default kernel compiler will take it seriously (if it > looks to have an impact to our kernel builds) otherwise we can tell you > it's unreproducible/not a problem etc. This was an example in response to Segher's point we would remove support for a gcc version in such a case. I remember we had such issues, but I don't find any pointer to a specific one at the moment. I'll keep you informed when bug reports come in that only occur with older gcc versions and that aren't easily fixable. > James 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

Related Links:

Interesting

Fred Flinta (not verified)
on
August 22, 2007 - 2:44am

Interesting topic of discussion.
But perhaps some day, it must dump old gcc 3.x to make it easier to maintain?
Or to drop gcc 3.x to get rid of legacy stuff...

Please don't cut any - unless absolute necessary

Anonymous Coward (not verified)
on
August 22, 2007 - 7:21am

There is *ALOT* of different hardware out there.
In particular *ALOT* of different distributions combinations.

GCC2 still works under ANCIENT hardware.
GCC3 indeed compiles better than GCC4 (by now).
In fact SOME still compile better w/GCC2.

Dealing w/3 or 4 versions of a compiler in a machine is already confuse enough. 2 versions is ok for testing; and this keeps old, curr and new stuff almost ALL happy.

Almost all GCC3 versions (w/their known bugs) are fine enough. GCC4 is not that simple YET.

Just opinion.

Preserving as much as possible of obsolete hardware is a KEY point in the game. It is not wise assume that a large number of folks can or are willing to dismiss their investments in hardware.

Thank you very much for your att.

Please provide one example

Anonymous (not verified)
on
August 22, 2007 - 10:25am

Please provide one example of a computer that can run GCC2 but is incapable of running GCC3.

one example

Anonny-mouse (not verified)
on
August 22, 2007 - 4:05pm

This doesn't apply to Linux but here is an example:

Symbian OS phones, pre version 9 (i.e. v6, v7.0s, v8).

There are millions of them still in use, particularly in Japan.

New apps written for these need a version of GCC 2.92 because the C++ ABI changed in GCC v3.

And this way it's for sure

Anonymous (not verified)
on
August 22, 2007 - 8:03am

And this way it's for sure that 4.0 don't get any better.

GCC4 inevitability

on
August 22, 2007 - 10:59pm

That's a bit of an oversimplification. GCC4 will take time to mature just as GCC3 did, and it will eventually get to the point where there's enough saturation and enough of its features make it in to the kernel that the older compilers are no longer capable of building the kernel. The same thing happened in the switch from GCC2 to GCC3, there are always people that are in a hurry and forget about sustaining the existing user and tool base. GCC4 is the only way forward, and even the people hanging on to GCC3 now will slowly start adopting it in time, all we can do is try to make the transition as smooth as possible, and in another couple years, there won't be any reason for anyone to be on GCC3.

Nah, gcc4 is a lot more

Anonymous (not verified)
on
August 23, 2007 - 4:41pm

Nah, gcc4 is a lot more complex than gcc3 was, and gcc3 is well tested and mature enough to keep carrying it.

Its too early to drop it. Give things time to maturize.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.