2001-04-18 17:58:13

by Dragan Milenkovic

[permalink] [raw]
Subject: uname ?

<rpm-related>
Few days ago, I found an incredibly usable option in latest gcc versions.
gcc -march=k6 -mcpu=k6
I started rebuilding SRPMS with these as optflags, just to find out that
some packages don't use optflags, but use -march=`uname -m`.
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!

--
Dragan


2001-04-18 20:06:34

by Erik Mouw

[permalink] [raw]
Subject: Re: uname ?

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: [email protected]
WWW: http://www-ict.its.tudelft.nl/~erik/