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

Bug 247943

Summary: net-analyzer/vnstat: fails with forced --as-needed
Product: Gentoo Linux Reporter: Diego Elio Pettenò (RETIRED) <flameeyes>
Component: New packagesAssignee: Gentoo Netmon project <netmon>
Status: RESOLVED FIXED    
Severity: normal    
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
URL: http://www.gentoo.org/proj/en/qa/asneeded.xml
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 129413    
Attachments: Build log
Patch to vnstat ebuild to add sed calls to fix Makefile issues

Description Diego Elio Pettenò (RETIRED) gentoo-dev 2008-11-21 12:30:52 UTC
I'm reporting this bug because the package in summary fails to build when forcing --as-needed on through spec files (check out http://blog.flameeyes.eu/2008/11/14/problems-and-mitigation-strategies-for-as-needed for details).

Check the attached build log.

Thanks,
Diego
Comment 1 Diego Elio Pettenò (RETIRED) gentoo-dev 2008-11-21 12:31:34 UTC
Created attachment 172682 [details]
Build log
Comment 2 Kevin Pyle 2009-01-25 22:51:38 UTC
Created attachment 179708 [details, diff]
Patch to vnstat ebuild to add sed calls to fix Makefile issues

The upstream Makefile exhibits two flaws.  First, as Diego found, it does not link correctly under --as-needed because -lm is passed too early in the link line.  Second, it does not respect user LDFLAGS, so this cannot be caught in normal /etc/make.conf --as-needed usage.

This patch adds a src_unpack function to the ebuild and uses sed to fix up the upstream Makefile.  The sed expressions delete the explicit rules and set LDLIBS to -lm so that the implicit link rule works as desired.
Comment 3 Diego Elio Pettenò (RETIRED) gentoo-dev 2009-06-02 12:01:18 UTC
Thanks Kevin, but it seems like this is fixed with 1.7 version.
Comment 4 Kevin Pyle 2009-06-02 15:02:42 UTC
Good enough.  1.7 had not hit the tree when I posted the original fix, and is still not in stable.  I assume that this type of build failure is not worth expediting a stable request, right?