You are not logged in.

#1 2003-01-11 01:18:22

hab1t
Member
From: here
Registered: 2002-12-31
Posts: 23
Website

prelinking

i know i have been on a posting rampage today but this is my last one smile

has anyone thought of prelinking in archlinux?  i tried downloading libelf and jakob jelineks prelinking tools (in tarball format) off redhat's site... they compiled but kept crashing on most of my directories full of executables like gnome and kde, which are the apps that [according to what i read] will benefit most from this form of optimization.

if anyone dosent know what this is, from what i understand it apparently rebuilds elf executables and libraries so that they [through a complicated technical process smile] load faster.
currently only working in redhat 8 i think

Offline

#2 2003-01-11 01:50:51

jon
Member
Registered: 2002-11-28
Posts: 87

Re: prelinking

i think they prelink in Yoper as well

Offline

#3 2003-01-11 04:35:32

apeiro
Daddy
From: Victoria, BC, Canada
Registered: 2002-08-12
Posts: 771
Website

Re: prelinking

Hmmm... looks interesting.  If someone has the time and inclination to play with this, be my guest.  Unfortunately, I don't have time to look at it for a while.

Here are some urls:

ftp://people.redhat.com/jakub/prelink
http://gcc.gnu.org/ml/gcc/2001-05/msg01670.html

Offline

#4 2003-01-12 01:10:41

Rouslan
Member
From: New York USA
Registered: 2002-11-13
Posts: 76

Re: prelinking

WOW, benchmarks are unbelievable! Speed improvements are just amazing! If all this will work, Linux is going to be SUPER fast(though it is hard to imagine arch linux faster than it is now big_smile ). I'm going to try this out.


Rouslan

Offline

#5 2003-01-12 17:18:09

hab1t
Member
From: here
Registered: 2002-12-31
Posts: 23
Website

Re: prelinking

well there seems to be some property of the kde and gnome executables that crashes it, is there any difference in the compile/linking options for these files?
im not sure what would cause it to crash, it will go through a whole redhat or mandrake file system with no errors and prelink all the executables it can find with only a few exceptions for which it gives some kind of error like 'such and such library is not PIC or relocatable' (um or something) but in arch it hits some dirs and segfaults instantly, while others like /usr/bin and /bin it goes through with a few of those minor error messages.

Offline

#6 2003-01-13 08:33:32

BluPhoenyx
Member
Registered: 2002-12-23
Posts: 239

Re: prelinking

After a little experimenting, here's my 2 bits on the subject...

Some caveats first.
1) Make sure the /etc/prelink.conf file exists. Copy from the prelink source/doc directory if necessary.

2) Edit the file to include whatever binary and library paths you need. Especially those in /opt. Also remark or remove the entries you don't need.

3) Try and ensure that all missing library errors are corrected or prelink won't be able to prelink them or programs which use them.

4) Before actually using it, try a test run using this command,
prelink -avmn | less 
-or-
prelink -avn | less
so you can see what's happening or simply route the output to a file. Then you can know when it's ok to run the command,
prelink -avm
-or-
prelink -av

5) If you have a problem, you might try uninstalling and reinstalling then properly edit the prelinker.conf file before running.

So far it seems to work ok on my system. There were some initial problems which were fixed by editing the file /etc/prelinker.conf (not installed by default on my system) and adding the assorted bin and lib paths from the /opt directory. There were also errors due to weak symbols and non-PIC libraries. In these cases, prelinker simply ignores prelinking the file. This may hinder the ability of prelinker to some degree.

It seems ok to use the prelinker multiple times. At least I saw no trouble while testing it. Gnome runs ok as well as most of it's programs. I did have problems with a few games but IIRC, they crashed before the prelinker was run. I can't verify KDE as I don't use it. Actually, I don't normally use Gnome either as, IMHO, both tend to be resource hogs. However, I do use some Gnome programs and libraries.

Other successfully tested programs include Gftp, Mozilla, Xfree86 (obviously) Rox Desktop and xfwm4.


BluPhoenyx

Offline

#7 2003-01-13 18:00:38

ody
Member
From: Manchester, UK
Registered: 2002-08-12
Posts: 216
Website

Re: prelinking

hey apeiro, how about an entry in PKGBUILD's:

prelink=[yes|no]

and intergrate prelink into the makepkg build process, this way ppl can test prelinking and enable it in PKGBUILD's for apps that it works well with.. we would be the first distro to come with prelinking enabled ;p

just my 2cents.

Offline

#8 2004-08-16 01:02:57

hypermegachi
Member
Registered: 2004-07-25
Posts: 311

Re: prelinking

hey can you post your prelink.conf so i have an idea what it's like?

Offline

#9 2004-08-17 09:15:14

tehdely
Member
Registered: 2004-02-20
Posts: 148
Website

Re: prelinking

I haven't gotten around to actually prelinking anything yet, but I've had this PKGBUILD for elfutils forever (I needed elfutils so I could build RPM).  Perhaps it will be helpful to you.  You'll need to rebuild prelink after this, the existing PKGBUILD should be fine.

# Contributor: Michael Baehr <usemike@spamblocked.com>
# Adapted from the gentoo ebuild available at:
# any-gentoo-mirror/dev-libs/elfutils/elfutils-0.94-r1.ebuild

pkgname=elfutils
pkgver=0.94
pkgrel=1
pkgdesc="Utilities and libraries for manipulating and using ELF and other binary formats"
source=(http://distro.ibiblio.org/pub/linux/distributions/gentoo/distfiles//$pkgname-$pkgver.tar.gz)
md5sums=('de39e0af6b82b30d48e5d69b75aa2e0b')
url="http://www.redhat.com"
# this is one of those packages where there seems to be no main page for it
# and just a lot of RPMs... thanks gentoo :)
depends=(glibc)
replaces=(libelf)
build() {
   cd $startdir/src/$pkgname-$pkgver
   ./configure --prefix=/usr --enable-shared --program-prefix="eu-"
   make || return 1
   make prefix=$startdir/pkg/usr install
   rm -rf $startdir/pkg/var
}

[Arch GNUstep Repository] [ PKGBUILDS ]
[code][gnustep]
Server = ftp://blkwidow.lerp.com/pub/mirror/arch/gnustep[/code]

Offline

#10 2004-08-17 17:28:30

hypermegachi
Member
Registered: 2004-07-25
Posts: 311

Re: prelinking

actually i didn't need to compile.  it's already installed.  i just have no clue how to configured it.  i think it was in one of the TURS.

Offline

#11 2004-08-23 12:23:34

Thikasabrik
Member
Registered: 2004-02-23
Posts: 92

Re: prelinking

I'm using the new prelink package in the arch repos. Here are two problems I have...
1. the prelink.conf isn't installed
2. Prelink complains of non-PIC shared libraries like libz and libGL.

According to http://www.gentoo.org/doc/en/prelink-howto.xml this can be fixed by compiling these libs with the -fPIC flag. I can post a bug for this if that would be appropriate.

Offline

#12 2004-08-23 14:26:52

aCoder
Member
From: Medina, OH
Registered: 2004-03-07
Posts: 359
Website

Re: prelinking

Is your libGL from nVidia?  Mine is, and I haven't tried prelinking yet, but I certainly hope I wouldn't need to recompile a library I don't have the source for!  That could be difficult!


If you develop an ear for sounds that are musical it is like developing an ego. You begin to refuse sounds that are not musical and that way cut yourself off from a good deal of experience.
  - John Cage

Offline

#13 2004-08-23 14:44:29

Thikasabrik
Member
Registered: 2004-02-23
Posts: 92

Re: prelinking

It probably is, and if so it is best just to ignore it. Far more binaries link to libz than to libGL, and prelink will still complete its task anyway. I am unclear as to whether the 'non-PIC' errors prevent prelinking of the whole binary, or just with a certain library though... if it prevents the prelinking of that file completely then a *lot* of stuff is not being prelinked with the current libz. When I get a chance I will try fiddling with the zlib pkgbuild and see if it is easily fixed.

Offline

#14 2004-08-24 04:07:21

hypermegachi
Member
Registered: 2004-07-25
Posts: 311

Re: prelinking

dunno if i'm doing this right or not, but my prelink.conf looks something like this:

/opt/kde/bin
/opt/gnome/bin
blah blah blah...

i get a whole bunch of messages saying this and that can't be prelinked blah blah blah, and i don't notice any speed difference in kde (which i should).  i think my prelink.conf is wrong.

Offline

#15 2004-08-24 05:56:39

colnago
Member
From: Victoria, BC
Registered: 2004-03-25
Posts: 438

Re: prelinking

I think you need to have the lib dirs in the list also.  Here is the arch stuff:

# System
/usr/lib
/usr/bin
/lib
/bin
/usr/sbin

# X11
/usr/X11R6/lib
/usr/X11R6/bin
/usr/X11R6/share

# Gnome
/opt/gnome/lib
/opt/gnome/bin
/opt/gnome/share

# KDE/Qt
/opt/qt/lib
/opt/qt/bin
/opt/qt/share
/opt/kde/lib
/opt/kde/bin
/opt/kde/share

# XFCE
/opt/xfce4/lib
/opt/xfce4/bin
/opt/xfce4/share

Here is what  works for me on a debian system, note the flags:

# This config file contains a list of directories both with binaries
# and libraries prelink should consider by default.
# If a directory name is prefixed with `-l ', the directory hierarchy
# will be walked as long as filesystem boundaries are not crossed.
# If a directory name is prefixed with `-h ', symbolic links in a
# directory hierarchy are followed.
# Directories or files with `-b ' prefix will be blacklisted.
-b /lib/modules
-b /usr/lib/locale
-b /usr/lib/valgrind
-l /usr/local/sbin
-l /sbin
-l /usr/sbin
-l /usr/local/bin
-l /bin
-l /usr/bin
-l /usr/X11R6/bin
-l /usr/games
-l /usr/local/lib
-l /lib
-l /usr/lib
-l /usr/X11R6/lib

Offline

#16 2004-08-24 07:44:33

Pierre
Developer
From: Bonn
Registered: 2004-07-05
Posts: 1,964
Website

Re: prelinking

OK, I tried the new prelink-package. How can I check if prelinking was successfull? There were a lot of warnings about libGL and libgz.

Offline

#17 2004-08-24 12:06:56

i3839
Member
Registered: 2004-02-04
Posts: 1,185

Re: prelinking

I can't come that far, the error I get when I do "prelink -mv /lib/libc-2.3.3.so" is:

prelink: /lib/libc-2.3.3.so: Unknown i386 relocation type 14

I suspect that it's because of the newer kernel and the speudo linking to linux-gate.so, so it seems I'll have to wait for a new prelink version.

Offline

#18 2004-08-24 15:32:55

zeppelin
Member
From: Athens, Greece
Registered: 2004-03-05
Posts: 807
Website

Re: prelinking

sudo prelink /opt/gnome/bin/anjuta
prelink: /lib/libc-2.3.3.so: Unknown i386 relocation type 14

anjuta is excellent but also a beast smile

Offline

#19 2004-08-24 16:05:37

i3839
Member
Registered: 2004-02-04
Posts: 1,185

Re: prelinking

It's not Anjuta, the first library which links to linux-gate.so fails, that's my theory.

Offline

#20 2004-08-25 23:53:35

The Analog Kid
Member
From: Pennsylvania, USA
Registered: 2004-01-05
Posts: 27

Re: prelinking

Binaries need to be compiled with -fpic in order for prelink to work with them, I know Gnome isn't.

Offline

#21 2004-08-26 06:19:04

Pierre
Developer
From: Bonn
Registered: 2004-07-05
Posts: 1,964
Website

Re: prelinking

I think it would be great if the packages would be prelinkt by default or are there any problems?

Offline

#22 2004-08-26 09:53:13

Thikasabrik
Member
Registered: 2004-02-23
Posts: 92

Re: prelinking

The Analog Kid wrote:

Binaries need to be compiled with -fpic in order for prelink to work with them, I know Gnome isn't.

I thought it was just shared libraries, and I see no 'non-PIC' errors when prelinking gnome on my system.

Offline

#23 2004-08-26 13:00:22

i3839
Member
Registered: 2004-02-04
Posts: 1,185

Re: prelinking

The problems I had were because somehow the new prelink wasn't in the database I got from the Arch mirror, so I was using an old version. Syncing with the official Arch server and updating fixed it for me. The new prelink version is execshield aware.

There are some libs that can't be prelinked because of the missing -fpic, andsome Firefox libs can't be prelinked because of some unknown reason. prelink just aborts the prelinking.

Offline

#24 2004-08-28 00:39:04

dekernel
Member
From: Vassar, MI USA
Registered: 2004-03-22
Posts: 117

Re: prelinking

May I ask what version of binutils (I am assuming this is where the runtime loader is located) do I need to make sure I am taking advantage of the prelinking?

Offline

#25 2004-10-11 18:59:23

z4ziggy
Member
From: Israel
Registered: 2004-03-29
Posts: 573
Website

Re: prelinking

are there any plans to include the -fPIC in future packages (kde/gnome/etc)? tnx to Arch its a simple matter of adding it to the makepkg.conf ...

Offline

Board footer

Powered by FluxBB