[Nix-dev] libtool + linking

Armijn Hemel armijn at uulug.nl
Tue Mar 29 14:07:07 CEST 2005


On Mon, Mar 28, 2005 at 07:46:39PM +0200, Eelco Dolstra wrote:

> > I'm trying to make a Nix-expression for RPM. RPM needs zlib, so I have
> > zlib as one of the buildInputs. The configure script for RPM finds zlib,
> > but during linking it fails:
> > 
> > gcc -g -O2 -fPIC -DPIC -D_GNU_SOURCE -D_REENTRANT -Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes -Wno-char-subscripts -D_GNU_SOURCE -D_REENTRANT -Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes -Wno-char-subscripts -o file -static file.o  ./.libs/libfmagic.a -lz
> > /nix/store/d50ef8fb6b99a53b9e3b800f3f7eba84-binutils-2.15/bin/ld: cannot find -lz
> 
> It's probably the `-static' flag.  Zlib is only available (in Nixpkgs) as a dynamic library.

Is there a reason it's not there as a static library?

> Maybe RPM can also be built dynamically linked.

It should be doable, but in the distribution for RPM it appears that
the libtool scripts cause the static linking. So, I can patch the
libtool scripts and/or Makefiles so it won't use the static flag. I'm not
much of a libtool hero, but is there a cleaner way?

armijn

-- 
 ---------------------------------------------------------------------------
  armijn at uulug.nl | http://www.uulug.nl/ | UULug: Utrecht Linux Users Group
 ---------------------------------------------------------------------------



More information about the nix-dev mailing list