Created attachment 76257 [details] Add libsystemd-id128 to PKG_CHECK_MODULES and udisksctl_LDADD udisks 2.0.92 fails to compile with systemd 198; the build fails with: /bin/sh ../libtool --tag=CC --mode=link x86_64-pc-linux-gnu-gcc -DG_LOG_DOMAIN=\"udisksd\" -march=core2 -O2 -pipe -Waggregate-return -Wall -W -Wextra -Wcast-align -Wdeclaration-after-statement -Wendif-labels -Werror=format-security -Werror=implicit-function-declaration -Werror=overflow -Wformat-nonliteral -Wformat=2 -Wimplicit -Winit-self -Wlogical-op -Wmissing-declarations -Wmissing-format-attribute -Wmissing-include-dirs -Wmissing-noreturn -Wmissing-prototypes -Wnested-externs -Wno-inline -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-switch-enum -Wno-unused-parameter -Wno-unused-result -Wold-style-definition -Wpacked -Wpointer-arith -Wshadow -Wsign-compare -Wstrict-aliasing=2 -Wstrict-prototypes -Wundef -Wuninitialized -Wunsafe-loop-optimizations -Wvla -Wwrite-strings -fdata-sections -fdiagnostics-show-option -ffast-math -ffunction-sections -fno-common -fno-strict-aliasing -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Wl,-O1 -Wl,--no-as-needed -o udisksd udisksd-main.o -lglib-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 libudisks-daemon.la libtool: link: x86_64-pc-linux-gnu-gcc -DG_LOG_DOMAIN=\"udisksd\" -march=core2 -O2 -pipe -Waggregate-return -Wall -W -Wextra -Wcast-align -Wdeclaration-after-statement -Wendif-labels -Werror=format-security -Werror=implicit-function-declaration -Werror=overflow -Wformat-nonliteral -Wformat=2 -Wimplicit -Winit-self -Wlogical-op -Wmissing-declarations -Wmissing-format-attribute -Wmissing-include-dirs -Wmissing-noreturn -Wmissing-prototypes -Wnested-externs -Wno-inline -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-switch-enum -Wno-unused-parameter -Wno-unused-result -Wold-style-definition -Wpacked -Wpointer-arith -Wshadow -Wsign-compare -Wstrict-aliasing=2 -Wstrict-prototypes -Wundef -Wuninitialized -Wunsafe-loop-optimizations -Wvla -Wwrite-strings -fdata-sections -fdiagnostics-show-option -ffast-math -ffunction-sections -fno-common -fno-strict-aliasing -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Wl,-O1 -Wl,--no-as-needed -o .libs/udisksd udisksd-main.o ./.libs/libudisks-daemon.a -lgudev-1.0 -latasmart -lpolkit-gobject-1 -lacl -lsystemd-login -lsystemd-daemon /tmp/portage/sys-fs/udisks-2.0.92-r1/work/udisks-2.0.92/udisks/.libs/libudisks2.so -lgio-2.0 -lgobject-2.0 -lglib-2.0 -pthread /usr/lib/gcc/x86_64-pc-linux-gnu/4.6.3/../../../../lib64/libsystemd-login.so: undefined reference to `sd_id128_get_boot' /usr/lib/gcc/x86_64-pc-linux-gnu/4.6.3/../../../../lib64/libsystemd-login.so: undefined reference to `sd_id128_to_string' /usr/lib/gcc/x86_64-pc-linux-gnu/4.6.3/../../../../lib64/libsystemd-login.so: undefined reference to `sd_id128_get_machine' collect2: ld returned 1 exit status make[4]: *** [udisksd] Error 1 make[4]: Leaving directory `/tmp/portage/sys-fs/udisks-2.0.92-r1/work/udisks-2.0.92/src' make[3]: *** [all-recursive] Error 1 make[3]: Leaving directory `/tmp/portage/sys-fs/udisks-2.0.92-r1/work/udisks-2.0.92/src' make[2]: *** [all] Error 2 make[2]: Leaving directory `/tmp/portage/sys-fs/udisks-2.0.92-r1/work/udisks-2.0.92/src' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/tmp/portage/sys-fs/udisks-2.0.92-r1/work/udisks-2.0.92' make: *** [all] Error 2 This problem is fixed by appending libsystemd-id128 to PKG_CHECK_MODULES in configure.ac. Then the build fails again with: /bin/sh ../libtool --tag=CC --mode=link x86_64-pc-linux-gnu-gcc -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -pthread -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -pthread -I/usr/include/polkit-1 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -pthread -I/usr/include/polkit-1 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -march=core2 -O2 -pipe -Waggregate-return -Wall -W -Wextra -Wcast-align -Wdeclaration-after-statement -Wendif-labels -Werror=format-security -Werror=implicit-function-declaration -Werror=overflow -Wformat-nonliteral -Wformat=2 -Wimplicit -Winit-self -Wlogical-op -Wmissing-declarations -Wmissing-format-attribute -Wmissing-include-dirs -Wmissing-noreturn -Wmissing-prototypes -Wnested-externs -Wno-inline -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-switch-enum -Wno-unused-parameter -Wno-unused-result -Wold-style-definition -Wpacked -Wpointer-arith -Wshadow -Wsign-compare -Wstrict-aliasing=2 -Wstrict-prototypes -Wundef -Wuninitialized -Wunsafe-loop-optimizations -Wvla -Wwrite-strings -fdata-sections -fdiagnostics-show-option -ffast-math -ffunction-sections -fno-common -fno-strict-aliasing -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Wl,-O1 -Wl,--no-as-needed -o udisksctl udisksctl-udisksctl.o -lglib-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lpolkit-gobject-1 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lpolkit-agent-1 -lpolkit-gobject-1 -lgio-2.0 -lgobject-2.0 -lglib-2.0 ../udisks/libudisks2.la libtool: link: x86_64-pc-linux-gnu-gcc -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -pthread -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -pthread -I/usr/include/polkit-1 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -pthread -I/usr/include/polkit-1 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -march=core2 -O2 -pipe -Waggregate-return -Wall -W -Wextra -Wcast-align -Wdeclaration-after-statement -Wendif-labels -Werror=format-security -Werror=implicit-function-declaration -Werror=overflow -Wformat-nonliteral -Wformat=2 -Wimplicit -Winit-self -Wlogical-op -Wmissing-declarations -Wmissing-format-attribute -Wmissing-include-dirs -Wmissing-noreturn -Wmissing-prototypes -Wnested-externs -Wno-inline -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-switch-enum -Wno-unused-parameter -Wno-unused-result -Wold-style-definition -Wpacked -Wpointer-arith -Wshadow -Wsign-compare -Wstrict-aliasing=2 -Wstrict-prototypes -Wundef -Wuninitialized -Wunsafe-loop-optimizations -Wvla -Wwrite-strings -fdata-sections -fdiagnostics-show-option -ffast-math -ffunction-sections -fno-common -fno-strict-aliasing -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Wl,-O1 -o .libs/udisksctl udisksctl-udisksctl.o -Wl,--no-as-needed -lpolkit-agent-1 -lpolkit-gobject-1 ../udisks/.libs/libudisks2.so -lgio-2.0 -lgobject-2.0 -lglib-2.0 -pthread /usr/lib64/libsystemd-login.so.0: undefined reference to `sd_id128_get_machine' /usr/lib64/libsystemd-login.so.0: undefined reference to `sd_id128_to_string' /usr/lib64/libsystemd-login.so.0: undefined reference to `sd_id128_get_boot' /usr/lib64/libsystemd-login.so.0: undefined reference to `sd_listen_fds' collect2: ld returned 1 exit status make[2]: *** [udisksctl] Error 1 make[2]: Leaving directory `/tmp/portage/sys-fs/udisks-2.0.92-r1/work/udisks-2.0.92/tools' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/tmp/portage/sys-fs/udisks-2.0.92-r1/work/udisks-2.0.92' make: *** [all] Error 2 This problem is fixed by adding $(LIBSYSTEMD_LOGIN_LIBS) to udisksctl_LDADD in tools/Makefile.am. The output is from a compilation using Gentoo's emerge, but it can be reproduced by a normal compile. Also, Gentoo uses by default "-Wl,--as-needed", and this causes the second problem to persist even when $(LIBSYSTEMD_LOGIN_LIBS) is added to udisksctl_LDADD in tools/Makefile.am. Removing "-Wl,--as-needed" allows the compilation to complete. Both solutions (the changes to configure.ac and to tools/Makefile.am) are in the attachment.
Hmm. /usr/lib/gcc/x86_64-pc-linux-gnu/4.6.3/../../../../lib64/libsystemd-login.so: undefined reference to `sd_id128_get_machine' This look as if libsystemd-login.so was itself underlinked and the fix should go into systemd instead of udisks?
This is some kind of underlinking in systemd. I don't see sd-login.c using any of the listed functions directly, so I think that's a missing LIBADD for libsystemd-common.la.
Created attachment 76282 [details] [review] systemd 198 underlink patch Indeed the bug is in systemd: it affects not only udisks, but any other program linking against libsystemd-login: gnome-session, gdm, gnome-shell, etc. The attached patch fix the issue with all of them, but I'm not sure if it's the correct solution. I will send the patch to the systemd mailing list to ask for guidance. Thanks.
I haven't looked at this exact issue, but some discussion of a related one here: http://lists.freedesktop.org/archives/systemd-devel/2013-January/008545.html
Should be fixed in http://cgit.freedesktop.org/systemd/systemd/commit/?id=d29dd033022.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.