Package: trafficserver
Version: 3.0.0-1
Severity: normal
Tags: upstream 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/74018337/buildlog_ubuntu-oneiric-i386.trafficserver_3.0.0-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/trafficserver/3.0.0-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: change order of libraries so that it's possible to link with
 --as-needed option.
Author: Ilya Barygin <[email protected]>
--- trafficserver-3.0.0.orig/mgmt/Makefile.am
+++ trafficserver-3.0.0/mgmt/Makefile.am
@@ -97,7 +97,7 @@
   $(top_builddir)/mgmt/tools/libinkconfigapi.a \
   $(top_builddir)/lib/ts/libtsutil.la \
   @LIBEXPAT@ @LIBPCRE@ \
-  @LIBSSL@ @LIBTCL@ @LIBICONV@ \
+  @LIBTCL@ @LIBICONV@ \
   -lm @LIBDL@ @LIBSOCKET@ @LIBNSL@ @LIBRESOLV@ \
   @LIBTHREAD@ @LIBRT@ @LIBEXECINFO@ @LIBCAP@
 
@@ -107,3 +107,5 @@
   $(top_builddir)/lib/wccp/libwccp.a \
   $(top_builddir)/lib/tsconfig/libtsconfig.la
 endif
+
+traffic_manager_LDADD += @LIBSSL@
--- trafficserver-3.0.0.orig/mgmt/Makefile.in
+++ trafficserver-3.0.0/mgmt/Makefile.in
@@ -546,9 +546,9 @@
 	$(top_builddir)/mgmt/tools/libinksysapi.a \
 	$(top_builddir)/mgmt/tools/libinkconfigapi.a \
 	$(top_builddir)/lib/ts/libtsutil.la @LIBEXPAT@ @LIBPCRE@ \
-	@LIBSSL@ @LIBTCL@ @LIBICONV@ -lm @LIBDL@ @LIBSOCKET@ @LIBNSL@ \
+	@LIBTCL@ @LIBICONV@ -lm @LIBDL@ @LIBSOCKET@ @LIBNSL@ \
 	@LIBRESOLV@ @LIBTHREAD@ @LIBRT@ @LIBEXECINFO@ @LIBCAP@ \
-	$(am__append_1)
+	$(am__append_1) @LIBSSL@
 all: all-recursive
 
 .SUFFIXES:

Reply via email to