Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 492744 - >=net-firewall/iptables-1.4.20 should (optionally) depend on net-libs/libnetfilter_conntrack - libxt_connlabel.c:57: error: undefined reference to 'nfct_labelmap_get_name'
Summary: >=net-firewall/iptables-1.4.20 should (optionally) depend on net-libs/libnetf...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo's Team for Core System packages
URL: https://git.netfilter.org/iptables/co...
Whiteboard:
Keywords:
: 533438 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-11-27 22:38 UTC by Attila Tóth
Modified: 2016-03-14 11:01 UTC (History)
3 users (show)

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


Attachments
net-firewall/iptables-1.4.20 build.log (iptables-build.log,69.77 KB, text/plain)
2013-11-28 12:16 UTC, Joe Kane
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Attila Tóth 2013-11-27 22:38:20 UTC
libtool: link: x86_64-pc-linux-gnu-gcc -Wall -Waggregate-return -Wmissing-declarations -Wmissing-prototypes -Wredundant-decls -Wshadow -Wstrict-prototypes -Winline -pipe -DALL_INCLUSIVE -DENABLE_IPV4 -DENABLE_IPV6 -O2 -march=corei7-avx -pipe -Wl,-O1 -o .libs/xtables-multi xtables_multi-xtables-multi.o xtables_multi-iptables-xml.o xtables_multi-iptables-save.o xtables_multi-iptables-restore.o xtables_multi-iptables-standalone.o xtables_multi-iptables.o xtables_multi-ip6tables-save.o xtables_multi-ip6tables-restore.o xtables_multi-ip6tables-standalone.o xtables_multi-ip6tables.o xtables_multi-xshared.o  -Wl,--as-needed ../extensions/libext.a ../libiptc/.libs/libip4tc.so ../extensions/libext4.a ../libiptc/.libs/libip6tc.so ../extensions/libext6.a ../libxtables/.libs/libxtables.so -lm
../extensions/libext.a(libxt_connlabel.o): In function `connlabel_get_name':
libxt_connlabel.c:(.text+0x30): undefined reference to `nfct_labelmap_get_name'
../extensions/libext.a(libxt_connlabel.o): In function `connlabel_mt_parse':
libxt_connlabel.c:(.text+0x24b): undefined reference to `nfct_labelmap_get_bit'
../extensions/libext.a(libxt_connlabel.o): In function `libxt_connlabel_init':
libxt_connlabel.c:(.text+0x3a9): undefined reference to `nfct_labelmap_new'
collect2: error: ld returned 1 exit status
make[2]: *** [xtables-multi] Error 1
make[2]: Leaving directory `/var/tmp/portage/net-firewall/iptables-1.4.21/work/iptables-1.4.21/iptables'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/var/tmp/portage/net-firewall/iptables-1.4.21/work/iptables-1.4.21'
make: *** [all] Error 2


Reproducible: Always

Steps to Reproduce:
-lnetfilter_conntrack must be also listed for linking besides -lm
Actual Results:  
Some related pages:
Thread:
http://www.spinics.net/lists/netfilter-devel/msg27651.html
Patch:
http://git.buildroot.net/buildroot/commit/?id=24606a241660c4128fddceca88a17374d7f935c8
- note: iptables/Makefile still needs an additional -lnetfilter_conntrack
Comment 1 Attila Tóth 2013-11-27 23:48:00 UTC
And even if it compiles and links fine, there is a runtime problem manifested with the error message:
cannot open connlabel.conf, not registering 'connlabel' match: No such file or directory
Comment 2 Jeroen Roovers (RETIRED) gentoo-dev 2013-11-28 11:41:11 UTC
1) Please attach the entire build log to this bug report.
2) Please post your `emerge --info' output in a comment.
Comment 3 Joe Kane 2013-11-28 12:16:09 UTC
Created attachment 364132 [details]
net-firewall/iptables-1.4.20 build.log
Comment 4 Joe Kane 2013-11-28 12:16:24 UTC

# emerge --info '=net-firewall/iptables-1.4.20::gentoo'
Portage 2.2.7 (hardened/linux/amd64, gcc-4.6.3, glibc-2.16.0, 3.10.17-gentoo x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-3.10.17-gentoo-x86_64-Intel-R-_Atom-TM-_CPU_D525_@_1.80GHz-with-gentoo-2.2
KiB Mem:     4040376 total,   3459344 free
KiB Swap:          0 total,         0 free
Timestamp of tree: Thu, 28 Nov 2013 02:45:01 +0000
ld GNU ld (GNU Binutils) 2.23.1
app-shells/bash:          4.2_p45
dev-lang/python:          2.7.5-r3, 3.2.5-r3
dev-util/cmake:           2.8.11.2
dev-util/pkgconfig:       0.28
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.12.4
sys-apps/sandbox:         2.6-r1
sys-devel/autoconf:       2.69
sys-devel/automake:       1.11.6, 1.12.6, 1.13.4
sys-devel/binutils:       2.23.1
sys-devel/gcc:            4.6.3, 4.7.3-r1
sys-devel/gcc-config:     1.7.3
sys-devel/libtool:        2.4.2
sys-devel/make:           3.82-r4
sys-kernel/linux-headers: 3.9 (virtual/os-headers)
sys-libs/glibc:           2.16.0
Repositories: gentoo
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /var/bind /var/spool/munin-async/.ssh"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.3/ext-active/ /etc/php/apache2-php5.5/ext-active/ /etc/php/cgi-php5.3/ext-active/ /etc/php/cgi-php5.5/ext-active/ /etc/php/cli-php5.3/ext-active/ /etc/php/cli-php5.5/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/splash /etc/terminfo"
CXXFLAGS="-march=native"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org/ "
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j5"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY=""
SYNC="rsync://rsync1.uk.gentoo.org/gentoo-portage"
USE="=dev-lang/php-5* acl amd64 apache2 berkdb bind bzip2 cli courier cracklib crypt ctype cxx dlz dri fbcondecor freeradius gd gdbm geoip hardened iconv jpg justify libwww maildir metalog mmx modules mudflap multilib mysql mysqli ncurses net-fs/samba nls nptl openmp openssl pam pax_kernel pcre perl png proftp python radius readline sasl sasl2 session squid sse sse2 ssl static-libs svg tcpd tls truetype unicode urandom vhosts xml zlib" ABI_X86="64" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="auth_basic authn_file authn_default authn_dbd authz_user authz_default authz_host authz_owner filter access auth auth_dbm auth_anon auth_digest alias file-cache echo charset-lite cache disk-cache mem-cache ext-filter case_filter case-filter-in deflate mime-magic cern-meta expires headers usertrack unique-id proxy proxy-connect proxy-ftp proxy-http info include cgi cgid dav dav-fs vhost_alias vhost-alias speling rewrite log_config logio env setenvif mime status autoindex asis negotiation dir imap actions userdir so" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_2" RUBY_TARGETS="ruby19 ruby18" USERLAND="GNU" VIDEO_CARDS="fbdev glint intel mach64 mga nouveau nv r128 radeon savage sis tdfx trident vesa via vmware dummy v4l" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON
Comment 5 SpanKY gentoo-dev 2015-04-03 07:14:23 UTC
*** Bug 533438 has been marked as a duplicate of this bug. ***
Comment 7 Attila Tóth 2015-08-19 12:03:53 UTC
(In reply to SpanKY from comment #6)
> should be fixed in the tree now:
> http://gitweb.gentoo.org/repo/gentoo.git/commit/
> ?id=fcabf1041d7948601c083fdb87c3723a95eef65f

Link errors are still there after the commit. I've just upgraded to 1.4.21-r2 with the new conntrack USE flag. Please note, that I also USE static-libs while compiling iptables.

Please refer to this bug:
https://patchwork.ozlabs.org/patch/266804/
The patch isn't sufficient to completely overcome linking problems 
--- a/libxtables/Makefile.am
+++ b/libxtables/Makefile.am
@@ -11,6 +11,9 @@  if ENABLE_STATIC
 # With --enable-static, shipped extensions are linked into the main executable,
 # so we need all the LIBADDs here too
 libxtables_la_LIBADD += -lm
+if HAVE_LIBNETFILTER_CONNTRACK
+libxtables_la_LIBADD += @libnetfilter_conntrack_LIBS@
+endif
 endif
 if ENABLE_SHARED
 libxtables_la_CFLAGS  = ${AM_CFLAGS}

I also have to introduce another conditional LIBADD for the iptables Makefile:
--- a/iptables/Makefile.am      2015-08-19 12:57:39.036296635 +0200
+++ b/iptables/Makefile.am      2015-08-19 12:58:17.060687189 +0200
@@ -23,6 +23,9 @@
 endif
 xtables_multi_SOURCES += xshared.c
 xtables_multi_LDADD   += ../libxtables/libxtables.la -lm
+if HAVE_LIBNETFILTER_CONNTRACK
+xtables_multi_LDADD   += @libnetfilter_conntrack_LIBS@
+endif

 sbin_PROGRAMS    = xtables-multi
 man_MANS         = iptables.8 iptables-restore.8 iptables-save.8 \

These two seem to solve the problem for me. I can attach patches if you want. Should I open a new bug, or get this bug reopened?

Thanks: Dw.
Comment 8 Markus Peloquin 2016-03-13 22:29:08 UTC
This is definitely still a bug. I'd reopen if I had a usable computer... I tried the latest versions of both packages, too.
Comment 9 Attila Tóth 2016-03-14 11:01:07 UTC
(In reply to Markus Peloquin from comment #8)
> This is definitely still a bug. I'd reopen if I had a usable computer... I
> tried the latest versions of both packages, too.

Additionally, static linking still has issues even with a recent version.
Emerge changes made it much easier to maintain user related patches in /etc/portage!