Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't build against systemd git master (cannot find -lsystemd-login) #18

Open
eliasp opened this issue May 1, 2014 · 3 comments
Open

Comments

@eliasp
Copy link

eliasp commented May 1, 2014

>>> Compiling source in /var/tmp/portage/sys-apps/user-session-units-9999/work/user-session-units-9999 ...
>>> Working in BUILD_DIR: "/var/tmp/portage/sys-apps/user-session-units-9999/work/user-session-units-9999_build"
make -j3
x86_64-pc-linux-gnu-gcc -DPACKAGE_NAME=\"user-session-units\" -DPACKAGE_TARNAME=\"user-session-units\" -DPACKAGE_VERSION=\"9\" -DPACKAGE_STRING=\"user-session-units\ 9\" -DPACKAGE_BUGREPORT=\"[email protected]\" -DPACKAGE_URL=\"\" -DPACKAGE=\"user-session-units\" -DVERSION=\"9\" -I. -I/var/tmp/portage/sys-apps/user-session-units-9999/work/user-session-units-9999    -std=gnu99 -fstack-protector -Wall -pedantic -Wstrict-prototypes -Wundef -fno-common -Werror-implicit-function-declaration -Wformat -Wformat-security -Werror=format-security -Wconversion -march=core2 -O2 -pipe -ggdb -c -o launcher.o `test -f 'src/launcher.c' || echo '/var/tmp/portage/sys-apps/user-session-units-9999/work/user-session-units-9999/'`src/launcher.c
x86_64-pc-linux-gnu-gcc -DPACKAGE_NAME=\"user-session-units\" -DPACKAGE_TARNAME=\"user-session-units\" -DPACKAGE_VERSION=\"9\" -DPACKAGE_STRING=\"user-session-units\ 9\" -DPACKAGE_BUGREPORT=\"[email protected]\" -DPACKAGE_URL=\"\" -DPACKAGE=\"user-session-units\" -DVERSION=\"9\" -I. -I/var/tmp/portage/sys-apps/user-session-units-9999/work/user-session-units-9999    -std=gnu99 -fstack-protector -Wall -pedantic -Wstrict-prototypes -Wundef -fno-common -Werror-implicit-function-declaration -Wformat -Wformat-security -Werror=format-security -Wconversion -march=core2 -O2 -pipe -ggdb -c -o pam.o `test -f 'src/pam.c' || echo '/var/tmp/portage/sys-apps/user-session-units-9999/work/user-session-units-9999/'`src/pam.c
x86_64-pc-linux-gnu-gcc -std=gnu99 -fstack-protector -Wall -pedantic -Wstrict-prototypes -Wundef -fno-common -Werror-implicit-function-declaration -Wformat -Wformat-security -Werror=format-security -Wconversion -march=core2 -O2 -pipe -ggdb  -Wl,-O1 -Wl,--as-needed -o user-session-launch launcher.o pam.o -lsystemd-login -lpam -lpam_misc
/usr/lib/gcc/x86_64-pc-linux-gnu/4.7.3/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lsystemd-login
collect2: error: ld returned 1 exit status
make: *** [user-session-launch] Error 1
@fredcadete
Copy link
Contributor

I have an idea of the root cause: systemd stopped packaging libsystemd-login as a separate library at version 209. See https://github.com/systemd/systemd/blob/master/NEWS#L2460

A workaround is to configure systemd with --enable-compat-libs.

A solution in user-session-units would be to either:

  • s/libsystemd-login/libsystemd/ in Makefile.am. It breaks support for systemd versions older than 209.
  • Check the version of systemd and link differently depending on that.

@sofar
Copy link
Contributor

sofar commented Jul 14, 2015

Considering 209 being somewhat old already, I'm more than willing to take a patch for the s/libsystemd-login/libsystemd/ change. Of course a version detection patch would be more complete, but it'll likely be a bit more complex.

Care to write a patch, @fredcadete ?

@fredcadete
Copy link
Contributor

There it is. Used pkgconfig's ldflags in the end.

My build against systemd 211 now passes. I did not test it on runtime though. Good luck!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants