Re: uname ?

From: Erik Mouw (J.A.K.Mouw@ITS.TUDelft.NL)
Date: Wed Apr 18 2001 - 14:58:04 EST


On Wed, Apr 18, 2001 at 07:56:25PM +0200, Dragan Milenkovic wrote:
> <rpm-related>
> Few days ago, I found an incredibly usable option in latest gcc versions.
> gcc -march=k6 -mcpu=k6

That -mcpu flag is not necessary. From the gcc info files:

`-march=CPU TYPE'
     Generate instructions for the machine type CPU TYPE. The choices
     for CPU TYPE are the same as for `-mcpu'. Moreover, specifying
     `-march=CPU TYPE' implies `-mcpu=CPU TYPE'.

> I started rebuilding SRPMS with these as optflags, just to find out that
> some packages don't use optflags, but use -march=`uname -m`.

Which breaks very nice if you want to cross compile packages:

  erik@arthur:/tmp> arm-linux-gcc -march=`uname -m` -c foo.c
  cc1: bad value (i686) for -march= switch

> So ...
> </rpm-related>
>
> What about uname -m and non-Intel processors? Is there going to be
> a change? I hope we all agree that K6 is not i586 or i686.
> I vote for breaking compatibility!

You want to fix the kernel when gcc is not even consistent across its
targets? Have a look at the gcc info files: the -march= flag for ARM
targets behaves completely different from its ix86 counterpart. And the
gcc Sparc target doesn't even recognise an -march= flag.

Erik

-- 
J.A.K. (Erik) Mouw, Information and Communication Theory Group, Department
of Electrical Engineering, Faculty of Information Technology and Systems,
Delft University of Technology, PO BOX 5031,  2600 GA Delft, The Netherlands
Phone: +31-15-2783635  Fax: +31-15-2781843  Email: J.A.K.Mouw@its.tudelft.nl
WWW: http://www-ict.its.tudelft.nl/~erik/
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon Apr 23 2001 - 21:00:28 EST