! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Missing explicit libadd for libxfpmcommon_la and libxfpmdbus_la
Status:
RESOLVED: FIXED
Product:
Xfce4-power-manager
Component:
General

Comments

Description Lionel Le Folgoc 2010-12-09 16:23:12 CET
Hi,

Xfce4-power-information seems to call dbus_error_init(), but it doesn't link against libdbus directly, only libdbus-glib. It will make the linking fail with binutils-gold and/or --no-add-needed.

The fix is probably to add $(DBUS_LIBS) to xfce4_power_information_LDADD in src/Makefile.am.

Thanks!
Comment 1 Lionel Le Folgoc 2010-12-09 18:08:43 CET
Created attachment 3261 
proposed patch

My previous comment was probably wrong.

libxfpmcommon.la and libxfpmdbus.la aren't linked against any lib. This seems wrong, and the build will fail later when linking some binaries (the brightness plugin and xfce4-power-information) against these la files.

The attached patch fixes this issue for me (I put a random value in x11_minimal_version, feel free to change it).

Also, the xfce4_brightness_plugin_LDADD change introduced by 4ceb85e5d9a1c8f18a094f462eb94c703ad1581d is useless with this patch, now that libxfpmcommon.la is correctly linked with its dependencies.
Comment 2 Lionel Le Folgoc 2010-12-12 13:19:17 CET
Mmmh, I used XDT_CHECK_PACKAGE([X11],…) and @X11_LIBS@, but this is probably wrong, XDT_CHECK_LIBX11() and @LIBX11_LIBS@ should be used instead.
Comment 3 Ali Abdallah editbugs 2011-01-04 13:07:37 CET
Xfce4-power-information does not use dbus_error_init(), xfpm users dbus-glib only, i don't take the risk to base my code on dbus directly.

I'll close this for now, please re-open if you have any problem.
Comment 4 Lionel Le Folgoc 2011-01-04 19:29:39 CET
% grep -Ri dbus_error_init *
libdbus/xfpm-dbus.c:    dbus_error_init (&error);
libdbus/xfpm-dbus.c:    dbus_error_init(&error);
libdbus/xfpm-dbus.c:    dbus_error_init(&error);

Sorry, obviously you use libdbus directly, and you don't link directly to it (same for libx11).
Comment 5 Lionel Le Folgoc 2011-01-04 19:31:09 CET
And also please look at my second comment, where I wrote about the libs, not xfce4-power-information (which was wrong).
Comment 6 Yves-Alexis Perez editbugs 2011-01-04 23:05:15 CET
Created attachment 3324 
fix linking against x11, dbus and randr

Here's an updated version of the patch for 1.0.3
Comment 7 Ali Abdallah editbugs 2011-01-04 23:55:32 CET
Thanks for the patch, applied and committed.

Bug #6954

Reported by:
Lionel Le Folgoc
Reported on: 2010-12-09
Last modified on: 2011-01-04

People

Assignee:
Ali Abdallah
CC List:
0 users

Version

Attachments

proposed patch (1.92 KB, patch)
2010-12-09 18:08 CET , Lionel Le Folgoc
no flags
fix linking against x11, dbus and randr (2.15 KB, patch)
2011-01-04 23:05 CET , Yves-Alexis Perez
no flags

Additional information