Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 247943 - net-analyzer/vnstat: fails with forced --as-needed
Summary: net-analyzer/vnstat: fails with forced --as-needed
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Netmon project
URL: http://www.gentoo.org/proj/en/qa/asne...
Whiteboard:
Keywords:
Depends on:
Blocks: as-needed
  Show dependency tree
 
Reported: 2008-11-21 12:30 UTC by Diego Elio Pettenò (RETIRED)
Modified: 2009-06-02 15:02 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
Build log (net-analyzer:vnstat-1.6:20081121-105458.log,1.84 KB, text/plain)
2008-11-21 12:31 UTC, Diego Elio Pettenò (RETIRED)
Details
Patch to vnstat ebuild to add sed calls to fix Makefile issues (vnstat.ebuild.patch,557 bytes, patch)
2009-01-25 22:51 UTC, Kevin Pyle
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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?