Package: usbrelay
Version: 0.4-1
Severity: normal
Tags: patch
User: ubuntu-de...@lists.ubuntu.com
Usertags: origin-ubuntu disco ubuntu-patch

Dear Maintainer,

usbrelay currently fails to build from source with ld --as-needed, which
is enabled by default in Ubuntu. This linker option requires that
libraries be placed after the files that need them.

In Ubuntu, the attached patch was applied to achieve the following:

  * d/p/ld-as-needed.patch: Add libraries to LIBS instead of LDFLAGS to fix
    FTBFS with ld --as-needed.

Thanks for considering the patch.

Logan Rosen

-- System Information:
Debian Release: buster/sid
  APT prefers cosmic-updates
  APT policy: (500, 'cosmic-updates'), (500, 'cosmic-security'), (500, 
'cosmic'), (400, 'cosmic-proposed'), (100, 'cosmic-backports')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.18.0-12-generic (SMP w/8 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
diff -Nru usbrelay-0.4/debian/patches/ld-as-needed.patch 
usbrelay-0.4/debian/patches/ld-as-needed.patch
--- usbrelay-0.4/debian/patches/ld-as-needed.patch      1969-12-31 
19:00:00.000000000 -0500
+++ usbrelay-0.4/debian/patches/ld-as-needed.patch      2018-12-15 
17:17:46.000000000 -0500
@@ -0,0 +1,16 @@
+--- a/Makefile
++++ b/Makefile
+@@ -1,11 +1,11 @@
+ CFLAGS += -O2 -Wall
+ HIDAPI = hidraw
+-LDFLAGS += -lhidapi-$(HIDAPI)
++LIBS += -lhidapi-$(HIDAPI)
+ 
+ all: usbrelay
+ 
+ usbrelay: usbrelay.c
+-      $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ $<
++      $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LIBS)
+ 
+ clean:
+       rm -f usbrelay
diff -Nru usbrelay-0.4/debian/patches/series usbrelay-0.4/debian/patches/series
--- usbrelay-0.4/debian/patches/series  2018-10-21 11:21:09.000000000 -0400
+++ usbrelay-0.4/debian/patches/series  2018-12-15 17:17:16.000000000 -0500
@@ -1 +1,2 @@
 0001-make-CFLAGS-LDFLAGS-and-CPPFLAGS-customizable.patch
+ld-as-needed.patch

Reply via email to