Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 767160 - net-misc/networkmanager fails to find wifi when built with sys-devel/slibtool
Summary: net-misc/networkmanager fails to find wifi when built with sys-devel/slibtool
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Linux Gnome Desktop Team
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks: slibtool
  Show dependency tree
 
Reported: 2021-01-25 15:38 UTC by orbea
Modified: 2021-04-04 14:33 UTC (History)
3 users (show)

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


Attachments
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/732 (732.patch,847 bytes, patch)
2021-01-25 15:38 UTC, orbea
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description orbea 2021-01-25 15:38:17 UTC
Created attachment 684639 [details, diff]
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/732

When net-misc/networkmanager is built with slibtool it compiles, but then fails to find my wifi when using nmtui.

This is because networkmanager depends on the non-portable location of the generated libtool ./src/NetworkManager-all-sym binary. With slibtool ./src/NetworkManager-all-sym is a wrapper script and the actual binary is ./src/.libs/NetworkManager-all-sym resulting in an empty ./src/NetworkManager.ver which obviously does not work.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/blob/1.26.4/tools/create-exports-NetworkManager.sh#L43

I created a MR at the upstream gitlab to fix this and attached the patch as an attachment.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/732
Comment 1 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2021-01-25 15:43:15 UTC
I suppose this affects all versions, not only 1.26.4
Comment 3 Joakim Tjernlund 2021-01-28 08:12:36 UTC
Even with that patch I get:

slibtool: link: ln -s ../libnm-bluetooth-utils.la src/devices/bluetooth/.libs/libnm-bluetooth-utils.lai
slibtool: link: x86_64-pc-linux-gnu-gcc clients/nm_online-nm-online.o libnm/nm-libnm-aux/.libs/libnm-libnm-aux.a shared/nm-glib-aux/.libs/libnm-glib-aux.a shared/nm-std-aux/.libs/libnm-std-aux.a shared/.libs/libcsiphash.a -fno-strict-aliasing -fdata-sections -ffunction-sections -Wl,--gc-sections -O2 -pipe -Wno-error -fno-stack-check -Wno-deprecated-declarations -fdebug-prefix-map=..=/var/tmp/portage/net-misc/networkmanager-1.28.0-r1 -Wl,--version-script=/var/tmp/portage/net-misc/networkmanager-1.28.0-r1/work/NetworkManager-1.28.0/linker-script-binary.ver -Wl,-O1 -Wl,--as-needed -Llibnm/.libs -lnm -lgio-2.0 -lgobject-2.0 -lgmodule-2.0 -lglib-2.0 -ldl -lgio-2.0 -lgobject-2.0 -lgmodule-2.0 -lglib-2.0 -luuid -ldl -lgio-2.0 -lgobject-2.0 -lgmodule-2.0 -lglib-2.0 -lssl3 -lsmime3 -lnss3 -lnssutil3 -lplds4 -lplc4 -lnspr4 -ldl -lgio-2.0 -lgobject-2.0 -lgmodule-2.0 -lglib-2.0 -ludev -ldl -lgio-2.0 -lgobject-2.0 -lgmodule-2.0 -lglib-2.0 -luuid -Llibnm/nm-libnm-aux/../../libnm/.libs -lnm -Wl,--export-dynamic -pthread -o clients/.libs/nm-online
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: libnm/nm-libnm-aux/.libs/libnm-libnm-aux.a(libnm_systemd_logging_stub_la-nm-logging-stub.o): in function `_nm_utils_monotonic_timestamp_initialized':
nm-logging-stub.c:(.text._nm_utils_monotonic_timestamp_initialized+0x0): multiple definition of `_nm_utils_monotonic_timestamp_initialized'; clients/cloud-setup/nm_cloud_setup-nm-cloud-setup-utils.o:nm-cloud-setup-utils.c:(.text._nm_utils_monotonic_timestamp_initialized+0x0): first defined here
collect2: error: ld returned 1 exit status
slibtool: exec error upon slbt_exec_link_create_executable(), line 1613: (see child process error messages).
slibtool: < returned to > slbt_exec_link(), line 1902.
make[2]: *** [Makefile:10148: clients/cloud-setup/nm-cloud-setup] Error 2
make[2]: *** Waiting for unfinished jobs....
slibtool: compile: x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I/var/tmp/portage/net-misc/networkmanager-1.28.0-r1/work/NetworkManager-1.28.0 -std=gnu11 -I/var/tmp/portage/net-misc/networkmanager-1.28.0-r1/work/NetworkManager-1.28.0/shared -I./shared -I/var/tmp/portage/net-misc/networkmanager-1.28.0-r1/work/NetworkManager-1.28.0/shared/systemd/ -I/var/tmp/portage/net-misc/networkmanager-1.28.0-r1/work/NetworkManager-1.28.0/shared/systemd/sd-adapt-shared -I/var/tmp/portage/net-misc/networkmanager-1.28.0-r1/work/NetworkManager-1.28.0/shared/systemd/src/basic -I/var/tmp/portage/net-misc/networkmanager-1.28.0-r1/work/NetworkManager-1.28.0/shared/systemd/src/shared -Wno-gnu-variable-sized-type-not-at-end -pthread -I/usr/include/gio-unix-2.0 -I/usr/include/libmount -I/usr/include/blkid -I/usr/lib64/libffi/include -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_40 -DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_40 -I/var/tmp/portage/net-misc/networkmanager-1.28.0-r1/work/NetworkManager-1.28.0/src -std=gnu11 -I/var/tmp/portage/net-misc/networkmanager-1.28.0-r1/work/NetworkManager-1.28.0/shared -I./shared -I/var/tmp/portage/net-misc/networkmanager-1.28.0-r1/work/NetworkManager-1.28.0/libnm-core -I./libnm-core -pthread -I/usr/include/gio-unix-2.0 -I/usr/include/libmount -I/usr/include/blkid -I/usr/lib64/libffi/include -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_40 -DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_40 -DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_DAEMON -I/usr/include/elogind -fno-strict-aliasing -fdata-sections -ffunction-sections -Wl,--gc-sections -O2 -pipe -Wno-error -fno-stack-check -Wno-deprecated-declarations -fdebug-prefix-map=..=/var/tmp/portage/net-misc/networkmanager-1.28.0-r1 -c /var/tmp/portage/net-misc/networkmanager-1.28.0-r1/work/NetworkManager-1.28.0/src/dhcp/nm-dhcp-systemd.c -o src/dhcp/libNetworkManagerBase_la-nm-dhcp-systemd.o
slibtool: link: ln -s nm-online clients/nm-online.exe.wrapper
Generation succeeded - 0 warning(s)
make[1]: *** [Makefile:17623: all-recursive] Error 1
make: *** [Makefile:8031: all] Error 2
 * ERROR: net-misc/networkmanager-1.28.0-r1::gentoo failed (compile phase):
 *   emake failed
Comment 4 orbea 2021-01-28 12:09:54 UTC
I suggest to not use the slibtool binary, but the rlibtool symlink.

  MAKEFLAGS='LIBTOOL=rlibtool' emerge -av foo/bar

Or if you want more verbose debugging output.

  MAKEFLAGS='LIBTOOL=rdlibtool' emerge -av foo/bar

The slibtool binary will build both static and shared libraries while rlibtool will automatically determine if shared and / or static libraries are enabled.

Occasionally there are programs that use libtool, but not autotools where you really do want slibtool, slibtool-shared or slibtool-static.
Comment 5 Joakim Tjernlund 2021-01-28 12:33:28 UTC
(In reply to orbea from comment #4)
> I suggest to not use the slibtool binary, but the rlibtool symlink.
> 
>   MAKEFLAGS='LIBTOOL=rlibtool' emerge -av foo/bar
> 
> Or if you want more verbose debugging output.
> 
>   MAKEFLAGS='LIBTOOL=rdlibtool' emerge -av foo/bar
> 
> The slibtool binary will build both static and shared libraries while
> rlibtool will automatically determine if shared and / or static libraries
> are enabled.
> 
> Occasionally there are programs that use libtool, but not autotools where
> you really do want slibtool, slibtool-shared or slibtool-static.

I see, changing to LIBTOOL=rdlibtool worked. I hope other pkgs
will not fail now but we will see.

I guess NetworkManager should be fixed to work with slibtool as well ?
Comment 6 Joakim Tjernlund 2021-01-28 12:38:17 UTC
(In reply to orbea from comment #0)
> Created attachment 684639 [details, diff] [details, diff]
> https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/
> merge_requests/732
> 
> When net-misc/networkmanager is built with slibtool it compiles, but then
> fails to find my wifi when using nmtui.
> 
> This is because networkmanager depends on the non-portable location of the
> generated libtool ./src/NetworkManager-all-sym binary. With slibtool
> ./src/NetworkManager-all-sym is a wrapper script and the actual binary is
> ./src/.libs/NetworkManager-all-sym resulting in an empty
> ./src/NetworkManager.ver which obviously does not work.

Would it not make sense for slibtool to emulate libtool here?
Comment 7 orbea 2021-01-28 14:10:05 UTC
> I guess NetworkManager should be fixed to work with slibtool as well ?

If I understand right its failing by design. The project wants a shared only build by default and slibtool is trying to build static which won't work. This is why rlibtool exists.

> Would it not make sense for slibtool to emulate libtool here?

I need to investigate this more and will update this issue when I find out more.
Comment 8 orbea 2021-03-16 15:35:22 UTC
This fix is in the upstream 1.30.2 release, can networkmanager be updated in gentoo?
Comment 9 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-03-19 04:11:07 UTC
(In reply to orbea from comment #8)
> This fix is in the upstream 1.30.2 release, can networkmanager be updated in
> gentoo?

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=33fe5dab349592699974f73413bb5422b60bd4af