1 |
Lionel Bouton wrote: |
2 |
> Hi, I just had an unpleasant experience with -ffast-math and GCC 4.1.1 |
3 |
> (it borked my LDAP authentication on several systems which worked with |
4 |
> the same CFLAGS as long as GCC 3.4.6 was used). |
5 |
> |
6 |
> There is a lot of material out there about CFLAGS and Gentoo (google |
7 |
> returns 387000 pages) but what's working for someone might not for |
8 |
> another. There are flags that work for a GCC version and most ebuilds |
9 |
> and don't work with another GCC version (my unfortunate experience) or |
10 |
> some ebuilds. Flag combination/architecture/LDFLAGS might be an issue too. |
11 |
> |
12 |
> There are already good resources (http://gentoo-wiki.com/CFLAGS_matrix |
13 |
> was mentioned to me by robbat2) but they may not be advertised enough. |
14 |
> I'd like to propose a paragraph to the GWN editor which presents some |
15 |
> gotchas and good references on the subject. |
16 |
> |
17 |
> Here's a draft for review. You're welcomed to expand on the subject. |
18 |
> |
19 |
> --- Draft BEGIN --- |
20 |
> <section> |
21 |
> <title>CFLAGS</title> |
22 |
> <body> |
23 |
> |
24 |
> <p> |
25 |
> Being able to tune the CFLAGS is part of one of the core principles of |
26 |
> Gentoo: let the user be in control. Being in control brings both |
27 |
> benefits and problems and CFLAGS tuning is not an exception. |
28 |
> </p> |
29 |
> <p> |
30 |
> The recent upgrade to gcc-4.1.1 for x86 and amd64 users changed the |
31 |
> landscape. Users that spent some time tuning their CFLAGS with gcc-3.4.6 |
32 |
> might find out that an upgrade to gcc-4.1.1 leaves them with an unstable |
33 |
> system. Example of this are : |
34 |
> <ul> |
35 |
> <li>nss_ldap stopped working with -ffast-math</li> |
36 |
> <li>...</li> |
37 |
> </ul> |
38 |
> </p> |
39 |
> <p> |
40 |
> Users with unsupported CFLAGS (see the <uri |
41 |
> link='http://gentoo-wiki.com/CFLAGS_matrix'>CFLAGS matrix</uri> for |
42 |
> example) might want to return to safe CFLAGS (see <uri |
43 |
> link='http://gentoo-wiki.com/Safe_Cflags'>Safe CFLAGS</uri>) if recent |
44 |
> updates caused them stability problems. On the other hand, more |
45 |
> adventurous users might want to experiment with CFLAGS that didn't work |
46 |
> properly with gcc-3.4.6... As always, the user is in control. |
47 |
> </p> |
48 |
> </body> |
49 |
> </section> |
50 |
> --- Draft END --- |
51 |
> |
52 |
> If possible, I'd like to expand the list of 3.4.6 -> 4.1.1 upgrade |
53 |
> problems which are linked to experimental CFLAGS. If you want to expand |
54 |
> the subject to cover other tuning/stability gotchas that recent updates |
55 |
> might have brought into the light, please feel free to do so. As English |
56 |
> is not my native tongue, feel free to spell check too. |
57 |
> |
58 |
> Cheers, |
59 |
> |
60 |
> Lionel. |
61 |
> |
62 |
I agree in principle because it would stop people using stupid CFLAGS. |
63 |
It should have an information section and a "use this CFLAG and dont ask |
64 |
us for help" section: |
65 |
|
66 |
<p> |
67 |
Good Compiler Flag |
68 |
</p> |
69 |
<p> |
70 |
-floop-optimize |
71 |
Enables safe loop optimisation and is enabled in most -O$ |
72 |
</p> |
73 |
<p> |
74 |
Bad Compiler flag |
75 |
</p> |
76 |
<p> |
77 |
Sets |-fno-math-errno|, |-funsafe-math-optimizations|, |
78 |
|-fno-trapping-math|, |-ffinite-math-only|, |-fno-rounding-math| and |
79 |
|-fno-signaling-nans| |
80 |
|
81 |
Used to speed up math functions but causes major b0rkage because it can |
82 |
result in incorrect output for programs which depend on an exact |
83 |
implementation of IEEE or ISO rules/specifications for math functions. |
84 |
|
85 |
Use this and dont bother asking for help. |
86 |
</p> |
87 |
-- |
88 |
gentoo-dev@g.o mailing list |