miniupnp.tuxfamily.org Forum Index miniupnp.tuxfamily.org
The forum about miniupnp and libnatpmp
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Linking failure when using --as-needed in LDFLAGS

 
Post new topic   Reply to topic    miniupnp.tuxfamily.org Forum Index -> miniupnpd Bugs
View previous topic :: View next topic  
Author Message
GurliGebis



Joined: 16 Apr 2009
Posts: 35

PostPosted: Sun Feb 28, 2010 6:20 pm    Post subject: Linking failure when using --as-needed in LDFLAGS Reply with quote

When building miniupnpd (version 20091222) with --as-needed defined in LDFLAGS, the build fails with this error:

-------------------------------------------------------------

i686-pc-linux-gnu-gcc -Wl,--as-needed miniupnpd.o upnphttp.o upnpdescgen.o upnpsoap.o upnpreplyparse.o minixml.o upnpredirect.o getifaddr.o daemonize.o upnpglobalvars.o options.o upnppermissions.o minissdp.o natpmp.o upnpevents.o linux/getifstats.o netfilter/iptcrdr.o /usr/lib/libiptc.so -o miniupnpd
netfilter/iptcrdr.o: In function `list_redirect_rule':
iptcrdr.cSad.text+0x86): undefined reference to `iptc_init'
iptcrdr.cSad.text+0x9e): undefined reference to `iptc_strerror'
iptcrdr.cSad.text+0xbe): undefined reference to `iptc_is_chain'
iptcrdr.cSad.text+0xe0): undefined reference to `iptc_free'
iptcrdr.cSad.text+0xf6): undefined reference to `iptc_first_rule'
iptcrdr.cSad.text+0x104): undefined reference to `iptc_get_target'
iptcrdr.cSad.text+0x363): undefined reference to `iptc_next_rule'
iptcrdr.cSad.text+0x379): undefined reference to `iptc_free'
netfilter/iptcrdr.o: In function `iptc_init_verify_and_append':
iptcrdr.cSad.text+0x47d): undefined reference to `iptc_init'
iptcrdr.cSad.text+0x496): undefined reference to `iptc_strerror'
iptcrdr.cSad.text+0x4be): undefined reference to `iptc_is_chain'
iptcrdr.cSad.text+0x4d4): undefined reference to `iptc_strerror'
iptcrdr.cSad.text+0x4ea): undefined reference to `iptc_append_entry'
iptcrdr.cSad.text+0x500): undefined reference to `iptc_strerror'
iptcrdr.cSad.text+0x516): undefined reference to `iptc_commit'
iptcrdr.cSad.text+0x52c): undefined reference to `iptc_strerror'
iptcrdr.cSad.text+0x549): undefined reference to `iptc_free'
iptcrdr.cSad.text+0x559): undefined reference to `iptc_free'
netfilter/iptcrdr.o: In function `delete_rule_and_commit':
iptcrdr.cSad.text+0x7db): undefined reference to `iptc_delete_num_entry'
iptcrdr.cSad.text+0x7f1): undefined reference to `iptc_strerror'
iptcrdr.cSad.text+0x807): undefined reference to `iptc_commit'
iptcrdr.cSad.text+0x81d): undefined reference to `iptc_strerror'
iptcrdr.cSad.text+0x842): undefined reference to `iptc_free'
netfilter/iptcrdr.o: In function `delete_redirect_and_filter_rules':
iptcrdr.cSad.text+0x869): undefined reference to `iptc_init'
iptcrdr.cSad.text+0x884): undefined reference to `iptc_strerror'
iptcrdr.cSad.text+0x8a9): undefined reference to `iptc_is_chain'
iptcrdr.cSad.text+0x8de): undefined reference to `iptc_first_rule'
iptcrdr.cSad.text+0x92a): undefined reference to `iptc_next_rule'
iptcrdr.cSad.text+0x945): undefined reference to `iptc_free'
iptcrdr.cSad.text+0x96c): undefined reference to `iptc_init'
iptcrdr.cSad.text+0x9a2): undefined reference to `iptc_init'
netfilter/iptcrdr.o: In function `get_redirect_rule_by_index':
iptcrdr.cSad.text+0xa58): undefined reference to `iptc_init'
iptcrdr.cSad.text+0xa73): undefined reference to `iptc_strerror'
iptcrdr.cSad.text+0xa98): undefined reference to `iptc_is_chain'
iptcrdr.cSad.text+0xace): undefined reference to `iptc_first_rule'
iptcrdr.cSad.text+0xb91): undefined reference to `iptc_next_rule'
iptcrdr.cSad.text+0xbaa): undefined reference to `iptc_free'
netfilter/iptcrdr.o: In function `get_redirect_rule':
iptcrdr.cSad.text+0xbcd): undefined reference to `iptc_init'
iptcrdr.cSad.text+0xbe8): undefined reference to `iptc_strerror'
iptcrdr.cSad.text+0xc0d): undefined reference to `iptc_is_chain'
iptcrdr.cSad.text+0xc41): undefined reference to `iptc_first_rule'
iptcrdr.cSad.text+0xce8): undefined reference to `iptc_next_rule'
iptcrdr.cSad.text+0xd01): undefined reference to `iptc_free'
collect2: ld returned 1 exit status
make: *** [miniupnpd] Error 1

-------------------------------------------------------------

I have tried rearranging the files passed to the linker, but I cannot get it to link.
Back to top
View user's profile Send private message
GurliGebis



Joined: 16 Apr 2009
Posts: 35

PostPosted: Sun Feb 28, 2010 7:30 pm    Post subject: Reply with quote

The solution is to make it link to ip4tc.so instead of iptc.so .

Changing:

"LIBS = -liptc"

To:

"LIBS = -lip4tc"

in Makefile.linux fixes the problem.
Please include this in the next version.
Back to top
View user's profile Send private message
miniupnp
Site Admin


Joined: 14 Apr 2007
Posts: 1497

PostPosted: Wed Mar 03, 2010 11:09 am    Post subject: Reply with quote

I link with libiptc.a (not .so)

What is your linux distribution and iptables/libiptc package version ???
_________________
Main miniUPnP author.
http://miniupnp.tuxfamily.org/
Back to top
View user's profile Send private message Visit poster's website
GurliGebis



Joined: 16 Apr 2009
Posts: 35

PostPosted: Wed Mar 03, 2010 12:43 pm    Post subject: Reply with quote

Gentoo with iptables version 1.4.6
Back to top
View user's profile Send private message
miniupnp
Site Admin


Joined: 14 Apr 2007
Posts: 1497

PostPosted: Wed Mar 03, 2010 1:02 pm    Post subject: Reply with quote

thanks
_________________
Main miniUPnP author.
http://miniupnp.tuxfamily.org/
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    miniupnp.tuxfamily.org Forum Index -> miniupnpd Bugs All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP
© 2007 Thomas Bernard, author of MiniUPNP.