Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 226927

Summary: sys-libs/libkudzu: append-ldflags is used to pass libraries
Product: Gentoo Linux Reporter: Diego Elio Pettenò (RETIRED) <flameeyes>
Component: New packagesAssignee: Gentoo LiveCD Package Maintainers <livecd>
Severity: normal    
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 226863    

Description Diego Elio Pettenò (RETIRED) gentoo-dev 2008-06-14 18:26:06 UTC
I've made append-ldflags throw a warning when libraries are passed through it
to link them in.

The reason is that LDFLAGS should _not_ be used for libraries, as it has to be
positioned before the list of objects to link together, while libraries should
go after.

This mistake in commandline is what causes as-needed to either fail or not
apply at all (if LDFLAGS are put at the end).

Please fix your package not to pass libraries through LDFLAGS.
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2008-09-02 22:13:59 UTC
A possible solution, though I didn't test it yet (what requires libkudzu?).

Index: libkudzu-
RCS file: /var/cvsroot/gentoo-x86/sys-libs/libkudzu/libkudzu-,v
retrieving revision 1.10
diff -u -B -r1.10 libkudzu-
--- libkudzu-    29 Feb 2008 01:34:03 -0000      1.10
+++ libkudzu-    2 Sep 2008 22:10:37 -0000
@@ -33,7 +33,7 @@
 src_compile() {
        if use zlib
-               append-ldflags -lz
+               perl -pi -e 's| -lpci| -lz -lpci|g' Makefile
        elif built_with_use --missing false sys-apps/pciutils zlib
                die "You need to build with USE=zlib to match sys-apps/pcituils"
Comment 2 Andrew Gaffney (RETIRED) gentoo-dev 2008-09-02 22:40:52 UTC
I think hwsetup uses it. Also, use sed for that kind of thing instead of perl:

sed -i 's| -lpci| -lz -lpci|g' Makefile
Comment 3 Jeroen Roovers (RETIRED) gentoo-dev 2008-09-02 22:44:49 UTC
(In reply to comment #2)
> I think hwsetup uses it. Also, use sed for that kind of thing instead of perl:
> sed -i 's| -lpci| -lz -lpci|g' Makefile

There is another use of perl instead of said in the very same ebuild, so I assumed that was intended to assure independence from sed.

I posted a similar patch to the related hwsetup bug #226923.
Comment 4 Jeroen Roovers (RETIRED) gentoo-dev 2008-10-31 16:17:12 UTC
I've committed my patch anyway. If Diego ever files a QA bug report for using perl instead of sed, we'll know what to do. :)