1 |
2008/2/6, Duncan <1i5t5.duncan@×××.net>: |
2 |
> |
3 |
> Beso <givemesugarr@×××××.com> posted |
4 |
> d257c3560802060159q3a5b0334gd40b5d8b25aa348f@××××××××××.com, excerpted |
5 |
> below, on Wed, 06 Feb 2008 09:59:29 +0000: |
6 |
> |
7 |
> >> CFLAGS="-march=athlon64 -O2 -pipe" |
8 |
> > |
9 |
> > |
10 |
> > i suggest this flags instead of yours usually they're a little more |
11 |
> > processor based and are not experimental ones as usually they say about |
12 |
> > them: |
13 |
> > CFLAGS="-Os -march=k8 -mno-tls-direct-seg-refs -mmmx -msse3 -pipe |
14 |
> > -fomit-frame-pointer" |
15 |
> |
16 |
> -fomit-frame-pointer is the default for -O and above on amd64/x86_64, as |
17 |
> it doesn't interfere with debugging here as it does on 32-bit x86, so |
18 |
> omitting it saves on complexity without changing the compiled result. Of |
19 |
> course, it's still useful for 32-bit, but there's only a very few |
20 |
> programs that portage compiles as 32-bit on amd64 anyway (and even there, |
21 |
> CFLAGS aren't really used except for sandbox, because gcc does its own |
22 |
> bootstrapping and glibc is considered critical enough it basically sets |
23 |
> its own very strict CFLAGS in the ebuild). |
24 |
|
25 |
|
26 |
i tend to always add it since i don't want to always look at what the arch |
27 |
would do later. |
28 |
|
29 |
-Os I used to use, for reasons explained in detail in a post to the list |
30 |
> some time ago but briefly, cache size restrictions tend to matter more |
31 |
> than pure cycle optimization on modern processors, so -Os generally made |
32 |
> more sense to me than -O2. However, with gcc-4.2, several optmizations |
33 |
> that used to be in -Os only, made it into -O2, and -O2 now includes a |
34 |
> couple of cache optimizers that raw size optimization misses, so it's not |
35 |
> as critical, now. Given that -O2 tends to be the recommended for Gentoo |
36 |
> and more widely tested than -Os, I've therefore switched back to it. |
37 |
|
38 |
|
39 |
i tend to think that Os should be gentoo's default, since it adds some |
40 |
options for cache and disk occupation and since i've always been good with |
41 |
it. |
42 |
|
43 |
-mmmx is included in the default for -march=k8, so that should be |
44 |
> superfluous. However, -msse3 is NOT included, as the original amd chips |
45 |
> didn't have it. Newer amd CPUs DO include sse3 (look for pni in the |
46 |
> flags line(s) of /proc/cpuinfo), so unlike -mmmx it's worth specifying |
47 |
> -msse3 if your CPU has it. |
48 |
|
49 |
|
50 |
when i've added it it wasn't included by default. |
51 |
|
52 |
What about -mno-tls-direct-seg-refs? Why do you use that? The gcc |
53 |
> manpage doesn't have enough info to convince me it's useful, and in fact, |
54 |
> implies the reverse, since it defaults glibc folks to using it, which |
55 |
> implies a reason for that default. I'd therefore love to see a |
56 |
> discussion of the flag with enough information to justify a better |
57 |
> informed decision, as yours presumably is given your depth of knowledge |
58 |
> and activity on this list. |
59 |
|
60 |
|
61 |
this should help with virtualizazion apps. xen won't work well without it |
62 |
with large system memory. without xen or other virt apps this shouldn't |
63 |
influence much on the packages. |
64 |
|
65 |
FWIW, here's my CFLAGS. CXXFLAGS are similar, minus -combine (mentioned |
66 |
> below) and -freorder-blocks-and-partition (for similar reasons). |
67 |
> -combine and -ftree-vectorize still cause occasional problems, which I |
68 |
> avoid on a case by case basis as I encounter them, with an appropriate |
69 |
> entry in /etc/portage/env/<cat>/<pkg>, but in general, these flags have |
70 |
> worked well for me for some time. I can explain why I use each one if |
71 |
> anyone wants to know. |
72 |
> |
73 |
> CFLAGS="-march=k8 -msse3 -O2 -pipe -frename-registers -fweb -ftree- |
74 |
> vectorize -freorder-blocks-and-partition -combine -fgcse-sm -fgcse-las - |
75 |
> fgcse-after-reload -fmerge-all-constants" |
76 |
> |
77 |
> >> CXXFLAGS="-march=athlon64 -O2 -pipe" |
78 |
> > |
79 |
> > this is the same and is faster to write and to have it updated. |
80 |
> > CXXFLAGS="${CFLAGS}" |
81 |
> |
82 |
> The exception would be if your CFLAGS include things like -combine, which |
83 |
> doesn't work so well on C++ so shouldn't be in CXXFLAGS. (For -combine |
84 |
> specifically, gcc ignores it in such cases, but spits a warning, which |
85 |
> various configure scripts interpret as a problem causing them to screwup, |
86 |
> so it's best to leave it out of CXXFLAGS entirely.) |
87 |
> |
88 |
> > also add: |
89 |
> > LDFLAGS="-Wl,--as-needed,-O1 -Wl,--enable-new-dtags -Wl,--sort-common |
90 |
> > -s" |
91 |
> |
92 |
> Could you point me to documentation on LDFLAGS in general, or at least |
93 |
> --enable-new-dtags and --sort-common? I use --as-needed already |
94 |
> ( documentation at http://www.gentoo.org/proj/en/qa/asneeded.xml ), as |
95 |
> well as -z,now (security thing as mentioned in portage's QA warnings if |
96 |
> you have them enabled for setuid/setgid applications, but I find it |
97 |
> useful in general, and no, it doesn't simply counteract --as-needed), but |
98 |
> have yet to find a resource even close to as helpful for LDFLAGS in |
99 |
> general as "man gcc" is for CFLAGS, so I'm left asking about them one at |
100 |
> a time as I see them, and I've not seen those yet. Again, a discussion |
101 |
> with enough info to make an informed decision would be invaluable! I |
102 |
> don't even know what the options are at this point, and that's |
103 |
> frustrating! |
104 |
|
105 |
|
106 |
--sort-common is to prevent gaps between symbols due to alignment |
107 |
constraints, presumably increasing efficiency layout. |
108 |
here's an interesting topic on ldflags: |
109 |
http://forums.gentoo.org/viewtopic-t-67777.html |
110 |
|
111 |
--enable-new-dtags should be default for current binutils but it was there |
112 |
from my 3 years old make.conf so it is still there. adding it again |
113 |
shouldn't do harm. |
114 |
|
115 |
>> FEATURES="ccache distlocks fixpackages metadata-transfer parallel-fetch |
116 |
> >> sandbox sfperms strict unmerge-orphans userfetch" |
117 |
> > |
118 |
> > if you experience collision problems add collision-protect to the |
119 |
> > features. you should have some better protection between packages and |
120 |
> > should avoid packages from writing files owned by other packages. this |
121 |
> > could provoke some more emerge errors than before because there are |
122 |
> > quite some packages that overwrite files |
123 |
> |
124 |
> Agreed. It's worth mentioning COLLISION_IGNORE, which you can set in |
125 |
> make.conf to avoid specific known collisions, especially if they are |
126 |
> known to be "safe", that is, something like icons or the like (using an |
127 |
> example from the recent KDE4-svn overlay work, upstream was changing them |
128 |
> fast enough to make it not worth filing bugs with Gentoo over), that it |
129 |
> really doesn't matter if a couple of packages are fighting over. |
130 |
> Differing config files, OTOH, you probably want to know about! |
131 |
|
132 |
|
133 |
that's why i don't have it set. i only have set this: |
134 |
FEATURES="parallel-fetch ccache -strict -sandbox buildpkg" |
135 |
i use -strict since i have a quite high live ebuilds use that sometimes |
136 |
require manual handling, and i've disabled sandbox since it pisses me off |
137 |
with some xorg ebuilds and ati-drivers. i've now switched to paludis which |
138 |
is faster or resolving deps for world and is more able to handle external |
139 |
overlays directly. though, it lacks pkging and for some packages i still use |
140 |
portage. |
141 |
|
142 |
>> MAKEOPTS="-j3" |
143 |
> > |
144 |
> > |
145 |
> > set MAKEOPTS="-j3" to MAKEOPTS="-j5 -s ". if you experience compile |
146 |
> > problem decrease the j number to 1. |
147 |
> |
148 |
> Note that there are occasional parallel make issues with -jX, where X>1 |
149 |
> or not existent (-j by itself indicates unlimited jobs). These don't |
150 |
> occur frequently at -j2 as it's so heavily used by Gentooers everywhere |
151 |
> so those occurring there tend to have been eliminated already. However, |
152 |
> as the number of jobs increase, so does the likelihood of running into |
153 |
> parallel make issues. make errors indicating file or directory not found |
154 |
> are the classic example, so any time you see one of those, try |
155 |
> MAKEOPTS=-j1 emerge <whatever> and you'll likely find it gone. If so, |
156 |
> file a bug with [parallel make] as well as the package name in the |
157 |
> subject line (assuming there's not yet one filed), and help get it fixed! |
158 |
> =8^) |
159 |
> |
160 |
FWIW, I run MAKEOPTS="-j20 -l12" (up to 20 jobs, but don't start any more |
161 |
> if the load is above 12) here. Dual-dual-core Opteron 290s, 8 gig RAM, |
162 |
> PORTAGE_TMPDIR pointing at a tmpfs so all those temp files don't hit |
163 |
> disk. With PORTAGE_NICENESS=19, and with kernel 2.6.24's new per-user |
164 |
> scheduling turned on (and with Hz=300, voluntary preemption, so it's not |
165 |
> a special real-time kernel or anything by any stretch), I can still |
166 |
> listen to streaming audio and even run a moderately sized visualization |
167 |
> window (amarok with the scrolling voice-print analyzer going in its own |
168 |
> window) without audio pause or undue jerkiness (there's a bit, but under |
169 |
> a load of 3 per core and no real-time preemption, one might expect that) |
170 |
> of the visualization. If I'm feeling adventurous and don't have |
171 |
> anything else critical going on, I'll occasionally try -j by itself, just |
172 |
> to see how high I can run the load average. A 400-500 load average is |
173 |
> doable with kernel compiles, for instance, and nicely entertaining! =8^) |
174 |
> It still amazes me how well the system copes with even that, and it was |
175 |
> even more amazing back with dual-single-cores (242s)! |
176 |
|
177 |
|
178 |
yep, i'll try out it someday. for the moment i'm planning a disk change, |
179 |
mine has already 2 years and its overall health is starting to be heard when |
180 |
writing or reading data from the disk. i've got an external bigger disk that |
181 |
i'll partition with tmpfs for paludis and portage. the only thing that i |
182 |
still don't know is: |
183 |
1. can i put on more than one different tmpfs?! |
184 |
2. if i put one tmpfs and symlink there what i do want to use on tmpfs is |
185 |
better?! |
186 |
|
187 |
-- |
188 |
dott. ing. beso |