[Debian-med-packaging] Bug#677721: dcmtk: Libraries are underlinked

Ilya Barygin randomaction at ubuntu.com
Sat Jun 16 13:13:39 UTC 2012


Package: dcmtk
Version: 3.6.0-11
Severity: normal
Tags: upstream patch
User: debian-gcc at lists.debian.org
Usertags: ld-as-needed

Hello,

We're having problems building some packages using dcmtk in Ubuntu,
because dcmtk's libraries are underlinked and that causes build failure
with Ubuntu's default linker settings (--as-needed and
--no-copy-dt-needed-entries). Here's an example, with build logs:
https://launchpad.net/ubuntu/+source/plastimatch/1.5.10+dfsg0-1

So here's a patch that would fix that problem, making all libraries in
dcmtk properly linked. It's based on patch from bug #674586 (that one
only fixed enough to allow dcmtk itself to be built).

So it'll be possible to build with --no-undefined:

diff -Nru dcmtk-3.6.0/debian/rules dcmtk-3.6.0/debian/rules
--- dcmtk-3.6.0/debian/rules	2012-05-31 14:23:17.000000000 +0400
+++ dcmtk-3.6.0/debian/rules	2012-06-16 15:57:08.000000000 +0400
@@ -20,9 +20,7 @@
 # Library version
 LIB_VERSION=2.0.0

-# the build system is currently too complex to modify to handle
--no-undefined
-# leave undefined symbols for now
-export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed #-Wl,--no-undefined
+export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed -Wl,--no-undefined
 # build system is too complex to modify for support -fPIE to exe and
-fPIC to
 # shared libs we would need to use libtool or equivalent to filter
shared libs
 # from exe
@@ -85,7 +83,7 @@

 	mv config/Makefile.def config/Makefile.def.static && \
 	sed -e '/^CFLAGS =/s/-O -/-fPIC -/' -e '/^CXXFLAGS =/s/-O -/-fPIC -/' \
-	-e '/^AR =/s/ar/gcc/' -e '/^ARFLAGS =/s/cruv/-lstdc++ -lz -lxml2
-lpthread -lssl -lcrypto $(LDFLAGS) -shared -Wl,-soname,\$$\@.2 -o/' \
+	-e '/^AR =/s/ar/g++/' -e '/^ARFLAGS =/s/cruv/$(LDFLAGS) -shared
-Wl,-soname,\$$\@.2 -o/' \
 	-e '/^LIBEXT =/s/a/so/' -e '/^RANLIB =/s/ranlib/:/' \
 	<config/Makefile.def.static >config/Makefile.def && \
 	$(MAKE) libsrc-all && \


The patch is a bit extensive, so I'm a little hesitant about putting it
straight into Ubuntu; opinions (and/or patch adoption) welcome.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: underlink.patch
Type: text/x-patch
Size: 15584 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/debian-med-packaging/attachments/20120616/505bd736/attachment.bin>


More information about the Debian-med-packaging mailing list