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

Bug 247924

Summary: net-analyzer/bwmon: 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 switch bwmon Makefile to use built-in GNU make rule to compile bwmon
Patch to bwmon ebuild to add a line to apply the preceding patch, and to update the sed call
Replacement patch for bwmon Makefile

Description Diego Elio Pettenò (RETIRED) gentoo-dev 2008-11-21 12:05:35 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:10:43 UTC
Created attachment 172667 [details]
Build log
Comment 2 Kevin Pyle 2009-01-24 04:55:52 UTC
Created attachment 179507 [details, diff]
Patch to switch bwmon Makefile to use built-in GNU make rule to compile bwmon

The upstream Makefile had a manual rule that did not provide a way to specify libraries in the correct place.  Remove the rule in favor of letting GNU make infer how to build it based on dependencies and tradition.

A patch to the ebuild to change the sed expression is also required.  I will attach that next.
Comment 3 Kevin Pyle 2009-01-24 04:58:45 UTC
Created attachment 179509 [details, diff]
Patch to bwmon ebuild to add a line to apply the preceding patch, and to update the sed call

The ebuild uses a sed call to update LDFLAGS.  This is not necessary, but the use of LDFLAGS is wrong here.  Change the sed call to rewrite LDFLAGS to be LDLIBS.  Also, change the rewrite of the CFLAGS line to append user CFLAGS instead of prepending them.
Comment 4 Kevin Pyle 2009-01-24 05:06:35 UTC
Created attachment 179511 [details, diff]
Replacement patch for bwmon Makefile

Though the first patch compiled correctly, the use of an alternate output directory caused make not to build the final image when using an implicit rule.  Add the standard linking rule to ensure that the image is built and placed in the correct directory.
Comment 5 Diego Elio Pettenò (RETIRED) gentoo-dev 2009-06-02 11:42:48 UTC
Thanks for the patch Kevin, but I fixed it by just not using the Makefile at all :)