Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Does hash-style work on ppc? [Solved]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo on PPC
View previous topic :: View next topic  
Author Message
Bones McCracker
Veteran
Veteran


Joined: 14 Mar 2006
Posts: 1609
Location: U.S.A.

PostPosted: Mon Dec 31, 2007 3:37 am    Post subject: Does hash-style work on ppc? [Solved] Reply with quote

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
View user's profile Send private message
JoseJX
Retired Dev
Retired Dev


Joined: 28 Apr 2002
Posts: 2774

PostPosted: Mon Dec 31, 2007 2:33 pm    Post subject: Reply with quote

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
View user's profile Send private message
Bones McCracker
Veteran
Veteran


Joined: 14 Mar 2006
Posts: 1609
Location: U.S.A.

PostPosted: Mon Dec 31, 2007 11:21 pm    Post subject: Reply with quote

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
View user's profile Send private message
ddc
Guru
Guru


Joined: 29 Aug 2006
Posts: 527

PostPosted: Tue Jan 01, 2008 7:06 pm    Post subject: Reply with quote

excuse me, what is the goal of that ?
Back to top
View user's profile Send private message
Bones McCracker
Veteran
Veteran


Joined: 14 Mar 2006
Posts: 1609
Location: U.S.A.

PostPosted: Tue Jan 01, 2008 10:37 pm    Post subject: Reply with quote

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
View user's profile Send private message
ddc
Guru
Guru


Joined: 29 Aug 2006
Posts: 527

PostPosted: Sat Jan 05, 2008 11:41 pm    Post subject: Reply with quote

thank you

i see it has also been discussed on this thread
https://forums.gentoo.org/viewtopic.php?t=226909
Back to top
View user's profile Send private message
Bones McCracker
Veteran
Veteran


Joined: 14 Mar 2006
Posts: 1609
Location: U.S.A.

PostPosted: Sat Jan 05, 2008 11:59 pm    Post subject: Reply with quote

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
View user's profile Send private message
ddc
Guru
Guru


Joined: 29 Aug 2006
Posts: 527

PostPosted: Sun Jan 06, 2008 12:00 am    Post subject: Reply with quote

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
View user's profile Send private message
Bones McCracker
Veteran
Veteran


Joined: 14 Mar 2006
Posts: 1609
Location: U.S.A.

PostPosted: Sun Jan 06, 2008 12:19 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on PPC All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum