Bug 63167 - sd-daemon.c: should be possible to avoid mq support and hence -lrt dependency
Summary: sd-daemon.c: should be possible to avoid mq support and hence -lrt dependency
Status: RESOLVED FIXED
Alias: None
Product: systemd
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: systemd-bugs
QA Contact: systemd-bugs
URL:
Whiteboard:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2013-04-05 12:57 UTC by Simon McVittie
Modified: 2013-04-08 12:10 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
sd-daemon.c: allow use of -lrt to be avoided (1.33 KB, patch)
2013-04-05 12:57 UTC, Simon McVittie
Details | Splinter Review

Description Simon McVittie 2013-04-05 12:57:34 UTC
Created attachment 77482 [details] [review]
sd-daemon.c: allow use of -lrt to be avoided

In recent glibc, many commonly-used librt functions have moved
from librt to libc. This results in dbus' configure.ac
concluding that we don't need to link in librt. However,
sd-daemon.c needs it for mq_getattr(), causing the build
to fail.
    
dbus doesn't use POSIX message queues, so I'd prefer to be
able to avoid "if on Linux, link librt for sd-daemon.c".

---

See also Bug #63166.

Doing this in terms of "define this macro and the entire sd_is_mq() function will disappear" would also be fine.
Comment 1 Lennart Poettering 2013-04-08 11:55:53 UTC
Applied. That said, a nicer alternative would be to change dbsu to actually link dynamically against libsystem-daemon.so. We nowadays ship this as shared library, so there's no need to deal with the drop-in stuff anymore...
Comment 2 Simon McVittie 2013-04-08 12:10:54 UTC
(In reply to comment #1)
> a nicer alternative would be to change dbsu to actually
> link dynamically against libsystem-daemon.so

Yeah, I did consider it.

At the moment I believe dbus can accept the systemd LISTEN_FDS protocol (which is, admittedly, hardly rocket science) without actually being linked against libsystemd-daemon; so this would be a small feature regression.

I've actually considered turning dbus-launch into a two-stage thing - listen on the socket, then start dbus-daemon when its activation environment is ready and use the LISTEN_FDS protocol to give it the socket - to avoid bugs like <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=682375> without necessarily needing systemd --user. (I realise your answer is going to be "use systemd --user then".)


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.