Package: cowdancer
Version: 0.65
Severity: important
Tags: patch
User: [email protected]
Usertags: origin-ubuntu ubuntu-patch oneiric

cowdancer fails to build with a linker that defaults to --as-needed, as
shown in this Ubuntu build log:

  
https://launchpadlibrarian.net/83906438/buildlog_ubuntu-precise-i386.cowdancer_0.65_FAILEDTOBUILD.txt.gz

This is because of incorrect link ordering: it puts libraries before the
objects that use them rather than after.  See:

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

The following patch fixes this.

  * Fix link order to list libraries after the objects that require them.
  * Use -pthread rather than -lpthread, since it should be a superset, it's
    what's recommended in pthread_create(3), and it isn't so sensitive to
    link order.

diff -Nru cowdancer-0.65/Makefile cowdancer-0.65ubuntu1/Makefile
--- cowdancer-0.65/Makefile     2009-11-29 10:26:13.000000000 +0000
+++ cowdancer-0.65ubuntu1/Makefile      2011-11-11 14:32:37.000000000 +0000
@@ -37,7 +37,7 @@
        $(INSTALL_FILE) bash_completion.cowbuilder 
$(DESTDIR)/etc/bash_completion.d/cowbuilder
 
 libcowdancer.so: cowdancer.lo ilistcreate.lo
-       $(CC) $(CFLAGS) -ldl -shared -o $@ $^
+       $(CC) $(CFLAGS) -shared -o $@ $^ -ldl
 
 cow-shell: cow-shell.o ilistcreate.o
        $(CC) $(CFLAGS) -o $@ $^
diff -Nru cowdancer-0.65/tests/015_test_ilistdelete.c 
cowdancer-0.65ubuntu1/tests/015_test_ilistdelete.c
--- cowdancer-0.65/tests/015_test_ilistdelete.c 2009-06-24 15:47:46.000000000 
+0100
+++ cowdancer-0.65ubuntu1/tests/015_test_ilistdelete.c  2011-11-11 
14:48:57.000000000 +0000
@@ -1,4 +1,4 @@
-/*BINFMTC: -lpthread
+/*BINFMTC: -pthread
  *
  * Check deleting .ilist file is handled gracefully.
  *

Thanks,

-- 
Colin Watson                                       [[email protected]]



-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to