Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 248482 - www-misc/mergelog: fails with forced --as-needed
Summary: www-misc/mergelog: 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: Apache Team - Bugzilla Reports
URL: http://www.gentoo.org/proj/en/qa/asne...
Whiteboard:
Keywords:
Depends on:
Blocks: as-needed
  Show dependency tree
 
Reported: 2008-11-23 22:59 UTC by Diego Elio Pettenò (RETIRED)
Modified: 2009-07-05 20:05 UTC (History)
1 user (show)

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


Attachments
Build log (mergelog-4.5-r1:20081123-223122.log,5.55 KB, text/plain)
2008-11-23 23:00 UTC, Diego Elio Pettenò (RETIRED)
Details
Patch configure.in to call AM_PROG_CC_C_O, which is required to use the new Makefile.am (mergelog-4.5-configure-cc_c_o.patch,466 bytes, patch)
2009-01-01 23:01 UTC, Kevin Pyle
Details | Diff
Replacement src/Makefile.am: use automake directives instead of make rules (mergelog-4.5-src-Makefile.am,377 bytes, text/plain)
2009-01-01 23:02 UTC, Kevin Pyle
Details
Patch to mergelog-4.5-r1.ebuild to apply the patch from attachment #177038 and copy the Makefile.am from attachment #177040 (mergelog-4.5.ebuild.patch,350 bytes, patch)
2009-01-01 23:04 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-23 22:59:45 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-23 23:00:11 UTC
Created attachment 173091 [details]
Build log
Comment 2 Kevin Pyle 2009-01-01 23:00:02 UTC
Although the package is autotools based, it uses handwritten rules to build the two programs.  The build failed because the rules place $(LIBS) before the object files, so the libraries are discarded when --as-needed is used.  The rules also ignore $LDFLAGS.  In the end, it turned out to be smaller to replace the supplied Makefile.am than to patch it.  The resulting Makefile.am in turn caused automake to require the addition of AM_PROG_CC_C_O, since I changed it to use automake rules to build the programs.  This way, automake writes rules that respect $LDFLAGS, add $LIBS in the correct place, and provides better future proofing.

I will attach the patch for configure.in, the new Makefile.am, and the patch for www-misc/mergelog-4.5-r1.ebuild.  An autoreconf run is required after the Makefile.am changes.  The -r1 ebuild already has such a run, whereas the -r0 ebuild does not.
Comment 3 Kevin Pyle 2009-01-01 23:01:28 UTC
Created attachment 177038 [details, diff]
Patch configure.in to call AM_PROG_CC_C_O, which is required to use the new Makefile.am
Comment 4 Kevin Pyle 2009-01-01 23:02:35 UTC
Created attachment 177040 [details]
Replacement src/Makefile.am: use automake directives instead of make rules
Comment 5 Kevin Pyle 2009-01-01 23:04:04 UTC
Created attachment 177042 [details, diff]
Patch to mergelog-4.5-r1.ebuild to apply the patch from attachment #177038 [details, diff] and copy the Makefile.am from attachment #177040 [details]
Comment 6 Diego Elio Pettenò (RETIRED) gentoo-dev 2009-06-02 13:35:14 UTC
Kevin can you just make the patch both change Makefile.am and fix configure.in? Would be easier to apply. Although I wonder if it's called for at all...
Comment 7 Kevin Pyle 2009-06-02 14:33:40 UTC
I can change that easily enough if you want.  I chose to go this way because the replacement Makefile.am is smaller than a patch to convert the original Makefile.am into the one I supplied.  The only line I kept from the original was "bin_PROGRAMS = ...".
Comment 8 Benedikt Böhm (RETIRED) gentoo-dev 2009-07-05 20:05:33 UTC
fixed in cvs, thanks