Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Prelinking KDE - some solutions - some problems
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

Goto page 1, 2, 3, 4, 5  Next  
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
r2dtu
Tux's lil' helper
Tux's lil' helper


Joined: 23 Aug 2002
Posts: 87

PostPosted: Mon Nov 04, 2002 12:09 pm    Post subject: Prelinking KDE - some solutions - some problems Reply with quote

Since I've rebuilt my gentoo with glibc 2.3.1 i decided to try to prelink it. (I mean Jakub Jelinek's prelink ftp://people.redhat.com/jakub/prelink/ ).

I've found following problems:
1) some apps (i.e. designer from qt) would not prelink complaining about libGLU.so.1 being non-PIC shared library
2) all KDE apps would not prelink complaining about libqt-mt.so.3 being non-PIC shared library.

The first problem was easly solved. Xfree default configuration is forcing libGLU.so to be non-PIC with "BuildLibGlxWithoutPIC YES" in xc/config/cf/linux.cf due to performance reasons. Since I'm not using GL apps I do not care about its performance so adding:
Code:
echo "#define BuildLibGlxWithoutPIC NO" >> config/cf/host.def

to xfree ebuild helped.

The second problem was quite tricky cause the real culprit was not libqt-mt but Xfree again. I've found soluttion in redhat rawhide qt-3.0.5-17.src.rpm. In spec file of this rpm I've found a hack around libXinerama.a library. This library is again compiled without -fPIC flag in original XFree. So a solution is to folow this hack or force compiling of all XFree with fPIC flag adding:
Code:
export CFLAGS="${CFLAGS} -fPIC"
export CXXFLAGS="${CXXFLAGS} -fPIC"

to XFree ebuild.

Still, some kde apps do not work for me after being prelinked (kdm_greet, kdeinit, kmail, kdesu) crashing with segmentation fault. Have anyone found a solution to for this?
Back to top
View user's profile Send private message
Evangelion
Veteran
Veteran


Joined: 31 May 2002
Posts: 1087
Location: Helsinki, Finland

PostPosted: Mon Nov 04, 2002 12:32 pm    Post subject: Reply with quote

any comments regarding performance?
Back to top
View user's profile Send private message
r2dtu
Tux's lil' helper
Tux's lil' helper


Joined: 23 Aug 2002
Posts: 87

PostPosted: Mon Nov 04, 2002 12:42 pm    Post subject: Reply with quote

Well I run it on P4 1.7G, 512MB RAM notebook, so things were already fast. But startup times are much improved. Konqueror starts in a blink of an eye (well maybe two), compared to about two seconds before.
I can't give you any specific numbers, cause I'm reemerging kde now. Since prelink changes binaries I un-prelinked my system so emerge would see right MD5 sums.
Back to top
View user's profile Send private message
Lovechild
Advocate
Advocate


Joined: 17 May 2002
Posts: 2858
Location: Århus, Denmark

PostPosted: Mon Nov 04, 2002 1:02 pm    Post subject: Reply with quote

So who's with me, we need prelinking directly in portage - just how hard would this be to implement?

I would like to offer my limited programming skills and my unrivaled bold foolishness to this project.

I gather from reading Jakub' mailinglist posts that the best approce(the only?) would be to:
1) prelink on install.
2) run a cronjob that checks say once a week, did we change the database of installed ebuilds.
3) if so rerun the prelinker.

The problems would then be
1) Keeping md5 sums in check
2) Implementing a USE flag for this (or would it be better just to force this on everyone and keep it in unstable untill everything compiles)

Mind you I've never played with prelinking in glibc 2.3.1 (and people.redhat.com is down for me so I can't get the tools)
Back to top
View user's profile Send private message
Evangelion
Veteran
Veteran


Joined: 31 May 2002
Posts: 1087
Location: Helsinki, Finland

PostPosted: Mon Nov 04, 2002 1:09 pm    Post subject: Reply with quote

Lovechild wrote:
So who's with me, we need prelinking directly in portage


Better performance? yes sir!

Quote:
just how hard would this be to implement?


Famous last words ;)...
Back to top
View user's profile Send private message
Lovechild
Advocate
Advocate


Joined: 17 May 2002
Posts: 2858
Location: Århus, Denmark

PostPosted: Mon Nov 04, 2002 1:12 pm    Post subject: Reply with quote

Evangelion wrote:
Lovechild wrote:
So who's with me, we need prelinking directly in portage


Better performance? yes sir!

Quote:
just how hard would this be to implement?


Famous last words ;)...


1) Great.... But it's not +speed, it's really -load time (which will be felt much more)

2) I know Jakub has a "working" prototype of this implementation for RPM based databases - so it can be done, I'm however not saying it will be easy.
Back to top
View user's profile Send private message
r2dtu
Tux's lil' helper
Tux's lil' helper


Joined: 23 Aug 2002
Posts: 87

PostPosted: Mon Nov 04, 2002 1:19 pm    Post subject: Reply with quote

Lovechild wrote:

The problems would then be
1) Keeping md5 sums in check

Maybe this would help:
http://lists.gentoo.org/pipermail/gentoo-dev/2002-October/015770.html
Back to top
View user's profile Send private message
Evangelion
Veteran
Veteran


Joined: 31 May 2002
Posts: 1087
Location: Helsinki, Finland

PostPosted: Mon Nov 04, 2002 1:31 pm    Post subject: Reply with quote

Lovechild wrote:
1) Great.... But it's not +speed, it's really -load time (which will be felt much more)


By "speed" I meant load-times. For example, the slow startup of apps is the primary reason why people say KDE is slow. Prelinking fixes that. Of course, prelinking will help other apps as well.
Back to top
View user's profile Send private message
Lovechild
Advocate
Advocate


Joined: 17 May 2002
Posts: 2858
Location: Århus, Denmark

PostPosted: Mon Nov 04, 2002 2:36 pm    Post subject: Reply with quote

r2dtu wrote:
Lovechild wrote:

The problems would then be
1) Keeping md5 sums in check

Maybe this would help:
http://lists.gentoo.org/pipermail/gentoo-dev/2002-October/015770.html


Great.... let's get cracking
Back to top
View user's profile Send private message
r2dtu
Tux's lil' helper
Tux's lil' helper


Joined: 23 Aug 2002
Posts: 87

PostPosted: Wed Nov 06, 2002 8:21 am    Post subject: Reply with quote

I upgraded to kde 3.1rc2 and now no kde app works when prelinked. It either ends with segmentation fault or dcop communication error. Strange, all qt-only based apps work great and load faster when prelinked.
Maybe my idea to force -fPIC flag on whole XFree was not good. I'll try recomipilng XFree and qt and kde with only forcing libXinerama. This is what redhat is doing (Jakub Jelonek's patch). I'll keep you informed.
Back to top
View user's profile Send private message
r2dtu
Tux's lil' helper
Tux's lil' helper


Joined: 23 Aug 2002
Posts: 87

PostPosted: Sun Nov 10, 2002 11:49 am    Post subject: Reply with quote

I tried diffrent approach to libXinerama problem. I simply added "-no-xinerama" to configure command in qt ebuild. Rebuilt qt and kde and now all kde programs work ok when prelinked!
Back to top
View user's profile Send private message
Lovechild
Advocate
Advocate


Joined: 17 May 2002
Posts: 2858
Location: Århus, Denmark

PostPosted: Sun Nov 10, 2002 12:20 pm    Post subject: Reply with quote

r2dtu wrote:
I tried diffrent approach to libXinerama problem. I simply added "-no-xinerama" to configure command in qt ebuild. Rebuilt qt and kde and now all kde programs work ok when prelinked!


Why is that command even on per default? I meant how many really have a dual monitor setup contra the added bloat and compile time to QT (and breakage - I hear Xinerama is known to break a few things)
Back to top
View user's profile Send private message
Lovechild
Advocate
Advocate


Joined: 17 May 2002
Posts: 2858
Location: Århus, Denmark

PostPosted: Sun Nov 10, 2002 12:45 pm    Post subject: Reply with quote

Doing a checkrun on those config change now, I'll get back to you tomorrow with the results.
Back to top
View user's profile Send private message
Lovechild
Advocate
Advocate


Joined: 17 May 2002
Posts: 2858
Location: Århus, Denmark

PostPosted: Mon Nov 11, 2002 10:23 pm    Post subject: Reply with quote

btw... no big succes with those instrutions..... killed X....
Back to top
View user's profile Send private message
fkurth
n00b
n00b


Joined: 15 Apr 2002
Posts: 27
Location: Dresden/Germany

PostPosted: Mon Nov 18, 2002 5:53 pm    Post subject: results ? Reply with quote

Hi
Are there results in the meantime ?

Does anybody got it to work now ? And how ?
Can anyone post a patch for the newer portage version ?
_________________
--
Felix Kurth
Back to top
View user's profile Send private message
splooge
l33t
l33t


Joined: 30 Aug 2002
Posts: 636

PostPosted: Tue Nov 19, 2002 2:53 am    Post subject: Reply with quote

"Hi ppl, I have make a draft version of the portage changes needed.

I am not a python programmer, or want to be! The code can be optimised a
bit but I believe that prelink was well programmed so all checks for
file type etc are best handled by C based prelink, as long as os.system
is fast.

I have created code which adds support for the FEATURE flag prelink.
If it exists it uses prelink to verify the md5sums.
Also it prelinks files as they are installed.

Most importantly it works for me! Happy testing!

code:
download from
http://cvs.gentoo.org/~cretin/portage.py
This is based on the latest CVS portage

TODO:
* Safety checks for existence of /usr/sbin/prelink
* optimise to minimise number of calls to prelink
* see if a less IO intensive md5sum method exists (of course it does!)

now to sleep .....

--
Stefan Jones <cretin@gentoo.org>
Gentoo Linux"
Back to top
View user's profile Send private message
Lovechild
Advocate
Advocate


Joined: 17 May 2002
Posts: 2858
Location: Århus, Denmark

PostPosted: Tue Nov 19, 2002 8:01 am    Post subject: Reply with quote

AWESOME... thx, now I¨m looking forward to reinstalling Linux
Back to top
View user's profile Send private message
AlterEgo
Veteran
Veteran


Joined: 25 Apr 2002
Posts: 1619

PostPosted: Tue Nov 19, 2002 8:45 am    Post subject: Reply with quote

splooge wrote:
"Hi ppl,
[...]
Most importantly it works for me! Happy testing!


Cool :)
But some instructions on how to use it would be really cool 8)
Back to top
View user's profile Send private message
Lovechild
Advocate
Advocate


Joined: 17 May 2002
Posts: 2858
Location: Århus, Denmark

PostPosted: Tue Nov 19, 2002 11:28 am    Post subject: Reply with quote

Fro the look of it, you need to

1) Get needed tools, glibc 2.3.1, lastest binutils, lastest GCC (else compiling gcc after compiling glibc will fail)
2) get the prelinking tool
3) then set prelink as a FEATURE flag in make.conf
4) now upgrade Portage to the CVS version and replace with the python file our kind geek provided
5) Install shit
6) enjoy prelinked shit
7) watch in horror as it breaks shit :)

Now we might need some workarounds for some packages, like QT and X as stated in this thread already, but kind geeks code looks fairly solid (I'm not a python geek either so what do I know) so I think there should be a good chance of this being relatively painless upgrade at some later point in portage history and once again, the Gentoo users shall roam free with their fast as hell distro...
Back to top
View user's profile Send private message
fkurth
n00b
n00b


Joined: 15 Apr 2002
Posts: 27
Location: Dresden/Germany

PostPosted: Tue Nov 19, 2002 11:51 am    Post subject: Reply with quote

dont set prelink feature befor installing shit !
at least nasm fails to build with prelinked libs.

If you're installing from scratch, you have to remerge zlib too.
-no-xinerama to qt works fine, but that schould become a use var !?!

just compiling...compiling...compiling...compiling...compiling

What about collecting all infos here and write a short Paper about
setting up prelinking ?

btw.
(for kde-prelink or mozilla you have to edit /etc/prelink.conf)
_________________
--
Felix Kurth
Back to top
View user's profile Send private message
AlterEgo
Veteran
Veteran


Joined: 25 Apr 2002
Posts: 1619

PostPosted: Tue Nov 19, 2002 12:03 pm    Post subject: Reply with quote

OK I'll start one from scratch. On a new disk :)

So far, I started with the stage-1 tarball and just after bootstrapping, I emerged prelink (and copied the patched portage.py files over from another install), and then finished the emerge -system.

For comparision, I am building identical boxes with and without prelink.
Example:
[without prelink]
LD_DEBUG=statistics tar
09152:
09152: runtime linker statistics:
09152: total startup time in dynamic loader: 815171 clock cycles
09152: time needed for relocation: 389953 clock cycles (47.8%)
09152: number of relocations: 139
09152: number of relocations from cache: 8
09152: time needed to load objects: 314093 clock cycles (38.5%)

[with prelink]
LD_DEBUG=statistics tar
09154:
09154: runtime linker statistics:
09154: total startup time in dynamic loader: 416912 clock cycles
09154: time needed for relocation: 4061 clock cycles (.9%)
09154: number of relocations: 0
09154: number of relocations from cache: 71
09154: time needed to load objects: 301529 clock cycles (72.3%)

Promising :) and I guess it's working problem-free until now :)

I'll keep you posted


Last edited by AlterEgo on Thu Nov 21, 2002 10:55 am; edited 2 times in total
Back to top
View user's profile Send private message
Cretin
Retired Dev
Retired Dev


Joined: 11 Nov 2002
Posts: 23
Location: UK

PostPosted: Tue Nov 19, 2002 12:06 pm    Post subject: Reply with quote

Just found this topic on the stuff I'm working on, so I thought I might as well popup.

I will try to fix-up the code this evening to make it work better, I have a few ideas.

The portage.py file is a replacement for the portage version,
/usr/lib/python2.2/site-packages/portage.py

In future I will post diffs.

Also regarding the -fPIC flag, I have run into this a few times and am changing ebuilds as I go though, feel free to contact me with any additional changes that are required.

Will change Xfree ebuild soon.

Till then, bye
Back to top
View user's profile Send private message
Lovechild
Advocate
Advocate


Joined: 17 May 2002
Posts: 2858
Location: Århus, Denmark

PostPosted: Tue Nov 19, 2002 3:27 pm    Post subject: Reply with quote

How about setting up a page that shows this:

Prelinking OK:
These ebuilds work out of the box with prelinking

Prelinking HACK:
These ebuilds currently need these(url) hacks to work with prelinking

Prelinking SHOWSTOPPERS:
These ebuilds have no known workarounds to enable prelinking, or running them causes the ever popular segfault. etc.

Now couldn't we use the FEATURE flag to disable prelinking in SHOWSTOPPER ebuilds... then again... maybe not a good idea...
Back to top
View user's profile Send private message
Cretin
Retired Dev
Retired Dev


Joined: 11 Nov 2002
Posts: 23
Location: UK

PostPosted: Tue Nov 19, 2002 6:57 pm    Post subject: Reply with quote

Good idea, there should be a place where all the info is kept.

The easiest way I think would be to create a bug at bugs.gentoo.org
and put all the info there, and that way anyone can add infomation to the cause.

As a dev I could own the bug and put the fixes into gentoo, is this OK everyone?
Back to top
View user's profile Send private message
Cretin
Retired Dev
Retired Dev


Joined: 11 Nov 2002
Posts: 23
Location: UK

PostPosted: Tue Nov 19, 2002 8:50 pm    Post subject: Reply with quote

patch: http://cvs.gentoo.org/~cretin/portage-prelink.patch
diffed against the latest portage.py

I think the patch included here is close to the final product, or at
least the principles involved. Some of it can still be polished a bit
more by the gurus, email me with any ideas plz!

Prelink features are only enabled if you have prelink in FEATURES in
make.conf. You also must have prelink installed at /usr/sbin/prelink
(the default location)

What it does:

On unmerges it uses prelink to calculate the md5sums.

On emerge a list of all files installed with the tokens "bin" or "lib"
in their path or name is made. (ie /bin/ls or /opt/something/bin/ls or
libblibble.la ) An attempt is then made to prelink these. This is dirty
but safe. Patches welcome for better code.

How to install:

patch /usr/lib/python2.2/site-packages/portage.py with this patch

/bin/cp -f portage.py /usr/lib/python2.2/site-packages/

/bin/rm -f /usr/lib/python2.2/site-packages/portage.py[co]

/usr/bin/python -c "import py_compile;
py_compile.compile('/usr/lib/python2.2/site-packages/portage.py')"
/usr/bin/python -O -c "import py_compile;
py_compile.compile('/usr/lib/python2.2/site-packages/portage.py')"

add prelink to the FEATURES list and emerge prelink

Have fun!

--
Stefan Jones <cretin@gentoo.org>
Gentoo Linux
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Goto page 1, 2, 3, 4, 5  Next
Page 1 of 5

 
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