Package: tty-clock
Version: 1.0-4
Severity: wishlist
Tags: patch
User: debian-...@lists.debian.org
Usertags: ld-as-needed

the package tty-clock fails to build when using the linker flag
--as-needed
This is caused by the libraries are being placed before the objects
using it. In that case the libraries are not registered as needed and is
dropped.

See the buildlog in ubuntu:
https://launchpadlibrarian.net/83152614/buildlog_ubuntu-precise-i386.tty-clock_1.0-3_FAILEDTOBUILD.txt.gz

attached patch fixes the issue.
Description: fix build with ld --as-needed
 libraries must be behind objects needing their symbols
 when building with ld --as-needed
Author: Julian Taylor <jtaylor.deb...@googlemail.com>
--- tty-clock-1.0.orig/Makefile
+++ tty-clock-1.0/Makefile
@@ -8,14 +8,14 @@ BIN = tty-clock
 PREFIX ?= /usr/local
 INSTALLPATH = ${DESTDIR}${PREFIX}/bin
 CFLAGS = -Wall -g
-LDFLAGS = -lncurses
+LIBS = -lncurses
 
 
 tty-clock : ${SRC}
 
 	@echo "build ${SRC}"
-	@echo "CC ${CFLAGS} ${LDFLAGS} ${SRC}"
-	@${CC} ${CFLAGS} ${LDFLAGS} ${SRC} -o ${BIN}
+	@echo "CC ${CFLAGS} ${LDFLAGS} ${SRC} ${LIBS}"
+	@${CC} ${CFLAGS} ${LDFLAGS} ${SRC} ${LIBS} -o ${BIN}
 
 install : ${BIN}
 

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to