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.
What would you recommend as a potential solution?
Index: hwsetup-1.2-r1.ebuild =================================================================== RCS file: /var/cvsroot/gentoo-x86/sys-apps/hwsetup/hwsetup-1.2-r1.ebuild,v retrieving revision 1.1 diff -u -B -r1.1 hwsetup-1.2-r1.ebuild --- hwsetup-1.2-r1.ebuild 9 Apr 2008 00:44:56 -0000 1.1 +++ hwsetup-1.2-r1.ebuild 2 Sep 2008 22:23:50 -0000 @@ -35,7 +35,7 @@ filter-ldflags -Wl,--as-needed --as-needed if use zlib then - append-ldflags -lz + perl -pi -e 's| -lpci| -lz -lpci|g' Makefile elif built_with_use --missing false sys-apps/pciutils zlib then die "You need to build with USE=zlib to match sys-apps/pcituils"
Fixed.