Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 334503 - net-firewall/iptables-1.4.8-r1: libiptc is missing NEEDED entries when built with as-needed
Summary: net-firewall/iptables-1.4.8-r1: libiptc is missing NEEDED entries when built ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo's Team for Core System packages
URL: http://bugzilla.netfilter.org/show_bu...
Whiteboard:
Keywords:
Depends on:
Blocks: 375733
  Show dependency tree
 
Reported: 2010-08-25 21:21 UTC by Andreas K. Hüttel
Modified: 2012-03-31 05:42 UTC (History)
4 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas K. Hüttel archtester gentoo-dev 2010-08-25 21:21:47 UTC
I am taking care of a package in sunrise that uses libiptc. Recently I noticed that the build fails; configure claims that it cannot find a working libiptc. Some digging brought the following information:

* The autoconf test is "AC_CHECK_LIB(iptc, iptc_init, ..."
* Only when iptables is built with --as-needed, this fails. 

scanelf on usr/lib64/libiptc.so.0.0.0 reports
* when built with as-needed: ET_DYN libc.so.6 /usr/lib64/libiptc.so.0.0.0
* when built without as-needed: ET_DYN libip4tc.so.0,libip6tc.so.0,libc.so.6 /usr/lib64/libiptc.so.0.0.0

This is not a problem per se, since there are no unresolved symbols in libiptc. 

However, programs may expect the symbol iptc_init to be present when linking -liptc. And that symbol is actually defined in libip4tc...
Comment 1 SpanKY gentoo-dev 2010-08-25 22:06:28 UTC
dont assign packages directly.  let bug-wranglers do it.
Comment 3 Romain Riviere 2012-03-05 22:13:48 UTC
I think this bug might require reopening.
The latest iptables is 1.4.12.1-r1 as I am typing this, and it is build *with* --as-needed, which causes /lib/libiptc.so.0 to *not* be linked against libip4tc and libip6tc.
I tried adding the fix mentioned in comment #2 but that didn't help. However, building with LDFLAGS="-Wl,--no-as-needed" solves the problem. I am not well-versed enough in ebuild lingo to turn this into a usable patch though.
Comment 4 Romain Riviere 2012-03-05 22:18:24 UTC
Obviously that should have read "The latest iptables is 1.4.12.1-r2 as I am typing this". Sorry about the noise.
Comment 5 Romain Riviere 2012-03-05 22:19:40 UTC
Or maybe not. Very, very sorry :-/
Comment 6 Andreas K. Hüttel archtester gentoo-dev 2012-03-06 01:01:19 UTC
Reopening as per comment 3 and following... even though they slightly confuse me :]
Comment 7 Romain Riviere 2012-03-06 08:07:55 UTC
(In reply to comment #6)
> Reopening as per comment 3 and following... even though they slightly
> confuse me :]

Can't blame you :-/ Apologies again!
I dug a little deeper and found that --no-as-needed can be made specific to the sub-libs we are interested in. One sure fact is that the vanilla sources do not display the problem, so I am quite positive that elibtoolize is responsible for this --as-needed flag being applied globally and for the resulting linking problems.
Comment 8 Johan Bergström 2012-03-07 20:07:13 UTC
I guess one interesting question is why --as-needed removes it as well (at least for me).
Comment 9 Johan Bergström 2012-03-07 21:32:49 UTC
(In reply to comment #8)
> I guess one interesting question is why --as-needed removes it as well (at
> least for me).

…as already outlined by Mike in the upstream ticket in URL.
Comment 10 Romain Riviere 2012-03-16 15:16:37 UTC
I am by no means an expert in linking issues so I gathered some data and external help on this issue. What I do know for sure is that iptables' Makefile for libiptc allows $LDFLAGS to override its $libiptc_la_LDFLAGS. As a result, libiptc is linked with -Wl,--no-as-needed AND -Wl,--as-needed, in this order.
I don't think --no-as-needed can be re-introduced in a way similar to the patch from comment #2. Also, I tried various methods involving flag-o-matic filter-ldflags and append-ldflags, to no avail.
Letting $LDFLAGS be overriden by $libiptc_la_LDFLAGS is a sure fix, but I am told it goes against the way things are normally done. I'll let you be the judges of that.
Comment 11 SpanKY gentoo-dev 2012-03-30 21:44:21 UTC
the code has changed significantly.  please file a new bug for the new version with full build log/etc...
Comment 12 Romain Riviere 2012-03-31 05:42:11 UTC
(In reply to comment #11)
> the code has changed significantly.  please file a new bug for the new
> version with full build log/etc...

Latest version (1.4.13) fixed the problem for me.