I tried to build net-analyzer/net-snmp with -Wl,--as-needed but the patch in portage tree was not enough for me. After quite a few hours of work, I managed to build it with attached ebuild and patches. Warning - one of the files has the same name as the one in portage tree, but it has been modified. Futher, eautoreconf might be a little too much, but it worked, so I decided not to change it. Of course, those patches should be cleaned a little, as I lack the knowledge of m4 and libtool required to do it. Last thing - useflags were: "X doc elf ipv6 mfd-rewrites perl smux ssl tcpd -lm_sensors -minimal -rpm"
Created attachment 95718 [details, diff] The ebuild.
Created attachment 95719 [details, diff] Patch 1
Created attachment 95720 [details, diff] Patch 2
Created attachment 95721 [details, diff] Patch 2
Comment on attachment 95721 [details, diff] Patch 2 Sorry, double submit
Weird, it works just fine here. Can you try w/ 5.3.0.1 instead?
I'll think about it ( Duron 650 MHz - so it takes some time). The problem I had was with libwrap - for some reason it was not linked into libraries, so one of the apps was failing during linking and with perl - which was not linked in either.
Created attachment 96783 [details, diff] modified, a lot less changes OK, I read more into the problem, and came up with a much simpler solution. Now, ebuild from the tree works, with this modified patch. The changes are small: 1. one of the checks in configure.in was adding perl libs to LDFLAGS instead of LIBS, that caused that check to be incorrect and cause compilation to fail in one of perl-related files 2. libnetsnmpagent needs @WRAPLIBS@ cause otherwise it seems to compile fine, but when later some programs are built, they fail at linking because of a missing symbol from libwrap
Reopening with new info.
Have sent it upstream already? would be cool if they could include it in the next release
*** Bug 152873 has been marked as a duplicate of this bug. ***
Patch include in the version 5.4 but seems to not completly work So as-needed ldflags is filter in ebuild until it will work
Moving this to Bug 129413; no need for multiple --as-needed bugs open for the same package. *** This bug has been marked as a duplicate of bug 152679 ***