Package: linthesia
Version: 0.4.2-2
Severity: normal
Tags: 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://launchpad.net/ubuntu/+source/linthesia/0.4.2-2/+build/2555600/+files/buildlog_ubuntu-oneiric-i386.linthesia_0.4.2-2_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/linthesia/0.4.2-2ubuntu1

-- 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: Correct order of ld parameters to fix FTBFS.
Author: Ilya Barygin <[email protected]>
Bug-Ubuntu: https://launchpad.net/bugs/770788
--- linthesia-0.4.2.orig/src/Makefile
+++ linthesia-0.4.2/src/Makefile
@@ -5,7 +5,7 @@ GRAPHDIR?=../graphics
 CXX = g++
 CXXFLAGS =  -I . -I libmidi -Wall -ansi -O2
 CXXFLAGS += `pkg-config --cflags gtkmm-2.4 gconfmm-2.6 gtkglextmm-1.2 alsa` -DGRAPHDIR="\"$(GRAPHDIR)\""
-LDFLAGS = `pkg-config --libs gtkmm-2.4 gconfmm-2.6 gtkglextmm-1.2 alsa`
+LDLIBS = `pkg-config --libs gtkmm-2.4 gconfmm-2.6 gtkglextmm-1.2 alsa`
 TARGET = linthesia
 
 all: $(TARGET)
@@ -16,7 +16,7 @@ $(TARGET): main.o LinthesiaError.o UserS
 	MenuLayout.o DeviceTile.o StringTile.o MidiComm.o \
 	TrackSelectionState.o TrackTile.o PlayingState.o \
 	StatsState.o KeyboardDisplay.o libmidi/libmidi.a
-	$(CXX) $(LDFLAGS) -o $@ $^
+	$(CXX) $(LDFLAGS) -o $@ $^ $(LDLIBS)
 
 libmidi/libmidi.a:
 	$(MAKE) -C libmidi

Reply via email to