[Debian-med-packaging] Bug#674586: dcmtk: FTBFS because of underlinked library

Ilya Barygin randomaction at ubuntu.com
Fri May 25 17:29:20 UTC 2012


Package: dcmtk
Version: 3.6.0-10
Severity: normal
Tags: upstream patch
User: peter.fritzsche at gmx.de
Usertags: unresolved-symbols-so

dcmtk fails to build with --no-copy-dt-needed-entries linker setting, because
some of the shared libraries produced during build and later used in tests are
underlinked.

c++ -O -I/usr/include/libxml2 -D_REENTRANT -D_XOPEN_SOURCE_EXTENDED -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -D_BSD_COMPAT -D_OSF_SOURCE -D_POSIX_C_SOURCE=199506L -Wall   -L../libsrc -o tststack tststack.o -lofstd -lrt -lpthread -lnsl 
.../libsrc/libofstd.so: undefined reference to `sem_init'
.../libsrc/libofstd.so: undefined reference to `pthread_mutex_trylock'
.../libsrc/libofstd.so: undefined reference to `pthread_rwlock_trywrlock'
.../libsrc/libofstd.so: undefined reference to `pthread_key_create'
.../libsrc/libofstd.so: undefined reference to `pthread_rwlock_rdlock'
.../libsrc/libofstd.so: undefined reference to `pthread_rwlock_tryrdlock'
.../libsrc/libofstd.so: undefined reference to `sem_destroy'
.../libsrc/libofstd.so: undefined reference to `pthread_getspecific'
.../libsrc/libofstd.so: undefined reference to `pthread_rwlock_wrlock'
.../libsrc/libofstd.so: undefined reference to `pthread_create'
.../libsrc/libofstd.so: undefined reference to `pthread_rwlock_destroy'
.../libsrc/libofstd.so: undefined reference to `pthread_rwlock_init'
.../libsrc/libofstd.so: undefined reference to `pthread_rwlock_unlock'
.../libsrc/libofstd.so: undefined reference to `sem_post'
.../libsrc/libofstd.so: undefined reference to `sem_trywait'
.../libsrc/libofstd.so: undefined reference to `pthread_setspecific'
.../libsrc/libofstd.so: undefined reference to `sem_wait'
.../libsrc/libofstd.so: undefined reference to `pthread_join'
collect2: error: ld returned 1 exit status


See also
http://wiki.debian.org/ToolChain/DSOLinking#Unresolved_symbols_in_shared_libraries
http://wiki.mandriva.com/en/Underlinking

Patch from Ubuntu follows.
https://launchpad.net/ubuntu/+source/dcmtk/3.6.0-10ubuntu1

Description: fix underlinked libraries
 Each of these libraries is built twice, first as .so with gcc, then as .a with
 ar. We need to provide libraries only when dynamic library is built.
Author: Ilya Barygin <randomaction at ubuntu.com>

--- a/ofstd/libsrc/Makefile.in
+++ b/ofstd/libsrc/Makefile.in
@@ -29,7 +29,11 @@
 
 
 $(library): $(objs)
+ifeq ($(AR),ar)
 	$(AR) $(ARFLAGS) $@ $(objs)
+else
+	$(AR) $(ARFLAGS) $@ $(objs) $(LIBS)
+endif
 	$(RANLIB) $@
 
 
--- a/dcmsign/libsrc/Makefile.in
+++ b/dcmsign/libsrc/Makefile.in
@@ -34,7 +34,11 @@
 
 
 $(library): $(objs)
+ifeq ($(AR),ar)
 	$(AR) $(ARFLAGS) $@ $(objs)
+else
+	$(AR) $(ARFLAGS) $@ $(objs) $(OPENSSLLIBS)
+endif
 	$(RANLIB) $@
 
 

-- System Information:
Debian Release: wheezy/sid
  APT prefers precise-updates
  APT policy: (500, 'precise-updates'), (500, 'precise-security'), (500, 'precise-proposed'), (500, 'precise'), (100, 'precise-backports')
Architecture: i386 (i686)

Kernel: Linux 3.2.0-24-generic (SMP w/2 CPU cores)
Locale: LANG=ru_RU.UTF-8, LC_CTYPE=ru_RU.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash





More information about the Debian-med-packaging mailing list