Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 557874 - net-firewall/pglinux with net-libs/libmnl compiled with clang - /usr/lib64/libnetfilter_queue.so: undefined reference to `mnl_attr_parse'
Summary: net-firewall/pglinux with net-libs/libmnl compiled with clang - /usr/lib64/li...
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: No maintainer - Look at https://wiki.gentoo.org/wiki/Project:Proxy_Maintainers if you want to take care of it
URL:
Whiteboard:
Keywords:
Depends on: 594606
Blocks: systemwide-clang
  Show dependency tree
 
Reported: 2015-08-15 19:39 UTC by Julian Ospald
Modified: 2019-04-04 14:06 UTC (History)
2 users (show)

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


Attachments
1439671988-install-net-libs_libmnl-1.0.3-r1:0::gentoo.out (1439671988-install-net-libs_libmnl-1.0.3-r1:0::gentoo.out,71.44 KB, text/plain)
2015-08-15 20:54 UTC, Julian Ospald
Details
1439671996-install-net-libs_libnetfilter_queue-1.0.2:0::gentoo.out (1439671996-install-net-libs_libnetfilter_queue-1.0.2:0::gentoo.out,69.71 KB, text/plain)
2015-08-15 20:54 UTC, Julian Ospald
Details
1439672005-install-net-firewall_pglinux-2.3.0:0::hasufell-overlay.out (1439672005-install-net-firewall_pglinux-2.3.0:0::hasufell-overlay.out,24.32 KB, text/plain)
2015-08-15 20:54 UTC, Julian Ospald
Details
cave-info.txt (cave-info.txt,32.29 KB, text/plain)
2015-08-15 20:55 UTC, Julian Ospald
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Julian Ospald 2015-08-15 19:39:11 UTC
very weird thing

net-firewall/pglinux links to net-libs/libnetfilter_queue
net-libs/libnetfilter_queue links to net-libs/libmnl

as soon as net-libs/libmnl was compiled with clang, pglinux (not libnetfilter_queue) will fail to link with these errors:

=====
/bin/sh ../libtool  --tag=CC   --mode=link x86_64-pc-linux-gnu-gcc -fPIC -march=core-avx2 -O2 -pipe -Wall -Wl,-export-dynamic -Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu -o pgld src/pgld.o src/stream.o src/blocklist.o src/parser.o -lnetfilter_queue -lnfnetlink  -lz  -ldbus-1  -ldl -lpthread 
/bin/sh ../libtool  --tag=CC   --mode=link x86_64-pc-linux-gnu-gcc -fPIC -march=core-avx2 -O2 -pipe -Wall -module -avoid-version -Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu -o libdbus.la -rpath /usr/lib64/pgl src/dbus.lo -lnetfilter_queue -lnfnetlink  -lz  -ldbus-1  -ldl -lpthread 
libtool: link: x86_64-pc-linux-gnu-gcc -fPIC -march=core-avx2 -O2 -pipe -Wall -Wl,-export-dynamic -Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu -o pgld src/pgld.o src/stream.o src/blocklist.o src/parser.o  -lnetfilter_queue -lnfnetlink -lz -ldbus-1 -ldl -lpthread
libtool: link: x86_64-pc-linux-gnu-gcc -shared  -fPIC -DPIC  src/.libs/dbus.o   -lnetfilter_queue -lnfnetlink -lz -ldbus-1 -ldl -lpthread  -march=core-avx2 -O2 -Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu   -Wl,-soname -Wl,libdbus.so -o .libs/libdbus.so
Makefile:553: recipe for target 'pgld' failed
libtool: link: ( cd ".libs" && rm -f "libdbus.la" && ln -s "../libdbus.la" "libdbus.la" )
make[2]: Leaving directory '/var/tmp/paludis/net-firewall-pglinux-2.3.0/work/pgl-2.3.0/pgld'
Makefile:547: recipe for target 'all-recursive' failed
make[1]: Leaving directory '/var/tmp/paludis/net-firewall-pglinux-2.3.0/work/pgl-2.3.0'
Makefile:458: recipe for target 'all' failed
/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.5/../../../../lib64/libnetfilter_queue.so: undefined reference to `mnl_attr_parse'
/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.5/../../../../lib64/libnetfilter_queue.so: undefined reference to `mnl_attr_validate2'
/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.5/../../../../lib64/libnetfilter_queue.so: undefined reference to `mnl_attr_get_type'
/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.5/../../../../lib64/libnetfilter_queue.so: undefined reference to `mnl_attr_validate'
/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.5/../../../../lib64/libnetfilter_queue.so: undefined reference to `mnl_attr_put_u32'
/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.5/../../../../lib64/libnetfilter_queue.so: undefined reference to `mnl_attr_put'
/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.5/../../../../lib64/libnetfilter_queue.so: undefined reference to `mnl_attr_type_valid'
collect2: error: ld returned 1 exit status
=====

The problem is gone, as soon as net-libs/libmnl was recompiled with gcc.
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2015-08-15 20:43:37 UTC
Build log, emerge --info, proper description. All things that are missing.
Comment 2 Julian Ospald 2015-08-15 20:54:20 UTC
Created attachment 409108 [details]
1439671988-install-net-libs_libmnl-1.0.3-r1:0::gentoo.out
Comment 3 Julian Ospald 2015-08-15 20:54:41 UTC
Created attachment 409110 [details]
1439671996-install-net-libs_libnetfilter_queue-1.0.2:0::gentoo.out
Comment 4 Julian Ospald 2015-08-15 20:54:58 UTC
Created attachment 409112 [details]
1439672005-install-net-firewall_pglinux-2.3.0:0::hasufell-overlay.out
Comment 5 Julian Ospald 2015-08-15 20:55:19 UTC
Created attachment 409114 [details]
cave-info.txt
Comment 6 Julian Ospald 2015-08-15 20:57:14 UTC
(In reply to Jeroen Roovers from comment #1)
> Build log, emerge --info, proper description. All things that are missing.

the bug summary is accurate, if you don't understand it, read the full bug report
Comment 7 Jeroen Roovers (RETIRED) gentoo-dev 2015-08-16 06:20:53 UTC
(In reply to Julian Ospald (hasufell) from comment #6)
> (In reply to Jeroen Roovers from comment #1)
> > Build log, emerge --info, proper description. All things that are missing.
> 
> the bug summary is accurate, if you don't understand it, read the full bug
> report

Yes, your arrogance is correct.
Comment 8 Julian Ospald 2015-08-16 11:01:06 UTC
(In reply to Jeroen Roovers from comment #7)
> (In reply to Julian Ospald (hasufell) from comment #6)
> > (In reply to Jeroen Roovers from comment #1)
> > > Build log, emerge --info, proper description. All things that are missing.
> > 
> > the bug summary is accurate, if you don't understand it, read the full bug
> > report
> 
> Yes, your arrogance is correct.

That wasn't arrogance, I just think it's not possible to understand the bug report just by the given summary. Thanks for enhancing it.
Comment 9 Jeroen Roovers (RETIRED) gentoo-dev 2015-08-17 05:31:56 UTC
It looks like this is about setting -fvisibility=hidden and then not properly exporting all symbols. You could try with this patch:

--- configure.ac.orig   2012-05-18 01:02:27.180568285 +0200
+++ configure.ac        2015-08-17 07:30:34.298280048 +0200
@@ -15,7 +15,6 @@
 AC_EXEEXT
 AC_DISABLE_STATIC
 LT_INIT
-CHECK_GCC_FVISIBILITY
 case "$host" in
 *-*-linux*) ;;
 *) AC_MSG_ERROR([Linux only, dude!]);;
Comment 10 Jeroen Roovers (RETIRED) gentoo-dev 2015-08-17 05:34:24 UTC
Either that or pglinux is using them when it shouldn't. :)
Comment 11 Julian Ospald 2015-08-17 09:32:16 UTC
(In reply to Jeroen Roovers from comment #9)
> It looks like this is about setting -fvisibility=hidden and then not
> properly exporting all symbols. You could try with this patch:
> 
> --- configure.ac.orig   2012-05-18 01:02:27.180568285 +0200
> +++ configure.ac        2015-08-17 07:30:34.298280048 +0200
> @@ -15,7 +15,6 @@
>  AC_EXEEXT
>  AC_DISABLE_STATIC
>  LT_INIT
> -CHECK_GCC_FVISIBILITY
>  case "$host" in
>  *-*-linux*) ;;
>  *) AC_MSG_ERROR([Linux only, dude!]);;

I guess you meant libmnl. I get lots of errors with that like

socket.c:89:15: error: redefinition of 'mnl_socket_get_fd' as different kind of symbol
socket.c:85:5: note: previous definition is here
int mnl_socket_get_fd(const struct mnl_socket *nl)

and so on.
Comment 12 Austin English (RETIRED) gentoo-dev 2016-06-05 04:35:34 UTC
(In reply to Jeroen Roovers from comment #9)
> It looks like this is about setting -fvisibility=hidden and then not
> properly exporting all symbols. You could try with this patch:
> 
> --- configure.ac.orig   2012-05-18 01:02:27.180568285 +0200
> +++ configure.ac        2015-08-17 07:30:34.298280048 +0200
> @@ -15,7 +15,6 @@
>  AC_EXEEXT
>  AC_DISABLE_STATIC
>  LT_INIT
> -CHECK_GCC_FVISIBILITY
>  case "$host" in
>  *-*-linux*) ;;
>  *) AC_MSG_ERROR([Linux only, dude!]);;

With clang-3.5, this gets it further. Next it fails on:
             ~^
nlmsg.c:241:15: error: redefinition 2 warningof 'mnl_nlmsg_portid_ok' sas different and 2 kind errors of generated.
 symbol
nlmsg.c:237:1: note: previous definition is here
mnl_nlmsg_portid_ok(const struct nlmsghdr *nlh, unsigned int portid)
^
nlmsg.c:385:15: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
EXPORT_SYMBOL(mnl_nlmsg_fprintf);
             ~^
nlmsg.c:385:15: error: redefinition of 'mnl_nlmsg_fprintf' as different kind of symbol
nlmsg.c:373:1: note: previous definition is here
mnl_nlmsg_fprintf(FILE *fd, const void *data, size_t datalen,

and several more redefinitions..
Comment 13 zhanglei.april 2016-09-06 02:04:11 UTC
It's a known issue; earlier versions of libmnl are mis-compiled by clang.

Please try the latest version (1.0.4). It worked last time I tested it.