Messages in this thread | | | Date | Wed, 22 Sep 1999 08:57:54 -0400 (EDT) | From | "Richard B. Johnson" <> | Subject | Re: Possible GCC contamination of Linux |
| |
On Wed, 22 Sep 1999, Andrea Arcangeli wrote:
> On Tue, 21 Sep 1999, Richard B. Johnson wrote: > > >memcpy() and other routines that can be optimized for certain CPUs are > >in the architecture-specific directories. The only built-in being used > >that I found was abs(). > > > >I'll wait for the next clean Linux release and submit a patch. > > IMHO there's nothing to change into the kernel. > > I don't care at all how my gcc is been compiled for, the gcc output _must_ > be the same for all GCC of such same version careless about which > optimizations are been used to compile gcc itself. The makefiles must > ensure that the libgcc is been compiled for i386 and the gcc build process > may also create a different libgcc.a for each different architecture > supported by gcc and then link the right one statically into the binary in > function of the flag specifyed to the gcc executable. > > The output of gcc must be the same even if I'm cross compiling the kernel > for i386 on an Alpha. If I choose -march=386 and some 686 assembler goes > into the binary then gcc is definitly buggy and must be fixed. >
Of course you are correct. However, all compilers will always have bugs. gcc-2.x.x.x is already obsolete. Nobody is fixing it. Now there's egs.x.x.x, --many bugs --there is work being done to clean that up.
The simple proposed patch is to add -fno-builtin on the gcc command line. This prevents a gcc bug from contaminating the kernel (or whatever it's doing). However, there are two known files in the kernel that use the (previously) built-in abs(). This should be implemented as a macro in some header file. That header file should be "included" in source that use abs().
In the case of the 'C' compiler, any that is built on the system, you build the compiler using the previous compiler, after all you haven't built the new one yet. It generates its new libgcc, using the previous compiler.... If at all possible, I don't think you want this linked into the kernel. The kernel source should generate all the code for the kernel.
Cheers, Dick Johnson **** FILE SYSTEM WAS MODIFIED **** Penguin : Linux version 2.3.13 on an i686 machine (400.59 BogoMips). Warning : It's hard to remain at the trailing edge of technology.
- 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/
| |