Re: WARNING: GCC 2.9.5 & Linux

Matthew Vanecek (mev0003@unt.edu)
Sun, 01 Aug 1999 02:16:57 -0500


Jordan Mendelson wrote:
> Building Linux kernels
>
> The linux kernel violates certain aliasing rules specified in the ANSI/ISO
> standard. Starting with GCC 2.95, the gcc optimizer by default relies on these
> rules to produce more efficient code and thus will produce malfunctioning
> kernels.

Will this problem be fixed with the Linux kernel to bring it into
(closer) compliance with ANSI/ISO standards? IMHO, it can only be a
good thing to have code which is (close to) 100% compliant with
recognized and widely used standards.

Which sections of code are affected by this?

> To work around this
> problem, the flag -fno-strict-aliasing must be added to the CFLAGS variable in
> the main kernel Makefile.
>

That shouldn't be too hard to do. ;) But, it's just a workaround, isn't
it? See above question...

> If you try to build a 2.0.x kernel for Intel machines with any compiler other
> than GCC 2.7.2, then you are on your own. The 2.0.x kernels are to be built only
> with gcc 2.7.2. They use certain asm constructs which are incorrect, but (by
> accident) happen to work
> with gcc 2.7.2. If you insist on building 2.0.x kernels with egcs, you may be
> interested in this patch which fixes some of the asm problems. You will also
> want to change asm constructs to avoid clobbering their input operands.
>

I'm not sure exactly what the problem is here. The last I heard, the
"approved" compiler for 2.0.x was 2.7.2.3. Which is strange, in my
mind. I started using 2.8.1 when it first appeared, and had absolutely
no problems with kernel compiles, except for a problem with X with >
2.0.35, which a patch fixed (said patch was never included in the kernel
for some strange reason, although it was well-tested and stable, and
needed). Later, when I got around to actually installing RH 5.1, there
was egcs. Never had a problem there, either. All my kernels were stock,
too. Am I just an anomaly?

IMHO, based on what little I actually know, it would be a very good idea
to make the kernel code as ANSI compliant as possible (irrespective of
what gcc does). This makes it more practical to compile the kernel with
other than gcc, supposing one wanted to...and used an ANSI-compliant
compiler.

-- 
Matthew Vanecek
Course of Study: http://www.unt.edu/bcis
Visit my Website at http://people.unt.edu/~mev0003
For answers type: 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...

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/