View previous topic :: View next topic |
Author |
Message |
Bones McCracker Veteran
Joined: 14 Mar 2006 Posts: 1611 Location: U.S.A.
|
Posted: Mon Dec 31, 2007 3:37 am Post subject: Does hash-style work on ppc? [Solved] |
|
|
Can you do LDFLAGS="-Wl,-01,--hash-style=gnu" on ppc?
If so, does it require binutils 2.18.50 or should it work with 2.18-r1?
Any other requirements (e.g., specific versions of glibc, gcc, etc.)?
Last edited by Bones McCracker on Mon Jan 07, 2008 6:22 pm; edited 1 time in total |
|
Back to top |
|
|
JoseJX Retired Dev
Joined: 28 Apr 2002 Posts: 2774
|
Posted: Mon Dec 31, 2007 2:33 pm Post subject: |
|
|
I don't see why it wouldn't work, but you should probably test it in a chroot first. Download a stage 3, and unpack it into a directory, link in the portage directory, then chroot into that directory. Do the upgrade and see if it works. If it does, then I'd risk it on the rest of the system, if not, well, let us know here. :) _________________ Gentoo PPC FAQ: http://www.gentoo.org/doc/en/gentoo-ppc-faq.xml |
|
Back to top |
|
|
Bones McCracker Veteran
Joined: 14 Mar 2006 Posts: 1611 Location: U.S.A.
|
Posted: Mon Dec 31, 2007 11:21 pm Post subject: |
|
|
Nah, I just modified my LDFLAGS and let 'er rip (emerge -e world).
Seems to be working just fine, now that I changed:
LDFLAGS="-Wl,-01,--hash-style=gnu"
to
LDFLAGS="-Wl,-O1,--hash-style=gnu"
Classic moron error. I was carefully typing it by hand being very careful with "l" vs. "1", and I put a "0" where "O" belongs.
I'll test more thoroughly when everything is built and report any problems. |
|
Back to top |
|
|
ddc Guru
Joined: 29 Aug 2006 Posts: 525
|
Posted: Tue Jan 01, 2008 7:06 pm Post subject: |
|
|
excuse me, what is the goal of that ? |
|
Back to top |
|
|
Bones McCracker Veteran
Joined: 14 Mar 2006 Posts: 1611 Location: U.S.A.
|
Posted: Tue Jan 01, 2008 10:37 pm Post subject: |
|
|
ddc wrote: | excuse me, what is the goal of that ? |
Make system a little bit more responsive by reducing some of the dynamic linking work that gets done when an application uses shared libraries.
This email and article explain it pretty well (although both are from back when the patch was first introduced).
http://sources.redhat.com/ml/binutils/2006-06/msg00418.html
http://lwn.net/Articles/192624/
Note that when you see references to this and terms like "50% performance improvement" are unwisely used -- they're talking about a 50% improvement in some tiny little step that only accounts for a fraction of a percentage of the work done on your computer. So don't get too excited. It can, however, make a noticeable difference in startup time or responsiveness of applications (via startup of components) that make heavy use of shared libraries (dynamically-loaded objects).
If you go to the man page for ld, you will see the option explained: Quote: | --hash-style=style
Set the type of linker's hash table(s). style can be either "sysv"
for classic ELF ".hash" section, "gnu" for new style GNU
".gnu.hash" section or "both" for both the classic ELF ".hash" and
new style GNU ".gnu.hash" hash tables. The default is "sysv". |
There's also a gentoo wiki article, and while it is obsolete the explanation is provides is informative:
http://gentoo-wiki.com/HOWTO_Hashstyle
And it does seem to be working just fine on ppc, although it will probably be Thursday before my system finishes rebuilding:
Code: | bonekracker ~ $ readelf -a /usr/bin/mpg123 |grep HASH
[ 3] .gnu.hash GNU_HASH 100001a4 0001a4 0005f4 04 A 4 0 4
0x6ffffef5 (GNU_HASH) 0x100001a4 |
I also checked the Fedora 8 instance I have on ppc and it seems they have implemented this by default, along with prelinking. So I suppose this has become somewhat standard. |
|
Back to top |
|
|
ddc Guru
Joined: 29 Aug 2006 Posts: 525
|
|
Back to top |
|
|
Bones McCracker Veteran
Joined: 14 Mar 2006 Posts: 1611 Location: U.S.A.
|
Posted: Sat Jan 05, 2008 11:59 pm Post subject: |
|
|
Some old threads/posts are treasures. Some are dangerously obsolete.
This is one of those areas where you want to be careful following old guidance (like what's on the Gentoo wiki pertaining to this). It was a fairly complicated process to implement this originally when patches and unmasked versions of things were required. As best I can tell now, all that's required is to add the LDFLAG and emerge -e world (but I'm no expert). |
|
Back to top |
|
|
ddc Guru
Joined: 29 Aug 2006 Posts: 525
|
Posted: Sun Jan 06, 2008 12:00 am Post subject: |
|
|
BoneKracker wrote: |
I also checked the Fedora 8 instance I have on ppc and it seems they have implemented this by default, along with prelinking. So I suppose this has become somewhat standard. |
I wander: why gentoo doesn't use this optimization by default ?
more testing still needed ? |
|
Back to top |
|
|
Bones McCracker Veteran
Joined: 14 Mar 2006 Posts: 1611 Location: U.S.A.
|
Posted: Sun Jan 06, 2008 12:19 am Post subject: |
|
|
That's probably part of it - until this past year I think this was considered by most to be kind of "experimental".
Also, it only makes a real difference on a system that uses dynamically-loaded libraries extensively. So if you're a server administrator it's one thing, but if you're a KDE desktop user it's another. So the handbook represents sort of "common ground" or a "base case".
And the handbook is pretty complicated and intimidating to newcomers as it is. So, like prelinking and other optimizations, it is left to the administrator to choose whether to do them and add them.
Oh, and I haven't looked at the handbook in a long time -- maybe it is standard. |
|
Back to top |
|
|
|