public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] [RFC] CFLAGS paragraph for the GWN
@ 2006-10-03  0:56 Lionel Bouton
  2006-10-03 11:55 ` Chris Gianelloni
                   ` (2 more replies)
  0 siblings, 3 replies; 27+ messages in thread
From: Lionel Bouton @ 2006-10-03  0:56 UTC (permalink / raw
  To: gentoo-dev

Here's an updated draft. I included most of your remarks and added some
notes on append-flags/filter-flags. I'll probably submit it to Ulrich
around the end of the week.

--- Draft BEGIN ---
<section>
<title>CFLAGS</title>
<body>

<p>
Being able to tune the CFLAGS is part of one of the core principles of
Gentoo: let the user be in control. Being in control brings both
benefits and problems and CFLAGS tuning is not an exception.
</p>
<p>
The recent upgrade to gcc-4.1.1 for x86 and amd64 users changed the
landscape. Users that spent some time tuning their CFLAGS with gcc-3.4.6
might find out that an upgrade to gcc-4.1.1 leaves them with an unstable
system. Example of this are :
<ul>
<li>nss_ldap stopped working with <c>-ffast-math</c> (reported to break
many packages changing with the actual gcc version)</li>
<li><c>-fvisibility-inlines-hidden</c> still breaks some code</li>
<li>if you used gcc-4.0, <c>-ftree-loop-linear</c> now breaks in
gcc-4.1(at least with mesa)</li>
<li>again for gcc-4.0 users, <c>-ftree-vectorize</c> is known to be
broken in gcc-4.1 (at least for x86 and ppc, amd64 users seem to be
safe)</li>
<li><c>-fforce-addr</c> and <c>-fweb</c> break regularly on x86 with
video libraries or graphic processing apps which use hand-optimised ASM</li>
</ul>
</p>
<p>
Users with unsupported CFLAGS (see the <uri
link='http://gentoo-wiki.com/CFLAGS_matrix'>CFLAGS matrix</uri> for
example) might want to return to safe CFLAGS (see <uri
link='http://gentoo-wiki.com/Safe_Cflags'>Safe CFLAGS</uri>) if recent
updates caused them stability problems. On the other hand, more
adventurous users might want to experiment with CFLAGS that didn't work
properly with gcc-3.4.6... As always, the user is in control.
</p>
<p>
Notes:
<ul>
<li>The gcc man page contains warnings for some unsafe optimization
options. You should read it carefully when you experiment with CFLAGS or
upgrade GCC on a CFLAGS-customized Gentoo.</li>
<li>Some options that are unsafe in the system-wide CFLAGS might be
added automatically in some ebuilds if the developper deems them safe
(by redefining CFLAGS or using append-flags of the flag-o-matic eclass).
For example <c>-ffast-math</c> is added by the xmame/xmess ebuilds on
most architectures even if you don't put it in your CFLAGS.</li>
<li>You might get an idea of the stability issues of a specific
optimization option by running: <c>find /usr/portage -name '*.ebuild'|
xargs grep -- '-<your-risky-optimization-option>'</c>. It takes quite
some time, but might be enlightening: look for the 'filter-flags'.</li>
</ul>
</p>
</body>
</section>
--- Draft END ---

Lionel
-- 
gentoo-dev@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 27+ messages in thread
* [gentoo-dev] [RFC] CFLAGS paragraph for the GWN
@ 2006-09-30 20:35 Lionel Bouton
  2006-09-30 20:58 ` Dominique Michel
                   ` (2 more replies)
  0 siblings, 3 replies; 27+ messages in thread
From: Lionel Bouton @ 2006-09-30 20:35 UTC (permalink / raw
  To: gentoo-dev

Hi, I just had an unpleasant experience with -ffast-math and GCC 4.1.1
(it borked my LDAP authentication on several systems which worked with
the same CFLAGS as long as GCC 3.4.6 was used).

There is a lot of material out there about CFLAGS and Gentoo (google
returns 387000 pages) but what's working for someone might not for
another. There are flags that work for a GCC version and most ebuilds
and don't work with another GCC version (my unfortunate experience) or
some ebuilds. Flag combination/architecture/LDFLAGS might be an issue too.

There are already good resources (http://gentoo-wiki.com/CFLAGS_matrix
was mentioned to me by robbat2) but they may not be advertised enough.
I'd like to propose a paragraph to the GWN editor which presents some
gotchas and good references on the subject.

Here's a draft for review. You're welcomed to expand on the subject.

--- Draft BEGIN ---
<section>
<title>CFLAGS</title>
<body>

<p>
Being able to tune the CFLAGS is part of one of the core principles of
Gentoo: let the user be in control. Being in control brings both
benefits and problems and CFLAGS tuning is not an exception.
</p>
<p>
The recent upgrade to gcc-4.1.1 for x86 and amd64 users changed the
landscape. Users that spent some time tuning their CFLAGS with gcc-3.4.6
might find out that an upgrade to gcc-4.1.1 leaves them with an unstable
system. Example of this are :
<ul>
<li>nss_ldap stopped working with -ffast-math</li>
<li>...</li>
</ul>
</p>
<p>
Users with unsupported CFLAGS (see the <uri
link='http://gentoo-wiki.com/CFLAGS_matrix'>CFLAGS matrix</uri> for
example) might want to return to safe CFLAGS (see <uri
link='http://gentoo-wiki.com/Safe_Cflags'>Safe CFLAGS</uri>) if recent
updates caused them stability problems. On the other hand, more
adventurous users might want to experiment with CFLAGS that didn't work
properly with gcc-3.4.6... As always, the user is in control.
</p>
</body>
</section>
--- Draft END ---

If possible, I'd like to expand the list of 3.4.6 -> 4.1.1 upgrade
problems which are linked to experimental CFLAGS. If you want to expand
the subject to cover other tuning/stability gotchas that recent updates
might have brought into the light, please feel free to do so. As English
is not my native tongue, feel free to spell check too.

Cheers,

Lionel.
-- 
gentoo-dev@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2006-10-04 14:03 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-03  0:56 [gentoo-dev] [RFC] CFLAGS paragraph for the GWN Lionel Bouton
2006-10-03 11:55 ` Chris Gianelloni
2006-10-03 12:26 ` Ciaran McCreesh
2006-10-03 13:15   ` Mike Frysinger
2006-10-04  8:35     ` Jan Kundrát
2006-10-03 22:37   ` Lionel Bouton
2006-10-04 12:25     ` Paul de Vrieze
2006-10-03 16:11 ` Josh Saddler
2006-10-03 17:16   ` Lionel Bouton
2006-10-03 17:22     ` Daniel Ostrow
2006-10-03 17:47       ` Charlie
2006-10-03 17:56         ` Stephen P. Becker
2006-10-03 17:49       ` Lionel Bouton
2006-10-03 20:46         ` Chris Gianelloni
2006-10-03 22:14           ` Lionel Bouton
2006-10-03 18:08       ` Simon Stelling
2006-10-04  0:31       ` [gentoo-dev] Linking to Gentoo-wiki from www.gentoo.org Andrew Ross
2006-10-04  8:19         ` Sven Vermeulen
2006-10-04  0:32       ` Andrew Ross
2006-10-04  2:52         ` Josh Saddler
2006-10-04  3:36           ` Donnie Berkholz
2006-10-04 13:58         ` Chris Gianelloni
  -- strict thread matches above, loose matches on Subject: below --
2006-09-30 20:35 [gentoo-dev] [RFC] CFLAGS paragraph for the GWN Lionel Bouton
2006-09-30 20:58 ` Dominique Michel
2006-09-30 21:48 ` Mike Frysinger
2006-09-30 22:42   ` Lionel Bouton
2006-10-01  0:37 ` George Prowse

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox