FTBFS missing symbols from libsystemd
mcepl opened this issue · comments
Trying to build idlehack on openSUSE and I get this:
[ 2s] + /usr/bin/make -O -j8 V=1 VERBOSE=1
[ 2s] cc -I/usr/include/dbus-1.0 -I/usr/lib64/dbus-1.0/include -DHAVE_LIBSYSTEMD -DHAVE_UNISTD_H -DGETTIMEOFDAY_TWO_ARGS -O3 -ldbus-1 -lsystemd idlehack.c blurb.c yarandom.c -o idlehack
[ 2s] /usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: /tmp/ccpi1Icd.o: in function `xscreensaver_method_uninhibit':
[ 2s] idlehack.c:(.text+0x43): undefined reference to `sd_bus_message_read'
[ 2s] /usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: idlehack.c:(.text+0x53): undefined reference to `sd_bus_message_get_sender'
[ 2s] /usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: idlehack.c:(.text+0xdc): undefined reference to `sd_bus_track_remove_name'
[ 2s] /usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: idlehack.c:(.text+0x117): undefined reference to `sd_bus_reply_method_return'
[ 2s] /usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: /tmp/ccpi1Icd.o: in function `xscreensaver_method_inhibit':
[ 2s] idlehack.c:(.text+0x277): undefined reference to `sd_bus_message_read'
[ 2s] /usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: idlehack.c:(.text+0x2b6): undefined reference to `sd_bus_message_get_sender'
[ 2s] /usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: idlehack.c:(.text+0x316): undefined reference to `sd_bus_track_add_name'
[ 2s] /usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: idlehack.c:(.text+0x391): undefined reference to `sd_bus_reply_method_return'
[ 2s] /usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: /tmp/ccpi1Icd.o: in function `xscreensaver_systemd_loop':
[ 2s] idlehack.c:(.text+0x65a): undefined reference to `sd_bus_open_user'
[ 2s] /usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: idlehack.c:(.text+0x677): undefined reference to `sd_bus_track_new'
[ 2s] /usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: idlehack.c:(.text+0x6aa): undefined reference to `sd_bus_add_object_vtable'
[ 2s] /usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: idlehack.c:(.text+0x6d6): undefined reference to `sd_bus_add_object_vtable'
[ 2s] /usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: idlehack.c:(.text+0x6ed): undefined reference to `sd_bus_request_name'
[ 2s] /usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: idlehack.c:(.text+0x70d): undefined reference to `sd_bus_request_name'
[ 2s] /usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: idlehack.c:(.text+0x721): undefined reference to `sd_bus_open_system'
[ 2s] /usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: idlehack.c:(.text+0x751): undefined reference to `sd_bus_add_match'
[ 2s] /usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: idlehack.c:(.text+0x796): undefined reference to `sd_bus_process'
[ 2s] /usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: idlehack.c:(.text+0x803): undefined reference to `sd_bus_flush_close_unref'
[ 2s] /usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: idlehack.c:(.text+0x814): undefined reference to `sd_bus_track_unref'
[ 2s] /usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: idlehack.c:(.text+0x823): undefined reference to `sd_bus_flush_close_unref'
[ 2s] /usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: idlehack.c:(.text+0x82d): undefined reference to `sd_bus_error_free'
[ 2s] /usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: idlehack.c:(.text+0x88e): undefined reference to `sd_bus_process'
[ 2s] /usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: idlehack.c:(.text+0x9ab): undefined reference to `sd_bus_track_count_name'
[ 2s] /usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: idlehack.c:(.text+0x9f8): undefined reference to `sd_bus_get_fd'
[ 2s] /usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: idlehack.c:(.text+0xa11): undefined reference to `sd_bus_get_events'
[ 2s] /usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: idlehack.c:(.text+0xa35): undefined reference to `sd_bus_get_fd'
[ 2s] /usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: idlehack.c:(.text+0xa4e): undefined reference to `sd_bus_get_events'
[ 2s] /usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: idlehack.c:(.text+0xa77): undefined reference to `sd_bus_get_timeout'
[ 2s] /usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: idlehack.c:(.text+0xa8e): undefined reference to `sd_bus_get_timeout'
[ 2s] /usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: idlehack.c:(.text+0xbdd): undefined reference to `sd_bus_get_name_creds'
[ 2s] /usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: idlehack.c:(.text+0xbfa): undefined reference to `sd_bus_creds_get_pid'
[ 2s] /usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: idlehack.c:(.text+0xc09): undefined reference to `sd_bus_creds_unref'
[ 2s] /usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: /tmp/ccpi1Icd.o: in function `xscreensaver_systemd_handler':
[ 2s] idlehack.c:(.text+0xed9): undefined reference to `sd_bus_message_read'
[ 2s] /usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: idlehack.c:(.text+0xf0d): undefined reference to `sd_bus_message_unref'
[ 2s] /usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: /tmp/ccpi1Icd.o:(.data.rel.ro+0x18): undefined reference to `sd_bus_object_vtable_format'
[ 2s] collect2: error: ld returned 1 exit status
[ 2s] make: *** [<builtin>: idlehack] Error 1
both /usr/lib64/libsystemd.so and /usr/lib64/libdbus-1.so are installed from
systemd-devel-249.7-1.1.x86_64
and dbus-1-devel-1.12.20-6.1.x86_64
.
Complete build log with versions of packages used and steps taken.
Hmm, for some reason, I had to set up fixed order of linking arguments:
---
Makefile | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
CFLAGS:=$(shell pkg-config --cflags dbus-1) -DHAVE_LIBSYSTEMD -DHAVE_UNISTD_H -DGETTIMEOFDAY_TWO_ARGS -O3
LDFLAGS:=$(shell pkg-config --libs dbus-1) $(shell pkg-config --libs libsystemd)
-idlehack: idlehack.c blurb.c yarandom.c
-
+idlehack: idlehack.o blurb.o yarandom.o
+ cc -o $@ $? $(LDFLAGS)
Did you manage to get it compiled? If so, I'll update the Makefile with your change.
BTW, you will need a Systemd of v237 or newer.
Did you manage to get it compiled? If so, I'll update the Makefile with your change.
Yes, with this patch on Makefile, it builds. See https://build.opensuse.org/package/show/home:mcepl:work/idlehack (not yet an official repo).