2000-12-22 04:45:09

by Robert B. Easter

[permalink] [raw]
Subject: recommended gcc compiler version

This is a newbie question, but what are the recommended gcc compiler versions
for compiling,

Linux 2.2.18?

Linux 2.4.0?


I'd rather use the recommended version than not and have difficult bugs.

Thanks. If there is a FAQ, kindy direct me to it, or, if this info isn't in
there specificly, perhaps a FAQ maintainer can add this stuff.

--
-------- Robert B. Easter [email protected] ---------
- CompTechNews Message Board http://www.comptechnews.com/ -
- CompTechServ Tech Services http://www.comptechserv.com/ -
---------- http://www.comptechnews.com/~reaster/ ------------


2000-12-22 06:46:26

by Matthew D. Pitts

[permalink] [raw]
Subject: Re: recommended gcc compiler version

Robert,
gcc 2.7.2.3 is the safest, but egcs 1.1.2 will work. any kernels built with
gcc 2.95.x work but can be buggy.

Matthew Pitts
[email protected]

----- Original Message -----
From: Robert B. Easter <[email protected]>
To: <[email protected]>
Sent: Thursday, December 21, 2000 11:20 PM
Subject: recommended gcc compiler version


> This is a newbie question, but what are the recommended gcc compiler
versions
> for compiling,
>
> Linux 2.2.18?
>
> Linux 2.4.0?
>
>
> I'd rather use the recommended version than not and have difficult bugs.
>
> Thanks. If there is a FAQ, kindy direct me to it, or, if this info isn't
in
> there specificly, perhaps a FAQ maintainer can add this stuff.
>
> --
> -------- Robert B. Easter [email protected] ---------
> - CompTechNews Message Board http://www.comptechnews.com/ -
> - CompTechServ Tech Services http://www.comptechserv.com/ -
> ---------- http://www.comptechnews.com/~reaster/ ------------
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to [email protected]
> Please read the FAQ at http://www.tux.org/lkml/

2000-12-22 07:31:31

by Barry K. Nathan

[permalink] [raw]
Subject: Re: recommended gcc compiler version

Robert B. Easter wrote:
> This is a newbie question, but what are the recommended gcc compiler versions
> for compiling,

This is discussed in the Documentation/Changes file, in a given kernel's
source. Brief summaries follow (which assume you're using an x86 CPU).

> Linux 2.2.18?

gcc 2.7.2.3 is safest, but egcs 1.1.2 should be safe even for
mission-critical stuff. gcc 2.95.2 seems to work for many people, but
isn't necessarily safe.

> Linux 2.4.0?

egcs 1.1.2 is the safe choice, but gcc 2.95.2 seems to work. gcc 2.7.2.3
miscompiles 2.4 more often than not, so 2.4 has a preprocessor check that
stops any attempts to compile it with 2.7.2.3.

-Barry K. Nathan <[email protected]>

2000-12-22 07:39:24

by Tim Wright

[permalink] [raw]
Subject: Re: recommended gcc compiler version

I'm sorry but this is incorrect.
The recommended compiler version is not longer the same for the 2.2 and 2.4
kernels.
>From Documentation/Changes in 2.4 (test12):
"The recommended compiler for the kernel is egcs 1.1.2 (gcc 2.91.66), and it
should be used when you need absolute stability. You may use gcc 2.95.2
instead if you wish, although it may cause problems. Later versions of gcc
have not received much testing for Linux kernel compilation, and there are
almost certainly bugs (mainly, but not exclusively, in the kernel) that
will need to be fixed in order to use these compilers. In any case, using
pgcc instead of egcs or plain gcc is just asking for trouble.

Note that gcc 2.7.2.3 is no longer a supported kernel compiler. The kernel
no longer works around bugs in gcc 2.7.2.3 and, in fact, will refuse to
be compiled with it."

For 2.2.18:
" Note that the latest compilers (pgcc, gcc 2.95) may do Bad
Things while compiling your kernel, particularly if absurd
optimizations (like -O9) are used. Caveat emptor. In general, however,
gcc-2.7.2.3 and egcs 1.1.2 are known to be stable on x86, while gcc 2.95 and
others have not been as thoroughly tested yet."

So....
egcs-1.1.2 is good for either, 2.7.2 is OK for 2.2, bad for 2.4. 2.95.2 and
later are risky. RedHat just released a bugfixed "2.96" which is an unknown
quantity AFAIK. Anybody brave enough to try it should probably post their
results.

No compiler is bug-free. In general, you will get the most reliable results
when you use what most everybody else is using, 'cos that's how the bugs get
fixed. YMMV :-)

Regards,

Tim

On Fri, Dec 22, 2000 at 01:19:07AM -0500, Matthew D. Pitts wrote:
> Robert,
> gcc 2.7.2.3 is the safest, but egcs 1.1.2 will work. any kernels built with
> gcc 2.95.x work but can be buggy.
>
> Matthew Pitts
> [email protected]
>
> ----- Original Message -----
> From: Robert B. Easter <[email protected]>
> To: <[email protected]>
> Sent: Thursday, December 21, 2000 11:20 PM
> Subject: recommended gcc compiler version
>
>
> > This is a newbie question, but what are the recommended gcc compiler
> versions
> > for compiling,
> >
> > Linux 2.2.18?
> >
> > Linux 2.4.0?
> >
> >
> > I'd rather use the recommended version than not and have difficult bugs.
> >
> > Thanks. If there is a FAQ, kindy direct me to it, or, if this info isn't
> in
> > there specificly, perhaps a FAQ maintainer can add this stuff.
> >
> > --
> > -------- Robert B. Easter [email protected] ---------
> > - CompTechNews Message Board http://www.comptechnews.com/ -
> > - CompTechServ Tech Services http://www.comptechserv.com/ -
> > ---------- http://www.comptechnews.com/~reaster/ ------------
> > -
> > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> > the body of a message to [email protected]
> > Please read the FAQ at http://www.tux.org/lkml/
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to [email protected]
> Please read the FAQ at http://www.tux.org/lkml/

--
Tim Wright - [email protected] or [email protected] or [email protected]
IBM Linux Technology Center, Beaverton, Oregon
"Nobody ever said I was charming, they said "Rimmer, you're a git!"" RD VI

2000-12-22 09:20:03

by Alan

[permalink] [raw]
Subject: Re: recommended gcc compiler version

> This is a newbie question, but what are the recommended gcc compiler versions
> for compiling,
>
> Linux 2.2.18?
> Linux 2.4.0?

For i386

2.2.18
gcc 2.7.2 or egcs-1.1.2
gcc 2.95 and current Red Hat 2.96 both seem to generate valid kernels
but are not recommended (insufficient testing)

2.4.0test
egcs-1.1.2
(gcc 2.95 miscompiles some of the long long uses)
Red Hat's 2.96 seems to generate valid kernels but don't expect
sympathy if you report a bug in one built that way

2000-12-22 11:25:29

by Rogier Wolff

[permalink] [raw]
Subject: Re: recommended gcc compiler version

Alan Cox wrote:
[ compiler for 2.4 kernels]
> Red Hat's 2.96 seems to generate valid kernels but don't expect
> sympathy if you report a bug in one built that way

No sympathy? More like "lots of sympathy": "Ahhhh. Poor soul...."

:-)
Roger.


--
** [email protected] ** http://www.BitWizard.nl/ ** +31-15-2137555 **
*-- BitWizard writes Linux device drivers for any device you may have! --*
* There are old pilots, and there are bold pilots.
* There are also old, bald pilots.

2000-12-22 12:25:07

by Anuradha Ratnaweera

[permalink] [raw]
Subject: Re: recommended gcc compiler version


On Fri, 22 Dec 2000, Alan Cox wrote:

> For i386
>
> 2.2.18
> gcc 2.7.2 or egcs-1.1.2

Just a remainder for debian users. There is a debian package gcc272 which
is said to be the "GNU C compiler's C part", for "backword compatibility
purposes". I recompiled my kernel after an

apt-get install gcc272

and after setting

HOSTGCC = gcc272

in kernel source tree Makerile.


Anuradha

2000-12-22 18:41:47

by Andreas Dilger

[permalink] [raw]
Subject: Re: recommended gcc compiler version

Barry writes:
> > Linux 2.2.18?
>
> gcc 2.7.2.3 is safest, but egcs 1.1.2 should be safe even for
> mission-critical stuff. gcc 2.95.2 seems to work for many people, but
> isn't necessarily safe.

Speaking of this - I had problems with a gcc 2.95.2 compiled 2.2.18+IDE patch,
yet the same kernel compiled with egcs is OK. On one system the 2.95.2
kernel complained at partition checking time, but seemed to work OK, and
on an SMP box, the kernel would just panic at partition checking time.

If anyone is interested in looking at this (gcc folks or whatever), I
have KDB in that kernel and can send you a stack trace at the panic.
Otherwise, I'll just stick with egcs.

Cheers, Andreas
--
Andreas Dilger \ "If a man ate a pound of pasta and a pound of antipasto,
\ would they cancel out, leaving him still hungry?"
http://www-mddsp.enel.ucalgary.ca/People/adilger/ -- Dogbert

2000-12-22 19:49:36

by Linus Torvalds

[permalink] [raw]
Subject: Re: recommended gcc compiler version

In article <[email protected]>,
Tim Wright <[email protected]> wrote:
>
>So....
>egcs-1.1.2 is good for either, 2.7.2 is OK for 2.2, bad for 2.4. 2.95.2 and
>later are risky. RedHat just released a bugfixed "2.96" which is an unknown
>quantity AFAIK. Anybody brave enough to try it should probably post their
>results.

Note that despite my public comments about it beign a bad idea to ship
extremely untested compilers in a major release, I actually think that
it would be wonderful to have people who are ready to face the
consequences to try the new 2.96.

It's not been all that widely tested, but if you kno a bit about what
you're doing (or want to learn), gcc-2.96 _does_ potentially create
better code, and if nobody is willing to test it, any potential bugs (be
they in the kernel sources and triggered by a smarter compiler, or in
the compiler itself) won't be found.

So please do try it out, but please mention the fact if you end up
having to report a bug (it won't make your bug-report be ignored, don't
ever worry about something like that. But i would be good to have an
older compiler handy to correlate the bug with the compiler for sure).

In fact, I'd love to hear about experiences even with the CVS snapshots.
I just don't like them showing up in distributions ;)

Linus

2000-12-22 19:56:47

by Linus Torvalds

[permalink] [raw]
Subject: Re: recommended gcc compiler version

In article <[email protected]>,
Alan Cox <[email protected]> wrote:
>
>2.4.0test
> egcs-1.1.2
> (gcc 2.95 miscompiles some of the long long uses)
> Red Hat's 2.96 seems to generate valid kernels but don't expect
> sympathy if you report a bug in one built that way

Now, now, I'd love to se reports of expecially the new updated compiler.
I've not actually seen a single report of problems for the kernel even
with the old 2.96, it's just that I've seen too many user-space problems
that I would be hesitant to use it for the kernel.

Despite my dislike of releasing snaopshot compilers, I'd _much_ rather
see Red Hat just dropping their "kgcc" thing, and in order to do that
people do ned to test with the new compiler.

I just want people to mention the fact, so that I can correlate any
bug-reports with a compiler version. Just in case. It can be important
(and not just because of compiler bugs, but due to real kernel bugs that
just were hidden by pure luck with other compilers). And it helps a LOT
if you have another compiler available to compare with.

Linus

2000-12-22 20:42:49

by Andi Kleen

[permalink] [raw]
Subject: Re: recommended gcc compiler version

On Fri, Dec 22, 2000 at 11:25:14AM -0800, Linus Torvalds wrote:
> In article <[email protected]>,
> Alan Cox <[email protected]> wrote:
> >
> >2.4.0test
> > egcs-1.1.2
> > (gcc 2.95 miscompiles some of the long long uses)
> > Red Hat's 2.96 seems to generate valid kernels but don't expect
> > sympathy if you report a bug in one built that way
>
> Now, now, I'd love to se reports of expecially the new updated compiler.
> I've not actually seen a single report of problems for the kernel even
> with the old 2.96, it's just that I've seen too many user-space problems
> that I would be hesitant to use it for the kernel.

I'm working with a 2.97 based compiler for x86-64. There are a few
miscompilations, but they're probably more attributable to the immature state
of the x86-64 port than the generic compiler. The first thing
that is noticeable are lots of warnings now spewed out by the compiler.
Appended patch fixes the __setup related at least.
Other common ones are token after #endif (mostly #ifdef X .. #endif X)
and semicolon/label at the end of switch.


-Andi


Index: include/linux/init.h
===================================================================
RCS file: /cvs/linux/include/linux/init.h,v
retrieving revision 1.23
diff -u -u -r1.23 init.h
--- include/linux/init.h 2000/11/15 00:13:57 1.23
+++ include/linux/init.h 2000/12/22 20:38:54
@@ -65,7 +65,7 @@

#define __setup(str, fn) \
static char __setup_str_##fn[] __initdata = str; \
- static struct kernel_param __setup_##fn __initsetup = { __setup_str_##fn, fn }
+ static struct kernel_param __setup_##fn __attribute__((unused)) __initsetup = { __setup_str_##fn, fn }

#endif /* __ASSEMBLY__ */

2000-12-23 16:26:00

by Matthew Vanecek

[permalink] [raw]
Subject: Re: recommended gcc compiler version

Linus Torvalds wrote:
>
> In article <[email protected]>,
> Tim Wright <[email protected]> wrote:
> >
> >So....
> >egcs-1.1.2 is good for either, 2.7.2 is OK for 2.2, bad for 2.4. 2.95.2 and
> >later are risky. RedHat just released a bugfixed "2.96" which is an unknown
> >quantity AFAIK. Anybody brave enough to try it should probably post their
> >results.
>
> Note that despite my public comments about it beign a bad idea to ship
> extremely untested compilers in a major release, I actually think that
> it would be wonderful to have people who are ready to face the
> consequences to try the new 2.96.
>
> It's not been all that widely tested, but if you kno a bit about what
> you're doing (or want to learn), gcc-2.96 _does_ potentially create
> better code, and if nobody is willing to test it, any potential bugs (be
> they in the kernel sources and triggered by a smarter compiler, or in
> the compiler itself) won't be found.
>
> So please do try it out, but please mention the fact if you end up
> having to report a bug (it won't make your bug-report be ignored, don't
> ever worry about something like that. But i would be good to have an
> older compiler handy to correlate the bug with the compiler for sure).
>
> In fact, I'd love to hear about experiences even with the CVS snapshots.
> I just don't like them showing up in distributions ;)
>
> Linus

I've been using 2.96 for the last couple of kernel compiles, and it's
been working fine (pasting warnings and all). This is the 2nd-to-latest
update from RH 7.0. The only issue I have is the very occasional Signal
11--but I had those with kgcc, as well, so I don't reckon those are
compiler-related.

Right now, I have test12. This is on my desktop machine, doing normal
desktop stuff (finances, StarOffice, Netscape, Java development, etc).
Seems to be working well, and test12 runs *much* faster than previous
kernels...
--
Matthew Vanecek
perl -e 'print
$i=pack(c5,(41*2),sqrt(7056),(unpack(c,H)-2),oct(115),10);'
********************************************************************************
For 93 million miles, there is nothing between the sun and my shadow
except me.
I'm always getting in the way of something...

2000-12-24 14:10:12

by kaih

[permalink] [raw]
Subject: Re: recommended gcc compiler version

[email protected] (Anuradha Ratnaweera) wrote on 22.12.00 in <[email protected]>:

> On Fri, 22 Dec 2000, Alan Cox wrote:
>
> > For i386
> >
> > 2.2.18
> > gcc 2.7.2 or egcs-1.1.2
>
> Just a remainder for debian users. There is a debian package gcc272 which
> is said to be the "GNU C compiler's C part", for "backword compatibility
> purposes". I recompiled my kernel after an
>
> apt-get install gcc272
>
> and after setting
>
> HOSTGCC = gcc272
>
> in kernel source tree Makerile.

I recently compiled 2.2.18 and noticed that make-kpkg (from kernel-package
- don't compile kernels on Debian without it!) did that automatically.

Incidentally, I really like the Flavours patch.


MfG Kai

2000-12-26 08:37:38

by Anuradha Ratnaweera

[permalink] [raw]
Subject: Re: recommended gcc compiler version



On 24 Dec 2000, Kai Henningsen wrote:

> [email protected] (Anuradha Ratnaweera) wrote on 22.12.00 in <[email protected]>:
>
> > On Fri, 22 Dec 2000, Alan Cox wrote:
> >
> > > For i386
> > >
> > > 2.2.18
> > > gcc 2.7.2 or egcs-1.1.2
> >
> > Just a remainder for debian users. There is a debian package gcc272 which
> > is said to be the "GNU C compiler's C part", for "backword compatibility
> > purposes". I recompiled my kernel after an
> >
> > apt-get install gcc272
> >
> > and after setting
> >
> > HOSTGCC = gcc272
> >
> > in kernel source tree Makerile.
>
> I recently compiled 2.2.18 and noticed that make-kpkg (from kernel-package
> - don't compile kernels on Debian without it!) did that automatically.

That is a very good thing. It would have been even better if the
dependencies of the kernel-package does include gcc272 rather than giving
a "command not found" error when make-kpkg is run without gcc272
installed. It might leave a new user clueless.


Anuradha