WARNING: GCC 2.9.5 & Linux

Jordan Mendelson (jordy@wserv.com)
Sat, 31 Jul 1999 04:36:59 -0400


This is just a notification just in case people start upgrading to GCC 2.95 and
try compiling kernel sources which have not been modified to work correctly with
the new Egcs snapshots or GCC release.

Type based alias analysis is enabled by default. Note this feature will expose
bugs in the Linux kernel. Please refer to the FAQ for additional information on
this issue.

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

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.

If you installed a recent binutils/gas snapshot on your GNU/Linux system, you
may not be able to build the kernel because objdump does not understand the "-k"
switch. The solution for this problem is to remove /usr/bin/encaps. (This is an
obsolete
program that was part of older binutils distributions; the Linux kernel's
Makefile looks for this program to decide if you have an old or a new binutils.
Problems occur if you installed a new binutils but haven't removed encaps,
because the Makefile thinks you have the old one.)

Finally, you may get errors with the X driver of the form

_X11TransSocketUNIXConnect: Can't connect: errno = 111

This is a kernel bug. The function sys_iopl in arch/i386/kernel/ioport.c does an
illegal hack which used to work but is now broken since GCC optimizes more
aggressively . The newer 2.1.x kernels already have a fix which should also work
in 2.0.32.

Jordan

--
Jordan Mendelson     : http://jordy.wserv.com
Web Services, Inc.   : http://www.wserv.com

- 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/