Bug#654180: rhash: FTBFS with ld --as-needed

2012-01-16 Thread Aleksey Kravchenko
Hello!

There is already a patch [1] in the upstream source tree, solving this
problem. It fixes compilation on Ubuntu and allows using the --as-needed
option.

The upstream fix will be included in the nearest package release.

[1]
https://github.com/rhash/RHash/commit/1e98cb8bc2a525e7da9ef8e13505f53d1f87f20c

02.01.2012 15:33, Ilya Barygin wrote:
 Package: rhash
 Version: 1.2.8-2
 Severity: normal
 Tags: upstream patch
 User: debian-...@lists.debian.org
 Usertags: ld-as-needed
 
 rhash fails to build when --as-needed linker option is enabled,
 because of incorrect order of parameters passed to ld. As a result,
 librhash-jni.so was underlinked and tests failed.
 Here's a log of failed build in Ubuntu:
 https://launchpad.net/ubuntu/+source/rhash/1.2.8-2/+build/3003545/+files/buildlog_ubuntu-precise-i386.rhash_1.2.8-2_FAILEDTOBUILD.txt.gz
 
 See also
 http://wiki.debian.org/ToolChain/DSOLinking#Only_link_with_needed_libraries
 http://wiki.mandriva.com/en/Underlinking
 
 Patch from Ubuntu attached.
 https://launchpad.net/ubuntu/+source/rhash/1.2.8-2ubuntu1
 
 -- System Information:
 Debian Release: wheezy/sid
   APT prefers oneiric-updates
   APT policy: (500, 'oneiric-updates'), (500, 'oneiric-security'), (500, 
 'oneiric-proposed'), (500, 'oneiric'), (100, 'oneiric-backports')
 Architecture: i386 (i686)
 
 Kernel: Linux 3.0.0-15-generic (SMP w/2 CPU cores)
 Locale: LANG=ru_RU.UTF-8, LC_CTYPE=ru_RU.UTF-8 (charmap=UTF-8)
 Shell: /bin/sh linked to /bin/dash



signature.asc
Description: OpenPGP digital signature


Bug#654180: rhash: FTBFS with ld --as-needed

2012-01-02 Thread Ilya Barygin
Package: rhash
Version: 1.2.8-2
Severity: normal
Tags: upstream patch
User: debian-...@lists.debian.org
Usertags: ld-as-needed

rhash fails to build when --as-needed linker option is enabled,
because of incorrect order of parameters passed to ld. As a result,
librhash-jni.so was underlinked and tests failed.
Here's a log of failed build in Ubuntu:
https://launchpad.net/ubuntu/+source/rhash/1.2.8-2/+build/3003545/+files/buildlog_ubuntu-precise-i386.rhash_1.2.8-2_FAILEDTOBUILD.txt.gz

See also
http://wiki.debian.org/ToolChain/DSOLinking#Only_link_with_needed_libraries
http://wiki.mandriva.com/en/Underlinking

Patch from Ubuntu attached.
https://launchpad.net/ubuntu/+source/rhash/1.2.8-2ubuntu1

-- System Information:
Debian Release: wheezy/sid
  APT prefers oneiric-updates
  APT policy: (500, 'oneiric-updates'), (500, 'oneiric-security'), (500, 
'oneiric-proposed'), (500, 'oneiric'), (100, 'oneiric-backports')
Architecture: i386 (i686)

Kernel: Linux 3.0.0-15-generic (SMP w/2 CPU cores)
Locale: LANG=ru_RU.UTF-8, LC_CTYPE=ru_RU.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Description: fix FTBFS with --as-needed linker option
 Libraries should be placed after object files in the linker call.
Author: Ilya Barygin randomact...@ubuntu.com

--- rhash-1.2.8.orig/bindings/java/native/Makefile
+++ rhash-1.2.8/bindings/java/native/Makefile
@@ -20,7 +20,8 @@
 CFLAGS = -g -O2
 LIBRHASH_INC =
 LIBRHASH_LD  =
-LDFLAGS = -lrhash $(LIBRHASH_LD)
+LDFLAGS = $(LIBRHASH_LD)
+LDLIBS = -lrhash
 ALLCFLAGS = $(CFLAGS) $(LIBRHASH_INC) -fPIC
 
 #Platform dependent
@@ -40,7 +41,7 @@
$(CC) $(ALLCFLAGS) -c $ -o $@
 
 $(LIBRARY): $(OBJECTS)
-   $(CC) $(LDFLAGS) -shared -o $@ $(OBJECTS)
+   $(CC) $(LDFLAGS) -shared -o $@ $(OBJECTS) $(LDLIBS)
 
 clean:
rm -f *.o $(LIBRARY)