(Not-)Linking with zlib

Loïc Minier <[email protected]>
Newsgroups gmane.linux.ataraid
Message-ID <[email protected]>
        Hi,

 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):
    <http://www.w3.org/TR/PNG/#D-CRCAppendix>

 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).

   Bye,
-- 
Loïc Minier <[email protected]>

_______________________________________________
Ataraid-list mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/ataraid-list
dmraid-396762.patch (text/plain, 868 B)
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 <[email protected]>  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:
unchanged:
--- 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 @@
 TARGETS=\
 	dmraid
 
-DMRAIDLIBS=-ldmraid -lz
+DMRAIDLIBS=-ldmraid -Wl,-Bstatic -lz -Wl,-Bdynamic
 
 include $(top_srcdir)/make.tmpl
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.