Bug#842886: sbd: FTBFS with ld --as-needed

2016-12-20 Thread Ferenc Wágner
At the same time, traces of libcoroipcc should be eradicated from
configure.ac as well.
-- 
Feri



Bug#842886: sbd: FTBFS with ld --as-needed

2016-11-01 Thread Logan Rosen
Package: sbd
Version: 1.2.0-109-gc511b06-2
Severity: normal
Tags: patch
User: ubuntu-de...@lists.ubuntu.com
Usertags: origin-ubuntu zesty ubuntu-patch

Dear Maintainer,

sbd currently fails to build with ld --as-needed, which needs the linked 
libraries
to come after the objects that need them. LDFLAGS should only be used for 
linker options.

See 
https://wiki.debian.org/ToolChain/DSOLinking#Only_link_with_needed_libraries 
for more
information.

In Ubuntu, the attached patch was applied to achieve the following:

  * Merge from Debian unstable. Remaining changes:
- debian/patches/ld-as-needed.patch: Use LDADD instead of LDFLAGS to fix
  FTBFS with ld --as-needed.

Thanks for considering the patch.

Logan Rosen

-- System Information:
Debian Release: stretch/sid
  APT prefers yakkety-updates
  APT policy: (500, 'yakkety-updates'), (500, 'yakkety-security'), (500, 
'yakkety')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.4.0-21-generic (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) (ignored: LC_ALL 
set to en_US.utf8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
diff -Nru sbd-1.2.0-109-gc511b06/debian/patches/ld-as-needed.patch sbd-1.2.0-109-gc511b06/debian/patches/ld-as-needed.patch
--- sbd-1.2.0-109-gc511b06/debian/patches/ld-as-needed.patch	1969-12-31 19:00:00.0 -0500
+++ sbd-1.2.0-109-gc511b06/debian/patches/ld-as-needed.patch	2016-05-22 17:40:07.0 -0400
@@ -0,0 +1,15 @@
+Description: use LDADD instead of LDFLAGS to fix FTBFS with ld --as-needed
+Author: Logan Rosen 
+Bug: https://github.com/ClusterLabs/sbd/pull/9
+Last-Update: 2016-05-22
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- a/src/Makefile.am
 b/src/Makefile.am
+@@ -11,5 +11,5 @@
+ sbd_SOURCES += sbd-md.c
+ endif
+ 
+-sbd_LDFLAGS = $(glib_LIBS) $(libcoroipcc_LIBS)
++sbd_LDADD = $(glib_LIBS) $(libcoroipcc_LIBS)
+ 
diff -Nru sbd-1.2.0-109-gc511b06/debian/patches/series sbd-1.2.0-109-gc511b06/debian/patches/series
--- sbd-1.2.0-109-gc511b06/debian/patches/series	2016-07-04 01:46:25.0 -0400
+++ sbd-1.2.0-109-gc511b06/debian/patches/series	2016-11-02 00:12:38.0 -0400
@@ -1,3 +1,4 @@
 sbd.service.in-kill-path
 sbd-service_sysconfig-vs-default.patch
 cl_log-format-security.patch
+ld-as-needed.patch