Bug#772431: spectrwm: fix FTBFS with ld --as-needed

2014-12-12 Thread Andrea Bolognani
On Sat, Dec 06, 2014 at 06:15:52PM -0500, Logan Rosen wrote:

 Even though Debian doesn't use ld --as-needed by default, it is a good
 idea to make this change so that (1) we don't have to maintain a delta
 and (2) you don't need to change anything in case Debian makes this
 default in the future.

Hi Logan,

both are sensible points and I'm definitely going to look at this after
Jessie is out of the door.

I'm not familiar with the compiler flag we're discussing, though, so if
you'd kindly point to some documentation on the subject, that'd be much
appreciated :)

Have a nice day.

-- 
Andrea Bolognani e...@kiyuko.org
Resistance is futile, you will be garbage collected.


signature.asc
Description: Digital signature


Bug#772431: spectrwm: fix FTBFS with ld --as-needed

2014-12-12 Thread Logan Rosen
Hi Andrea,

Thanks so much for the quick response!

On Fri, Dec 12, 2014 at 2:55 PM, Andrea Bolognani e...@kiyuko.org wrote:

 I'm not familiar with the compiler flag we're discussing, though, so if
 you'd kindly point to some documentation on the subject, that'd be much
 appreciated :)


Sure - here is some documention on the Debian wiki about it:
https://wiki.debian.org/ToolChain/DSOLinking#Only_link_with_needed_libraries

The manpage for ld gives a more technical explanation of the option.

Hope this helps! Let me know if you have any questions about it.

Logan


Bug#772431: spectrwm: fix FTBFS with ld --as-needed

2014-12-06 Thread Logan Rosen
Package: spectrwm
Version: 2.6.0-1
Severity: normal
Tags: patch
User: ubuntu-de...@lists.ubuntu.com
Usertags: origin-ubuntu vivid ubuntu-patch

Dear Maintainer,

In Ubuntu, we use ld --as-needed by default in the toolchain, and you package 
fails to build from source with that option enabled because of the way 
libraries are linked.

Even though Debian doesn't use ld --as-needed by default, it is a good idea to 
make this change so that (1) we don't have to maintain a delta and (2) you 
don't need to change anything in case Debian makes this default in the future.

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

  * debian/patches/linking-order.diff: Change linking order to fix FTBFS with
ld --as-needed.

Thanks for considering the patch.

Logan Rosen

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

Kernel: Linux 3.16.0-25-generic (SMP w/1 CPU core)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
diff -Nru spectrwm-2.6.0/debian/patches/linking-order.diff spectrwm-2.6.0/debian/patches/linking-order.diff
--- spectrwm-2.6.0/debian/patches/linking-order.diff	1969-12-31 19:00:00.0 -0500
+++ spectrwm-2.6.0/debian/patches/linking-order.diff	2014-12-06 03:00:00.0 -0500
@@ -0,0 +1,20 @@
+--- a/linux/Makefile
 b/linux/Makefile
+@@ -20,7 +20,7 @@
+ all: spectrwm libswmhack.so.$(LIBVERSION)
+ 
+ spectrwm: spectrwm.o linux.o
+-	$(CC) $(MAINT_LDFLAGS) $(LDFLAGS) $(MAINT_LDLIBS) $(LDLIBS) -o $@ $+
++	$(CC) $(MAINT_LDFLAGS) $(LDFLAGS) -o $@ $+ $(MAINT_LDLIBS) $(LDLIBS)
+ 
+ spectrwm.o: ../spectrwm.c ../version.h tree.h util.h
+ 	$(CC) $(MAINT_CFLAGS) $(CFLAGS) $(MAINT_CPPFLAGS) $(CPPFLAGS) -c -o $@ $
+@@ -29,7 +29,7 @@
+ 	$(CC) $(MAINT_CFLAGS) $(CFLAGS) $(MAINT_CPPFLAGS) $(CPPFLAGS) -c -o $@ $
+ 
+ libswmhack.so.$(LIBVERSION): swm_hack.so
+-	$(CC) $(MAINT_LDFLAGS) $(LDFLAGS) $(MAINT_LDLIBS) $(LDLIBS) -Wl,-soname,$@ -shared -fpic -o $@ $+
++	$(CC) $(MAINT_LDFLAGS) $(LDFLAGS) -Wl,-soname,$@ -shared -fpic -o $@ $+ $(MAINT_LDLIBS) $(LDLIBS)
+ 
+ swm_hack.so: ../lib/swm_hack.c
+ 	$(CC) $(MAINT_CFLAGS) $(CFLAGS) $(MAINT_CPPFLAGS) $(CPPFLAGS) -fpic -DPIC -c -o $@ $
diff -Nru spectrwm-2.6.0/debian/patches/series spectrwm-2.6.0/debian/patches/series
--- spectrwm-2.6.0/debian/patches/series	2014-09-09 16:52:40.0 -0400
+++ spectrwm-2.6.0/debian/patches/series	2014-12-06 02:55:42.0 -0500
@@ -4,3 +4,4 @@
 D01-skip-compatibility-symlinks.diff
 D02-change-default-programs.diff
 D03-make-default-programs-optional.diff
+linking-order.diff