Re: Possible GCC contamination of Linux

Richard B. Johnson (root@chaos.analogic.com)
Tue, 21 Sep 1999 22:16:56 -0400 (EDT)


On Tue, 21 Sep 1999, Kurt Garloff wrote:

> On Mon, Sep 20, 1999 at 02:43:07PM -0400, Richard B. Johnson wrote:
> > I compiled with -fno-builtins, in addition to what you advise, and found
> > that abs() was an indefined symbol. I added an abs() macro to
> > ../linux/include/stddef.h, i.e.,
> >
> > #define abs(a) (((a)>=0)?(a):-(a))
> >
> > And included this header in ../linux/arch/i386/kernel/timer.c, and
> > ../linux/fs/open.c, where it was being used.
> >
> > The result is that I can now boot the '486 from a kernel built on
> > my 686.
> >
> > I do not know what header should really contain this macro so I did
> > not make a patch. I note that other macros like min() and max() are
> > defined for specific devices (wanpipe.h) and probably should be
> > moved to a common header file.
>
> While discussing the min() max() issues with DaveM, I'd suggest you prepare
> a patch which adds -fno-builtins to the Makefile and makes the abs() work.
> stddef.h is fine, IMHO.
>
> I see no reasons why it should not be accepted.
>
> Wait: What about the speed of builtin memcpy and the routines provided by
> the kernel? I think I remember a discussion about his. Anybody?
>
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.

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/