(Not-)Linking with zlib
mauelshagen at redhat.com
Tue Nov 7 09:25:50 UTC 2006
On Sun, Nov 05, 2006 at 05:59:06PM +0100, Loïc Minier wrote:
> dmraid-1.0.0.rc13 started linking with zlib for crc32(), this is used
> to support "SNIA DDF1 v1.0 metadata". Debian has libdevmapper in /lib
> and zlib in /usr/lib, so this makes the dynamic dmraid binary we're
> currently shipping unusable until your /usr is mounted.
> I see the RPM packages are shipping a dmraid.static alternative, but
> they seem to require /usr by default as well.
> It would be nice to avoid this dependency; solutions we have discussed
> for Debian in <http://bugs.debian.org/396762> were:
> 1) copy crc32 from zlib
> 2) implement crc32
> 3) link statically with zlib (and only zlib)
> crc32() seems trivial to implement in C, here's a sample implementation
> with some optimizations (you might want to chop off the optims since
> metadata is probably not crc-ed a lot of times):
> I attach the patch to force linking statically with zlib, by Steve
> Langasek, but beware not to add any lib after zlib in the Makefile or
> these would *always* be linked dynamically obviously.
> You might want to drop the zlib dep because of the +12KB it causes
> (crc32() is IMO smaller).
Yes, will very likely do in rc14.
> Loïc Minier <lool at dooz.org>
> diff -u dmraid-1.0.0.rc13/debian/changelog dmraid-1.0.0.rc13/debian/changelog
> --- dmraid-1.0.0.rc13/debian/changelog
> +++ dmraid-1.0.0.rc13/debian/changelog
> @@ -1,3 +1,12 @@
> +dmraid (1.0.0.rc13-1.1) unstable; urgency=low
> + * Non-maintainer upload.
> + * Statically link against libz, since we only need crc32 from it and
> + we can't have binaries in /sbin depending on libs in /usr/lib.
> + Closes: #396762.
> + -- Steve Langasek <vorlon at debian.org> Fri, 3 Nov 2006 14:38:54 -0800
> dmraid (1.0.0.rc13-1) unstable; urgency=low
> * New upstream release; closes: #391499.
> only in patch2:
> --- dmraid-1.0.0.rc13.orig/1.0.0.rc13/tools/Makefile.in
> +++ dmraid-1.0.0.rc13/1.0.0.rc13/tools/Makefile.in
> @@ -20,7 +20,7 @@
> -DMRAIDLIBS=-ldmraid -lz
> +DMRAIDLIBS=-ldmraid -Wl,-Bstatic -lz -Wl,-Bdynamic
> include $(top_srcdir)/make.tmpl
> Ataraid-list mailing list
> Ataraid-list at redhat.com
Heinz Mauelshagen Red Hat GmbH
Consulting Development Engineer Am Sonnenhang 11
Storage Development 56242 Marienrachdorf
Mauelshagen at RedHat.com PHONE +49 171 7803392
FAX +49 2626 924446
More information about the Ataraid-list