Package: libpthread-workqueue
Version: 0.7-1
Severity: normal
Tags: patch
User: [email protected]
Usertags: ld-as-needed

The package fails to build when --as-needed linker option is enabled,
because of incorrect order of parameters passed to ld. Here's a log of
failed build in Ubuntu:
https://launchpadlibrarian.net/73557546/buildlog_ubuntu-oneiric-i386.libpthread-workqueue_0.7-1_FAILEDTOBUILD.txt.gz

See also
http://wiki.debian.org/ToolChain/DSOLinking#Only_link_with_needed_libraries

The attached patch was used in Ubuntu to fix the problem.
https://launchpad.net/ubuntu/+source/libpthread-workqueue/0.7-1ubuntu1

-- System Information:
Debian Release: wheezy/sid
  APT prefers oneiric
  APT policy: (500, 'oneiric')
Architecture: i386 (i686)

Kernel: Linux 2.6.38-10-generic (SMP w/2 CPU cores)
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/dash
Description: Move libraries from LDFLAGS to LDADD. This corrects order of ld
 parameters and fixes FTBFS.
Author: Ilya Barygin <[email protected]>
--- libpthread-workqueue-0.7.orig/config.inc
+++ libpthread-workqueue-0.7/config.inc
@@ -4,7 +4,7 @@ abi_major="0"
 abi_minor="0"
 abi_version="$abi_major.$abi_minor"
 cflags="-Wall -Wextra -Werror -D_XOPEN_SOURCE=600 -D__EXTENSIONS__ -D_GNU_SOURCE -std=c99 -I./include -I./src"
-ldflags="-lpthread -lrt"
+ldadd="-lpthread -lrt"
 sources='src/api.c src/$(API)/manager.c src/$(API)/thread_info.c src/witem_cache.c src/$(API)/thread_rt.c'
 libdepends=""
 deps="src/*.h"

Reply via email to