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
Created attachment 171898 [details] Build log
Created attachment 197500 [details, diff] Patch to libwww-5.4.0-r7.ebuild to (mostly) fix missed linking This patch extends the ebuild to add echo statements which append necessary dependencies to various Makefile.am before regenerating the autotools files. Addressing the problem reported in comment #0 was relatively easy, though I had to use --no-undefined to make it visible since I did not build the entire test area with forced --as-needed. Unfortunately, --no-undefined revealed additional linking problems in the libwww*.la family. I fixed most of them, but one will require restructuring of the libwww modules, and so is left unaddressed. The problem is that libwwwdir needs functions from libwwwfile, and libwwwfile needs functions from libwwwdir. Since both of these are installed libraries, it is not possible to declare them each to be a dependency of the other. Moving the required functions to a convenience library would work, but would result in the installation of duplicate code. The proper fix, if anyone wants to do it, would be to move the required functionality to some other library, possibly creating one, and use that to avoid the circular dependency.
The same problem here with --as-needed via LDFLAGS. Because there is no full and workable fix for this issue, I filtered -Wl,--as-needed from LDFLAGS for this package.
Created attachment 205391 [details] patch to remove --as-needed flag Proposed solution is acceptable in this case due to bad library design.
Comment on attachment 205391 [details] patch to remove --as-needed flag Never do that.
(In reply to comment #5) > (From update of attachment 205391 [details] [edit]) > Never do that. According to your own howto this should be done if library is badly broken and can't be fixed without redesign: http://www.gentoo.org/proj/en/qa/asneeded.xml Quote: "Please consider using this filtering only if you know that the design of the software conflicts with --as-needed." So, please, be consistent. This library requires redesign, this is not just bug to fix. And you're arrogantly saying "Never do that". OK. And what should I do to make my system work if "--as-needed" is present in the LDFLAGS? There are no other way at this moment to fix this. Sincerely, I do not want to rewrite the whole library myself. What is your WORKING proposal to keep system running? Just leave it badly broken with preserved libs because current fix is not good enough? OK, it's bad, but according to howto pointed above this bad solution is still acceptable in some cases. And please, do not reject things so perkily if you do not have other solution.
Just like I have said many times, the correct filtering is NOT using filter-flags. You linked my own guide yourself: http://www.gentoo.org/proj/en/qa/asneeded.xml maybe try reading it? You quoted two paragraphs and totally IGNORED the presence of a code example?
(In reply to comment #7) > maybe try reading it? You quoted two paragraphs and totally IGNORED the > presence of a code example? I read it, but I disagree with your arguments about forcing --no-as-needed, instead of filtering: 1) The only way to add --as-needed via LDFLAGS is "-Wl,--as-needed", it can't be concatenated to previos ld flag because according to gcc manual in the construction "-Wl,-param,--as-needed" '--as-needed' will be treated like option of '-param' thus effectively broking things up. 2) Messing with gcc specs is a very bad idea, it is good only for extreme testing. In the same way you may force -funsafe-math-optimizations or just -O3 via gcc specs and require from every package failing to compile with it to remove flags filtering and effectively cancel dangerous flags via those opposite to them.
Created attachment 205445 [details, diff] add --no-as-needed flag In this particular case I do not really care about ideological background behind patches. I just need this package to work, so you have it.
(In reply to comment #8) > 1) The only way to add --as-needed via LDFLAGS is "-Wl,--as-needed", it can't > be concatenated to previos ld flag because according to gcc manual in the > construction "-Wl,-param,--as-needed" '--as-needed' will be treated like option No you got it wrong, indeed you _can_ concatenate it: -Wl,--as-needed,--hash-style=gnu,--no-undefined This will work just as much as -Wl,--as-needed -Wl,--hash-style=gnu -Wl,--no-undefined so you cannot just _filter_ it out, you got to toggle it off!
Comment on attachment 205445 [details, diff] add --no-as-needed flag Bogus. Only a workaround and a wrong one, because you'd be breaking non-GNU linkers. append-ldflags $(no-as-needed)
Fix for bug 323531 appears to have fixed this, just built fine here with forced asneeded. *** This bug has been marked as a duplicate of bug 323531 ***