On Thu, Jul 21, 2011 at 16:21, Florian Philipp <li...@binarywings.net> wrote: > > Am 21.07.2011 10:57, schrieb Pandu Poluan: > > -original message- > > Subject: Re: [gentoo-user] New computer and Gentoo > > From: Bill Kenworthy <bi...@iinet.net.au> > > Date: 2011-07-21 12:54 > > > >> On Thu, 2011-07-21 at 06:26 +0100, Mick wrote: > [...] > >> Ive just stumbled on something weird with march=native: > >> > >> At some point I had march=prescott on a core2 E4600 running 32bit - > >> worked well. Changed to march=native and did some upgrades with a few > >> odd things like asterisk segfaulting in a glibc library afterwards, and > >> some things not building. Then to add confusion, I changed to an > >> pentium Duo E6600 (flies!) and added another stick of ram. More odd > >> things happening such as reiserfs oopsing on shutdown. > >> > >> Last night the penny dropped and I looked the new processor up and > >> changed to march=core2 and have mostly corrected (recompiled) the > >> damage. > >> > >> So not sure about march=native now as it is only what was built with > >> native thats been problematic. With 20-20 hindsight it was perhaps > >> predictable ... > > > > IMO you're not supposed to compile part of the system with > > -march=<something> > > and the rest with -march=native. The instructions (and optimizations) > > emitted by -march=native might not be compatible with your previous > > -march. > > I'd like to see a reference for this claim. -march=native doesn't do > more than set -march=core2 and some other optimizations for cache size > etc. This should be no more troublesome than mixing code compiled with > different specific -march settings. When you look at binary > distributions (and especially precompiled packages from the developer > instead of the distribution), this is pretty much normal. > > The compiler is not allowed to change the external interfaces of > functions for optimization purposes (see [1]). Besides this, I can only > think of alignment problems ([2]) but even this should be handled > correctly by the compiler. Everything else is a compiler bug that should > be reported. > > [1] http://en.wikipedia.org/wiki/Calling_convention > [2] http://en.wikipedia.org/wiki/Data_alignment >
Hmmm... You do have a point. So, gcc's "-march" option *should* maintain ABI compatibility. There *are* other switches that can impact compatibility [1]. What I can't be sure of, whether the "-march" option (improperly) activates one or more of those switches when set to "-march=native" [1] http://gcc.gnu.org/onlinedocs/gcc/i386-and-x86_002d64-Options.html Rgds, -- Pandu E Poluan ~ IT Optimizer ~ Blog : http://pepoluan.tumblr.com • Linked-In : http://id.linkedin.com/in/pepoluan