Package: lv2file
Version: 0.8-2
Severity: normal
Tags: 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/73557594/buildlog_ubuntu-oneiric-i386.lv2file_0.8-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/lv2file/0.8-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 parameters for ld to fix build problem with
 --as-needed option.
Author: Ilya Barygin <bary...@gmail.com>
--- lv2file-0.8.orig/Makefile
+++ lv2file-0.8/Makefile
@@ -1,5 +1,5 @@
 CFLAGS = -O3 -Wall --std=c99 `pkg-config --cflags argtable2 sndfile slv2`
-LDFLAGS = `pkg-config --libs argtable2 sndfile slv2` -lm
+LDLIBS = `pkg-config --libs argtable2 sndfile slv2` -lm
 BINDIR = $(DESTDIR)/usr/bin
 INSTALL_PROGRAM = install
 
@@ -8,7 +8,7 @@ all: lv2file
 lv2file.o: lv2file.c
 	$(CC) -c $(CFLAGS) -o lv2file.o lv2file.c
 lv2file: lv2file.o
-	$(CC) $(LDFLAGS) lv2file.o -o lv2file
+	$(CC) $(LDFLAGS) lv2file.o -o lv2file $(LDLIBS)
 tarball: lv2file
 	cd ..;tar -czvf lv2file.tar.gz lv2file/*;
 .PHONY: install uninstall clean

Reply via email to