public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: Dominique Michel <dominique.michel@citycable.ch>
To: gentoo-dev@lists.gentoo.org
Subject: Re: [gentoo-dev] [RFC] CFLAGS paragraph for the GWN
Date: Sat, 30 Sep 2006 22:58:27 +0200	[thread overview]
Message-ID: <20060930225827.725ae31d@localhost> (raw)
In-Reply-To: <451ED52E.5030407@bouton.name>

Le Sat, 30 Sep 2006 22:35:58 +0200,
Lionel Bouton <lionel-dev@bouton.name> a écrit :

> 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.
My personal experience with other CFLAGS as the ones in the handbook is at
gcc-4.1.1 have a better optimisation with the default gentoo CFLAGS. Even
with -O2, the result is a faster system, and -O3 seam to be safer with math
related applications as with gcc-3.4.*.

But in the other hand, other flags seam to be more problematic as with
gcc-3.4.*. And the new optimisations flags as the vectorisation flags are not
easy to use, because the result depend on the code of the program. They can or
not brake the code, and when the program run well, they can make it faster
or slower. All depend of the size and complexity of the loops. And I think also
of the arch.

So my conclusion is:
For system flags, just keep the default, and if you want to experiment, do
profiling for each single program you want to optimize.

Cheers,
Dominique

-- 
Dominique Michel
-- 
gentoo-dev@gentoo.org mailing list



  reply	other threads:[~2006-09-30 21:01 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-30 20:35 [gentoo-dev] [RFC] CFLAGS paragraph for the GWN Lionel Bouton
2006-09-30 20:58 ` Dominique Michel [this message]
2006-09-30 21:48 ` Mike Frysinger
2006-09-30 22:42   ` Lionel Bouton
2006-09-30 23:27     ` [gentoo-dev] " Ryan Hill
2006-09-30 21:48 ` Ryan Hill
2006-09-30 21:52   ` Robin H. Johnson
2006-09-30 22:37     ` Ryan Hill
2006-10-01  0:38       ` Robin H. Johnson
2006-10-01 11:23       ` Duncan
2006-10-01 16:49         ` Donnie Berkholz
2006-10-01 17:02           ` Diego 'Flameeyes' Pettenò
2006-10-01 18:00         ` Ryan Hill
2006-10-02 10:40           ` Duncan
2006-10-01 21:01         ` Jeroen Roovers
2006-10-01  0:37 ` [gentoo-dev] " George Prowse
  -- strict thread matches above, loose matches on Subject: below --
2006-10-03  0:56 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060930225827.725ae31d@localhost \
    --to=dominique.michel@citycable.ch \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox