lfs bugs and/or changes

Zack Winkles winkie at linuxfromscratch.org
Sat May 10 11:12:42 PDT 2003

Gerard Beekmans (gerard at linuxfromscratch.org) wrote:
> > 10. Build proper bzip2 libraries. We build the correct libbz2.so, as the
> >    Makefile adds -fPIC by itself, but then we simply run make, which adds
> >    all this PIC code into a static libbz2.a, which is completely
> >    unnecessary and unoptimal. In doing this, we slow down anything that
> >    uses libbz2.a by 20%. The ONLY thing needed to build a proper libbz2.a
> Do you have test results to show that 20% slowdown?

I just did some tests, and though it's not as significant as I first
though, it is significant. To test it I compiled bzip2 with an -fPIC'd
libbz2.a and with a non-fPIC'd libbz2.a, then compressed
linux-2.5.69.tar with each of them 3 times over. I only took into
account user time, not kernel time, so the load of the system doesn't
matter. The times shown are the averages of the three runs.

bzip2 (-fPIC):		98.1 seconds
bzip2 (no -fPIC):	91.274 seconds

> > 11. Build proper zlib libraries. The reasoning behind this is the exact
> >    same as that of libbz2, but the procedure is a bit more involved. The
> >    following commands do what we need:
> > 	CFLAGS="$CFLAGS -fPIC" ./configure --prefix=/usr --shared
> > 	make
> > 	make install
> > 	make clean
> > 	./configure --prefix=/usr
> > 	make
> > 	make install
> Is it just asthetics or is there also a 20% or so slowdown in using static 
> libraries like you claimed for bzip2?

I did a very similar procedure with zlib, this time using the minigzip
test program included with zlib. The times are as follows:

minigzip (-fPIC):	18.027 seconds
minigzip (no -fPIC):	16.616 seconds

Take this for what it's worth.


Unsubscribe: send email to listar at linuxfromscratch.org
and put 'unsubscribe lfs-dev' in the subject header of the message

More information about the lfs-dev mailing list