Gentoo Archives: gentoo-user

From: Pandu Poluan <pandu@××××××.info>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] New computer and Gentoo
Date: Thu, 21 Jul 2011 09:54:08
Message-Id: CAA2qdGW5SRMvoQ8t3TyBzVsgX7EyMAXy9hEtrZXS+1uw6p0PhA@mail.gmail.com
In Reply to: Re: [gentoo-user] New computer and Gentoo by Florian Philipp
1 On Thu, Jul 21, 2011 at 16:21, Florian Philipp <lists@×××××××××××.net> wrote:
2 >
3 > Am 21.07.2011 10:57, schrieb Pandu Poluan:
4 > > -original message-
5 > > Subject: Re: [gentoo-user] New computer and Gentoo
6 > > From: Bill Kenworthy <billk@×××××××××.au>
7 > > Date: 2011-07-21 12:54
8 > >
9 > >> On Thu, 2011-07-21 at 06:26 +0100, Mick wrote:
10 > [...]
11 > >> Ive just stumbled on something weird with march=native:
12 > >>
13 > >> At some point I had march=prescott on a core2 E4600 running 32bit -
14 > >> worked well.  Changed to march=native and did some upgrades with a few
15 > >> odd things like asterisk segfaulting in a glibc library afterwards, and
16 > >> some things not building.  Then to add confusion, I changed to an
17 > >> pentium Duo E6600 (flies!) and added another stick of ram.  More odd
18 > >> things happening such as reiserfs oopsing on shutdown.
19 > >>
20 > >> Last night the penny dropped and I looked the new processor up and
21 > >> changed to march=core2 and have mostly corrected (recompiled) the
22 > >> damage.
23 > >>
24 > >> So not sure about march=native now as it is only what was built with
25 > >> native thats been problematic.  With 20-20 hindsight it was perhaps
26 > >> predictable ...
27 > >
28 > > IMO you're not supposed to compile part of the system with -march=<something>
29 > > and the rest with -march=native. The instructions (and optimizations)
30 > > emitted by -march=native might not be compatible with your previous
31 > > -march.
32 >
33 > I'd like to see a reference for this claim. -march=native doesn't do
34 > more than set -march=core2 and some other optimizations for cache size
35 > etc. This should be no more troublesome than mixing code compiled with
36 > different specific -march settings. When you look at binary
37 > distributions (and especially precompiled packages from the developer
38 > instead of the distribution), this is pretty much normal.
39 >
40 > The compiler is not allowed to change the external interfaces of
41 > functions for optimization purposes (see [1]). Besides this, I can only
42 > think of alignment problems ([2]) but even this should be handled
43 > correctly by the compiler. Everything else is a compiler bug that should
44 > be reported.
45 >
46 > [1] http://en.wikipedia.org/wiki/Calling_convention
47 > [2] http://en.wikipedia.org/wiki/Data_alignment
48 >
49
50 Hmmm... You do have a point. So, gcc's "-march" option *should*
51 maintain ABI compatibility.
52
53 There *are* other switches that can impact compatibility [1]. What I
54 can't be sure of, whether the "-march" option (improperly) activates
55 one or more of those switches when set to "-march=native"
56
57 [1] http://gcc.gnu.org/onlinedocs/gcc/i386-and-x86_002d64-Options.html
58
59 Rgds,
60 --
61 Pandu E Poluan
62 ~ IT Optimizer ~
63
64 Blog : http://pepoluan.tumblr.com • Linked-In :
65 http://id.linkedin.com/in/pepoluan