1 |
Frank Peters <frank.peters@×××××××.net> posted |
2 |
20090731010923.8875a3af.frank.peters@×××××××.net, excerpted below, on |
3 |
Fri, 31 Jul 2009 01:09:23 -0400: |
4 |
|
5 |
> It should also be considered that perhaps the upstream developers are |
6 |
> making things more difficult. |
7 |
|
8 |
No kidding! |
9 |
|
10 |
> Many new packages that have been released |
11 |
> seem to break everything that depends on them. For example, a new jpeg |
12 |
> library, version 7, was released recently (which has not yet made it |
13 |
> into Gentoo) that will require a rebuild of every program that processes |
14 |
> images, and this includes the extensive GTK package as it uses libjpeg |
15 |
> for its pixbuffer loader. |
16 |
|
17 |
Thanks for the warning! I hadn't read anything about that one yet. |
18 |
|
19 |
> Another example is the new gcc compiler, |
20 |
> version 4.4.x. I have noticed that many packages will fail to compile |
21 |
> with the new version of gcc and this necessitates that the previous |
22 |
> version, 4.3.3, be also kept installed on the system. |
23 |
|
24 |
I routinely install any new gcc version before it's unmasked to ~arch. |
25 |
As such, I'm used to dealing with packages that won't yet compile with |
26 |
the new version, searching Gentoo and other bug systems for patches, |
27 |
etc. Due to the hard work of many even before a public release (Gentoo |
28 |
toolchain folks and adventurous users try rebuilding with the rcs, and |
29 |
some routinely test weekly snapshots during development. Debian as well |
30 |
tests, and many of our patches to make existing packages compile with new |
31 |
gcc versions come from there. Fedora Rawhide, similarly, and I've |
32 |
actually worked with SuSE devs on testing a patch for an upstream package |
33 |
(pan) that I'm involved with upstream, myself. |
34 |
|
35 |
But as we're talking about Gentoo tools making it easier, slotted gcc and |
36 |
gcc-config definitely belong on that list, as they SURE make it easier |
37 |
testing various new compilers, and switching back to the old one when |
38 |
necessary. The process would be SERIOUSLY harder without this sort of |
39 |
Gentoo tools and slotted gcc. |
40 |
|
41 |
> Lastly, do I need |
42 |
> to mention the fiasco with the update of the xcb package for X Window? |
43 |
> Once again, a single change has broken everything that has gone before. |
44 |
|
45 |
That one actually had FAR less effect on me than I expected. From the |
46 |
Gentoo/X project discussion of things (in the tracking bug and on the |
47 |
desktop list, IIRC, the former discovered by reading the latter), I |
48 |
expected something on the size of the expat fiasco, but with virtually |
49 |
all X apps needing recompiled. Never-the-less, I upgraded (again, while |
50 |
it was masked, actually, I grabbed it while it was still on the X |
51 |
overlay, IIRC), and things weren't anywhere NEAR that bad. I think I had |
52 |
a half dozen, maybe a dozen packages to upgrade, instead of the couple |
53 |
hundred or so I expected. |
54 |
|
55 |
But I expect what saved me on that was having -as-needed in LDFLAGS. It |
56 |
really DOES make a HUGE difference. The goal is eventually to make that |
57 |
the Gentoo default, but there's still a lot of packages that don't work |
58 |
with it, tho most of them have been patched or at least have filter- |
59 |
ldflags called for it, so it doesn't hit users as much as it used to. |
60 |
Flame-eyes is the expert on -as-needed (it was his blog I discovered it |
61 |
on), and his tinder-box has really weeded out a bunch of issues both |
62 |
there and elsewhere. That alone is a huge benefit to Gentoo, even if he |
63 |
didn't contribute huge amounts of fixes and technical help for other |
64 |
devs, which he does. (Unfortunately, he reminds me a lot of my father |
65 |
and sister. All three are extremely bright, genius level or close to it, |
66 |
all three workaholics -- they see so much to be done and so few able to |
67 |
do it, and try to do it all themselves! And all three have the health |
68 |
problems that go with the territory. All three of them have had to learn |
69 |
to deliberately slow down and pace themselves, after they got sick and |
70 |
nearly died from simply trying to do to much.) |
71 |
|
72 |
For those who wish to try it, here's mine: |
73 |
|
74 |
LDFLAGS="-Wl,-z,now,--as-needed,-O1,--hash-style=gnu,--sort-common" |
75 |
|
76 |
The "now" bit people will likely want to avoid. The others should be |
77 |
useful, tho there has been discussion about making them Gentoo default, |
78 |
and part of them may be default by now (they weren't when I added them, |
79 |
tho). |
80 |
|
81 |
There are some others I've seen as well, but I don't know enough about |
82 |
them to use them. For the ones above (covered in the ld manpage except |
83 |
for -Wl, in the gcc manpage, see below): |
84 |
|
85 |
-Wl is actually a gcc option, telling it to pass what follows to the |
86 |
linker. See the gcc manpage for this one. |
87 |
|
88 |
-z,now (as opposed to -z,lazy) tells the linker to force all links to be |
89 |
resolved at initial program load. This takes a bit more time /at/ |
90 |
initial load, but when an application would otherwise pause for |
91 |
additional library functions to load, it now doesn't have to. It's thus |
92 |
a trade-off. It also has a couple other effects. Memory use will be |
93 |
slightly higher tho not too much, so I'd say it's probably best not to do |
94 |
unless you've 2 gigs RAM or more. But the two effects I use it for are: |
95 |
(1) If a library or function from a library can't load, I'd prefer to see |
96 |
the error at startup, not later, when the program tries to load that |
97 |
bit. This ensures that. (2) There are certain somewhat narrow security |
98 |
benefits. I won't attempt to explain them here and they are rather |
99 |
narrow, but given I have 8 gigs RAM so that's not an issue, and I |
100 |
considered the other aspects slightly positive, with no visible downside, |
101 |
I thought it worth it. |
102 |
|
103 |
I've had this enabled for years, now, with no issues /except/ with the |
104 |
ati/radeon drivers when xorg split into modular packages. I had to turn |
105 |
off -z,now for the xf86-ati-radeon package (using the /etc/portage/env/ |
106 |
method to do it for just that package) for awhile as a result. They |
107 |
eventually patched the package to filter -z,now, and I'm not sure if it |
108 |
has been resolved upstream by now or not, but with the package patched to |
109 |
filter it, I don't have to worry about it now. |
110 |
|
111 |
--as-needed tells the linker to only tag libraries it actually uses as |
112 |
NEEDED, not everything on the include line, or indirect dependencies like |
113 |
the libraries other libraries it is using use. The result is that |
114 |
unnecessary linkages are avoided, and FAR fewer rebuilds need done when a |
115 |
library changes as a result. |
116 |
|
117 |
I've had this enabled for quite some time now without many issues, |
118 |
probably as a result of flame-eyes' testing. This one should therefore |
119 |
be pretty trouble-free now, and has a HUGE upside, but it does still have |
120 |
the potential to cause occasional issues on new or obscure packages. But |
121 |
I really DO think the upside is worth it! |
122 |
|
123 |
-O1 is much like the gcc -O optimization functions, but there's only the |
124 |
single -O1 level, for linking. This one's newer, but I've had no |
125 |
problems with it at all, probably because it's commonly enabled and thus |
126 |
well tested. |
127 |
|
128 |
Gentoo's former default for hash was --hash-style=both, but hash- |
129 |
style=gnu along with -O1 and sort-common were proposed as new defaults. |
130 |
I'm not sure if they made it or not, but in any case, this one shouldn't |
131 |
be an issue on Linux at all, and I've certainly not had issues at all. |
132 |
The other alternative and linker default (before Gentoo's default kicks |
133 |
in) is hash-style=sysv. |
134 |
|
135 |
--sort-common sorts symbols by their alignment size, >=16,8,4,2,1 bytes. |
136 |
This packs them tighter than they'd be be otherwise, due to alignment |
137 |
constraint issues, thus making for slightly smaller binaries. |
138 |
|
139 |
I think the --as-needed will make the most difference, and I'm SURE it |
140 |
has saved me a LOT of pain, even with the xcb issue alone. I absolutely |
141 |
believe it's worthwhile, and that the pain saved will MORE than make up |
142 |
for any occasional issues one /might/ run into with new or obscure |
143 |
individual packages. Note that -Wl is actually a gcc option, telling it |
144 |
to pass what follows to the linker. Thus, the format for /just/ as- |
145 |
needed would be: |
146 |
|
147 |
LDFLAGS="-Wl,--as-needed" |
148 |
|
149 |
> It has to be admitted that these upstream developers are not making life |
150 |
> any easier for the distribution maintainers. |
151 |
|
152 |
> But that's the nature of progress, I suppose. Fortunately, Gentoo can |
153 |
> give the serious user a set of tools to better deal with these |
154 |
> inevitable changes. |
155 |
|
156 |
Agreed. |
157 |
|
158 |
-- |
159 |
Duncan - List replies preferred. No HTML msgs. |
160 |
"Every nonfree program has a lord, a master -- |
161 |
and if you use the program, he is your master." Richard Stallman |