Gentoo Archives: gentoo-dev

From: Lionel Bouton <lionel-dev@××××××.name>
To: gentoo-dev@l.g.o
Subject: [gentoo-dev] [RFC] CFLAGS paragraph for the GWN
Date: Tue, 03 Oct 2006 01:01:28
Message-Id: 4521B54A.5010507@bouton.name
1 Here's an updated draft. I included most of your remarks and added some
2 notes on append-flags/filter-flags. I'll probably submit it to Ulrich
3 around the end of the week.
4
5 --- Draft BEGIN ---
6 <section>
7 <title>CFLAGS</title>
8 <body>
9
10 <p>
11 Being able to tune the CFLAGS is part of one of the core principles of
12 Gentoo: let the user be in control. Being in control brings both
13 benefits and problems and CFLAGS tuning is not an exception.
14 </p>
15 <p>
16 The recent upgrade to gcc-4.1.1 for x86 and amd64 users changed the
17 landscape. Users that spent some time tuning their CFLAGS with gcc-3.4.6
18 might find out that an upgrade to gcc-4.1.1 leaves them with an unstable
19 system. Example of this are :
20 <ul>
21 <li>nss_ldap stopped working with <c>-ffast-math</c> (reported to break
22 many packages changing with the actual gcc version)</li>
23 <li><c>-fvisibility-inlines-hidden</c> still breaks some code</li>
24 <li>if you used gcc-4.0, <c>-ftree-loop-linear</c> now breaks in
25 gcc-4.1(at least with mesa)</li>
26 <li>again for gcc-4.0 users, <c>-ftree-vectorize</c> is known to be
27 broken in gcc-4.1 (at least for x86 and ppc, amd64 users seem to be
28 safe)</li>
29 <li><c>-fforce-addr</c> and <c>-fweb</c> break regularly on x86 with
30 video libraries or graphic processing apps which use hand-optimised ASM</li>
31 </ul>
32 </p>
33 <p>
34 Users with unsupported CFLAGS (see the <uri
35 link='http://gentoo-wiki.com/CFLAGS_matrix'>CFLAGS matrix</uri> for
36 example) might want to return to safe CFLAGS (see <uri
37 link='http://gentoo-wiki.com/Safe_Cflags'>Safe CFLAGS</uri>) if recent
38 updates caused them stability problems. On the other hand, more
39 adventurous users might want to experiment with CFLAGS that didn't work
40 properly with gcc-3.4.6... As always, the user is in control.
41 </p>
42 <p>
43 Notes:
44 <ul>
45 <li>The gcc man page contains warnings for some unsafe optimization
46 options. You should read it carefully when you experiment with CFLAGS or
47 upgrade GCC on a CFLAGS-customized Gentoo.</li>
48 <li>Some options that are unsafe in the system-wide CFLAGS might be
49 added automatically in some ebuilds if the developper deems them safe
50 (by redefining CFLAGS or using append-flags of the flag-o-matic eclass).
51 For example <c>-ffast-math</c> is added by the xmame/xmess ebuilds on
52 most architectures even if you don't put it in your CFLAGS.</li>
53 <li>You might get an idea of the stability issues of a specific
54 optimization option by running: <c>find /usr/portage -name '*.ebuild'|
55 xargs grep -- '-<your-risky-optimization-option>'</c>. It takes quite
56 some time, but might be enlightening: look for the 'filter-flags'.</li>
57 </ul>
58 </p>
59 </body>
60 </section>
61 --- Draft END ---
62
63 Lionel
64 --
65 gentoo-dev@g.o mailing list

Replies

Subject Author
Re: [gentoo-dev] [RFC] CFLAGS paragraph for the GWN Chris Gianelloni <wolf31o2@g.o>
Re: [gentoo-dev] [RFC] CFLAGS paragraph for the GWN Ciaran McCreesh <ciaranm@×××××××.org>
Re: [gentoo-dev] [RFC] CFLAGS paragraph for the GWN Josh Saddler <nightmorph@g.o>