Package: xscorch Version: 0.2.1~pre2-3 Severity: normal Tags: upstream patch User: debian-...@lists.debian.org 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/70990065/buildlog_ubuntu-oneiric-i386.xscorch_0.2.1~pre2-3_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/xscorch/0.2.1~pre2-3ubuntu1 -- 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 in makefiles. This fixes FTBFS with --as-needed linker option. Author: Ilya Barygin <bary...@gmail.com> Bug-Ubuntu: https://launchpad.net/bugs/756217 --- xscorch-0.2.1~pre2.orig/Makefile.am +++ xscorch-0.2.1~pre2/Makefile.am @@ -45,9 +45,6 @@ xscorch_SOURCES = \ xscorch.c xscorch_LDADD = \ - -lm \ - $(GTK_LIBS) \ - $(LIBMIKMOD_LIBS) \ sgame/libscorch_game.a \ sgtk/libscorch_gtk.a \ sgtk/swidgets/libscorch_widget_gtk.a \ @@ -57,14 +54,15 @@ sutil/libscorch_util.a \ sgame/libscorch_game.a \ libj/jreg/libjreg.a \ - libj/jstr/libjstr.a + libj/jstr/libjstr.a \ + -lm \ + $(GTK_LIBS) \ + $(LIBMIKMOD_LIBS) xscorch_server_SOURCES = \ xscorch.c xscorch_server_LDADD = \ - -lm \ - $(LIBREADLINE_LIBS) \ sgame/libscorch_game.a \ sconsole/libscorch_console.a \ sai/libscorch_ai.a \ @@ -73,7 +71,9 @@ sutil/libscorch_util.a \ sgame/libscorch_game.a \ libj/jreg/libjreg.a \ - libj/jstr/libjstr.a + libj/jstr/libjstr.a \ + -lm \ + $(LIBREADLINE_LIBS) work-list: --- xscorch-0.2.1~pre2.orig/Makefile.in +++ xscorch-0.2.1~pre2/Makefile.in @@ -284,11 +284,7 @@ @MIKMOD_TRUE@MIKMOD_LD_ADD = ssound/libscorch_sound.a xscorch_SOURCES = \ xscorch.c - xscorch_LDADD = \ - -lm \ - $(GTK_LIBS) \ - $(LIBMIKMOD_LIBS) \ sgame/libscorch_game.a \ sgtk/libscorch_gtk.a \ sgtk/swidgets/libscorch_widget_gtk.a \ @@ -298,14 +294,15 @@ sutil/libscorch_util.a \ sgame/libscorch_game.a \ libj/jreg/libjreg.a \ - libj/jstr/libjstr.a + libj/jstr/libjstr.a \ + -lm \ + $(GTK_LIBS) \ + $(LIBMIKMOD_LIBS) + xscorch_server_SOURCES = \ xscorch.c - xscorch_server_LDADD = \ - -lm \ - $(LIBREADLINE_LIBS) \ sgame/libscorch_game.a \ sconsole/libscorch_console.a \ sai/libscorch_ai.a \ @@ -314,7 +311,9 @@ sutil/libscorch_util.a \ sgame/libscorch_game.a \ libj/jreg/libjreg.a \ - libj/jstr/libjstr.a + libj/jstr/libjstr.a \ + -lm \ + $(LIBREADLINE_LIBS) INCLUDES = -Isgame -Isgtk all: config.h