Mailing List Archive

x86 toolchain changes heads up
historically, gcc on x86 has always defaulted to i386. some people noticed
recently that glibc-2.6 fails to build in this situation as they were only
setting -mtune via CFLAGS, not -march. i'll be tweaking gcc so that it will
default -march based on your CHOST. so all the i686-* people will now have a
default -march=i686 implied in their gcc systems, i586-* people will
have -march=i586, etc... keep in mind this is merely the default.
-mike
Re: x86 toolchain changes heads up [ In reply to ]
On Tue, 2007-07-17 at 19:47 -0400, Mike Frysinger wrote:
> historically, gcc on x86 has always defaulted to i386. some people noticed
> recently that glibc-2.6 fails to build in this situation as they were only
> setting -mtune via CFLAGS, not -march. i'll be tweaking gcc so that it will
> default -march based on your CHOST. so all the i686-* people will now have a
> default -march=i686 implied in their gcc systems, i586-* people will
> have -march=i586, etc... keep in mind this is merely the default.
> -mike

Does this mean that any user-set "-march" flag is overridden for these
cases? Just curious.

Thanks.
--
Peter Gordon (codergeek42)
Gentoo Forums Global Moderator
GnuPG Public Key ID: 0xFFC19479 / Fingerprint:
DD68 A414 56BD 6368 D957 9666 4268 CB7A FFC1 9479
My Blog: http://thecodergeek.com/blog/
Re: x86 toolchain changes heads up [ In reply to ]
I think it's the other way arround. -march=ix86 is implicit unless you
override it with a user variable.

On 7/18/07, Peter Gordon <codergeek42@gentoo.org> wrote:
> On Tue, 2007-07-17 at 19:47 -0400, Mike Frysinger wrote:
> > historically, gcc on x86 has always defaulted to i386. some people noticed
> > recently that glibc-2.6 fails to build in this situation as they were only
> > setting -mtune via CFLAGS, not -march. i'll be tweaking gcc so that it will
> > default -march based on your CHOST. so all the i686-* people will now have a
> > default -march=i686 implied in their gcc systems, i586-* people will
> > have -march=i586, etc... keep in mind this is merely the default.
> > -mike
>
> Does this mean that any user-set "-march" flag is overridden for these
> cases? Just curious.
>
> Thanks.
> --
> Peter Gordon (codergeek42)
> Gentoo Forums Global Moderator
> GnuPG Public Key ID: 0xFFC19479 / Fingerprint:
> DD68 A414 56BD 6368 D957 9666 4268 CB7A FFC1 9479
> My Blog: http://thecodergeek.com/blog/
>
>
>


--
Ioannis Aslanidis

<deathwing00[at]gentoo.org> 0xB9B11F4E
--
gentoo-dev@gentoo.org mailing list
Re: x86 toolchain changes heads up [ In reply to ]
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Peter Gordon wrote:
> On Tue, 2007-07-17 at 19:47 -0400, Mike Frysinger wrote:
>> historically, gcc on x86 has always defaulted to i386. some people noticed
>> recently that glibc-2.6 fails to build in this situation as they were only
>> setting -mtune via CFLAGS, not -march. i'll be tweaking gcc so that it will
>> default -march based on your CHOST. so all the i686-* people will now have a
>> default -march=i686 implied in their gcc systems, i586-* people will
>> have -march=i586, etc... keep in mind this is merely the default.
>> -mike
>
> Does this mean that any user-set "-march" flag is overridden for these
> cases? Just curious.

I think he meant CHOST sets just *default* so any user-set -march
overrides that.
But I wonder what happens to user-set -mtune then? Since AFAIK -march
implies -mtune, will also the default -march override user-set -mtune?

- --
Vlastimil Babka (Caster)
Gentoo/Java
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGndsrtbrAj05h3oQRAp5hAJ4in2JnV637D7GyDMvG6hc8A8/n4QCeK9Eo
IFUTZxAFqfSVx3Za64GQM0c=
=6wSA
-----END PGP SIGNATURE-----
--
gentoo-dev@gentoo.org mailing list
Re: x86 toolchain changes heads up [ In reply to ]
Hi!

On Tue, 17 Jul 2007, Mike Frysinger wrote:
> historically, gcc on x86 has always defaulted to i386. some people noticed
> recently that glibc-2.6 fails to build in this situation as they were only
> setting -mtune via CFLAGS, not -march. i'll be tweaking gcc so that it will
> default -march based on your CHOST. so all the i686-* people will now have a
> default -march=i686 implied in their gcc systems, i586-* people will
> have -march=i586, etc... keep in mind this is merely the default.

Do I understand this correctly?

Up until now, gcc implicitly assumed -march=i386 if nothing else
was specified by the user.

Now, it defaults to something different, so -mtune works
differently than it used to.

If both are correct, I have questions?

- With what version did/will gcc change?
Corollary: In what Changelog of gcc can I find out more?
(Rather: which changelog can I point my coworkers to)
- What's the new default?

Thanks,
Tobias

--
In the future, everyone will be anonymous for 15 minutes.
--
gentoo-dev@gentoo.org mailing list
Re: x86 toolchain changes heads up [ In reply to ]
Peter Gordon wrote:
> On Tue, 2007-07-17 at 19:47 -0400, Mike Frysinger wrote:
>> historically, gcc on x86 has always defaulted to i386. some people noticed
>> recently that glibc-2.6 fails to build in this situation as they were only
>> setting -mtune via CFLAGS, not -march. i'll be tweaking gcc so that it will
>> default -march based on your CHOST. so all the i686-* people will now have a
>> default -march=i686 implied in their gcc systems, i586-* people will
>> have -march=i586, etc... keep in mind this is merely the default.
>> -mike
>
> Does this mean that any user-set "-march" flag is overridden for these
> cases? Just curious.

You quoted the answer :) These flags are "merely the default". Any
user-specified flags will override the default. For example, if you have
CFLAGS="-march=i586" with a i686 CHOST, it'd be effectively like calling gcc
with 'gcc -march=i686 -march=i586'. The later option would win.

--
Andrew Gaffney http://dev.gentoo.org/~agaffney/
Gentoo Linux Developer Catalyst/Installer + x86 release coordinator
--
gentoo-dev@gentoo.org mailing list
Re: x86 toolchain changes heads up [ In reply to ]
On Wednesday 18 July 2007, Peter Gordon wrote:
> On Tue, 2007-07-17 at 19:47 -0400, Mike Frysinger wrote:
> > historically, gcc on x86 has always defaulted to i386. some people
> > noticed recently that glibc-2.6 fails to build in this situation as they
> > were only setting -mtune via CFLAGS, not -march. i'll be tweaking gcc so
> > that it will default -march based on your CHOST. so all the i686-*
> > people will now have a default -march=i686 implied in their gcc systems,
> > i586-* people will have -march=i586, etc... keep in mind this is merely
> > the default. -mike
>
> Does this mean that any user-set "-march" flag is overridden for these
> cases? Just curious.

*cough* keep in mind this is merely the default *cough*
-mike
Re: x86 toolchain changes heads up [ In reply to ]
On Tue, 2007-07-17 at 19:47 -0400, Mike Frysinger wrote:
> historically, gcc on x86 has always defaulted to i386. some people noticed
> recently that glibc-2.6 fails to build in this situation as they were only
> setting -mtune via CFLAGS, not -march. i'll be tweaking gcc so that it will
> default -march based on your CHOST. so all the i686-* people will now have a
> default -march=i686 implied in their gcc systems, i586-* people will
> have -march=i586, etc... keep in mind this is merely the default.

Have you spoken with upstream about this? Is there any way they would
adopt it there?

--
Chris Gianelloni
Release Engineering Strategic Lead
Alpha/AMD64/x86 Architecture Teams
Games Developer/Council Member/Foundation Trustee
Gentoo Foundation
Re: x86 toolchain changes heads up [ In reply to ]
On Wednesday 18 July 2007, Chris Gianelloni wrote:
> On Tue, 2007-07-17 at 19:47 -0400, Mike Frysinger wrote:
> > historically, gcc on x86 has always defaulted to i386. some people
> > noticed recently that glibc-2.6 fails to build in this situation as they
> > were only setting -mtune via CFLAGS, not -march. i'll be tweaking gcc so
> > that it will default -march based on your CHOST. so all the i686-*
> > people will now have a default -march=i686 implied in their gcc systems,
> > i586-* people will have -march=i586, etc... keep in mind this is merely
> > the default.
>
> Have you spoken with upstream about this? Is there any way they would
> adopt it there?

my reading of the code is that they do this on purpose. they set the default
*tune* based on target, not arch. the gcc man page also quotes that the
default -march is i386 if no -march is set.
-mike
Re: x86 toolchain changes heads up [ In reply to ]
On Wed, 2007-07-18 at 01:53 -0700, Peter Gordon wrote:
> Does this mean that any user-set "-march" flag is overridden for these
> cases? Just curious.

Thanks for the explanations given, Mike, Ioannis, Ryan, and Andre! I'm
much clearer on the isue now. :]
--
Peter Gordon (codergeek42)
Gentoo Forums Global Moderator
GnuPG Public Key ID: 0xFFC19479 / Fingerprint:
DD68 A414 56BD 6368 D957 9666 4268 CB7A FFC1 9479
My Blog: http://thecodergeek.com/blog/
Re: x86 toolchain changes heads up [ In reply to ]
Vlastimil Babka wrote:
> Peter Gordon wrote:
>> On Tue, 2007-07-17 at 19:47 -0400, Mike Frysinger wrote:
>>> historically, gcc on x86 has always defaulted to i386. some people noticed
>>> recently that glibc-2.6 fails to build in this situation as they were only
>>> setting -mtune via CFLAGS, not -march. i'll be tweaking gcc so that it will
>>> default -march based on your CHOST. so all the i686-* people will now have a
>>> default -march=i686 implied in their gcc systems, i586-* people will
>>> have -march=i586, etc... keep in mind this is merely the default.
>>> -mike
>> Does this mean that any user-set "-march" flag is overridden for these
>> cases? Just curious.
>
> I think he meant CHOST sets just *default* so any user-set -march
> overrides that.
> But I wonder what happens to user-set -mtune then? Since AFAIK -march
> implies -mtune, will also the default -march override user-set -mtune?

Previously GCC defaulted to -march=i386, which implied -mtune=i386
(actually, -mcpu for some reason (?)), when neither were set. People
are setting CFLAGS="-mtune=pentium4 -O2 -fblah..." which therefore is
defaulting to -march=i386 -mtune=pentium4. glibc-2.6 requires >=
-march=i486. Kaboom.

Now -march=$(echo $CHOST | awk -F- '{ print $1 }'), which implies
-mtune=echo $CHOST | awk -F- '{ print $1 }' when neither are set. If
_either_ are set by the user, they are overridden.

ie. you can still set -march=i386 or -mtune=i386 or whatever you like.

--
dirtyepic salesman said this vacuum's guaranteed
gentoo org it could suck an ancient virus from the sea
9B81 6C9F E791 83BB 3AB3 5B2D E625 A073 8379 37E8 (0x837937E8)

--
gentoo-dev@gentoo.org mailing list