Bug 69966 - libsystemd-login needs to link against libsystemd-label
Summary: libsystemd-login needs to link against libsystemd-label
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:
Depends on:
Blocks:
 
Reported: 2013-09-30 14:07 UTC by Michał Górny
Modified: 2013-10-02 02:59 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
Patch fixing the issue (651 bytes, text/plain)
2013-09-30 14:07 UTC, Michał Górny
Details

Description Michał Górny 2013-09-30 14:07:25 UTC
Created attachment 86850 [details]
Patch fixing the issue

It seems that this is hard to reproduce but few of our users are hitting this repeatedly.

libsystemd-login.la uses cg_create() that currently seems to be a part of libsystemd-label.la. However, it doesn't link against that library and it seems that none of the (unconditional) libraries it uses do. In the end, people end up getting «undefined reference to `cg_create'» when trying to build e.g. dbus.

Applying the attached patch seems to fix the issue. However, I'm not entirely sure if we aren't missing something.
Comment 1 Kay Sievers 2013-09-30 15:29:40 UTC
As mentione on IRC already, that looks like a buildsys issue.
systemd-login should not need the cg-label symbols.

Any chance to find out why they are pulled-in, instead of linking the not
actually needed lib against the tool?

This should not print anything:
  $ nm -D .libs/libsystemd-login.so | grep cg
Comment 2 Michał Górny 2013-09-30 15:37:10 UTC
The best research was done in [1]. I myself can't reproduce this so I don't think I can help you more than by relaying whatever new ideas may come up.

Maybe -Wl,--whole-archive is relevant somehow?

[1]:https://bugs.gentoo.org/show_bug.cgi?id=479038#c29
Comment 3 Mike Frysinger 2013-09-30 17:57:04 UTC
mgorny is Michał is correct -- cgroup-util.o is placed into libsystemd-shared.a and then linked with -Wl,--whole-archive when generating libsystemd-login.so
Comment 4 Zbigniew Jedrzejewski-Szmek 2013-09-30 22:10:10 UTC
Applied in http://cgit.freedesktop.org/systemd/systemd/commit/?id=ceadabb.

> Applying the attached patch seems to fix the issue. However, I'm not entirely sure if we aren't missing something.

Your analysis is definitely correct. Even if everything works most of the time, we should apply the patch anyway. If/when we restructure the code to not need this, we can remove the additional library.
Comment 5 Kay Sievers 2013-09-30 22:37:34 UTC
I reverted it.

We do not want to pull-in selinux into all users of systemd-logind. We need
to find the reason for the failure, or the solution to fix it, and not just
work around it that way.
Comment 6 Lennart Poettering 2013-10-02 02:59:30 UTC
Fixed in git.


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.