gio-2.0 missing from liblightdm-gobject-1.pc
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Light Display Manager |
Invalid
|
Medium
|
Unassigned |
Bug Description
Hey,
liblightdm-gobject uses g_file_monitor() which comes from gio, but doesn't put this library in the libs field of the pkg-config file, which means lightdm-gtk-greeter 1.1.0 fails to build with linker error. Attached patch to lightdm seems to fix the problem for me.
Robert Ancell (robert-ancell) wrote : | #2 |
Changed in lightdm: | |
status: | New → Incomplete |
importance: | Undecided → Medium |
Yves-Alexis Perez (corsac) wrote : | #3 |
What fails is the lightdm-gtk-greeter 1.1 build, at link time:
CCLD lightdm-gtk-greeter
/usr/bin/ld: /usr/lib/
/usr/bin/ld: note: 'g_file_monitor' is defined in DSO /usr/lib/
/usr/lib/
Robert Ancell (robert-ancell) wrote : | #4 |
Not sure what's going on there but there are some strange issues...
/usr/bin/ld: /usr/lib/
- is there some static linking going on? (In that case the updated .pc in 1.1.1 should work better)
This also seems a bit suspicious...
/usr/lib/
Yves-Alexis Perez (corsac) wrote : | #5 |
With lightdm 1.1.1 (where gio-2.0 was added but everything was moved to Requires.private) I still get (with make V=1)
make[2]: Entering directory `/tmp/buildd/
/bin/bash ../libtool --tag=CC --mode=link gcc -DGETTEXT_
libtool: link: gcc -DGETTEXT_
/usr/bin/ld: /usr/lib/
/usr/bin/ld: note: 'g_file_monitor' is defined in DSO /usr/lib/
/usr/lib/
collect2: ld returned 1 exit status
make[2]: *** [lightdm-
make[2]: Leaving directory `/tmp/buildd/
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/tmp/buildd/l...
Sebastien Bacher (seb128) wrote : | #6 |
That error doesn't really make sense, -lgio... is listed in the build line, seems like it could be a bug in your toolchain rather.
Sebastien Bacher (seb128) wrote : | #7 |
could you add the full build log to the bug?
Yves-Alexis Perez (corsac) wrote : | #8 |
Yves-Alexis Perez (corsac) wrote : | #9 |
And with V=1:
scapa# make V=1
make all-recursive
make[1]: Entering directory `/tmp/buildd/
Making all in data
make[2]: Entering directory `/tmp/buildd/
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/tmp/buildd/
Making all in po
make[2]: Entering directory `/tmp/buildd/
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/tmp/buildd/
Making all in src
make[2]: Entering directory `/tmp/buildd/
/bin/bash ../libtool --tag=CC --mode=link gcc -DGETTEXT_
libtool: link: gcc -DGETTEXT_
/usr/bin/ld: /usr/lib/
/usr/bin/ld: note: 'g_file_monitor' is defined in DSO /usr/lib/
Yves-Alexis Perez (corsac) wrote : | #10 |
- lightdm-gtk-greeter build log with lightdm patch Edit (71.5 KiB, text/plain)
Here's a (verbose) build with the following patch added to lightdm:
Index: lightdm-
=======
--- lightdm-
+++ lightdm-
@@ -6,6 +6,7 @@
Name: liblightdm-gobject
Description: LightDM client library
Version: @VERSION@
-Requires.private: glib-2.0 gio-2.0 gio-unix-2.0 gobject-2.0 libxklavier x11
+Requires.private: glib-2.0 gio-unix-2.0 gobject-2.0 libxklavier x11
+Requires: gio-2.0
Libs: -L${libdir} -llightdm-gobject-1
Cflags: -I${includedir}
Extract from the relevant build lines:
/bin/bash ../libtool --tag=CC --mode=link gcc -DGETTEXT_
libtool: link: gcc -DGETTEXT_
Yves-Alexis Perez (corsac) wrote : | #11 |
And (sorry for spamming) a wdiff might be more readable:
/bin/bash ../libtool --tag=CC --mode=link gcc -DGETTEXT_
So it might just be that the ordering is wrong. Moving gio-2.0 to Requires: moves it more in front and especially *before* -llightdm-
Yves-Alexis Perez (corsac) wrote : | #12 |
- reorder libs in greeter_libs Edit (2.3 KiB, text/plain)
Ok so it /does/ seem that the ordering in configure.ac is important, so the attached patch changes that.
The patch changes both configure.ac and configure so I don't need to run autoreconf, but only the configure.ac part should be applied.
I'm not sure why it doesn't happen for you since it looks related to the gold linker which I think Ubuntu uses too.
Matthias Klose (doko) wrote : | #13 |
this seems to be wrong:
CCLD lightdm-gtk-greeter
/usr/bin/ld: /usr/lib/
investigate why the static lib is used, and not the shared one.
Sebastien Bacher (seb128) wrote : | #14 |
your build log has
"checking if gcc static flag -static works... no"
is that normal? could you add your config.log to the bug?
Yves-Alexis Perez (corsac) wrote : | #15 |
Sebastien Bacher (seb128) wrote : | #16 |
the config.log doesn't have lot of details but it seems to be a bug in the Debian toolchain...
btw do you work on packaging the new greeter for Debian? is your packaging available somewhere? to avoid duplicating work
Yves-Alexis Perez (corsac) wrote : | #17 |
Yes, I've commited at http://
What puzzles me even more is that, if I manually run dh_auto_configure, it correctly find that gcc can use -static.
Yves-Alexis Perez (corsac) wrote : | #18 |
Ok, this is because of hardening flags, and especially PIE:
scapa# LDFLAGS="-fPIE -pie" ./configure |grep -- -static
checking if gcc static flag -static works... no
scapa# ./configure |grep -- -static
checking if gcc static flag -static works... yes
I'm not too sure if lightdm-gtk-greeter does something weird wrt. others, but there's definitely something fishy here.
Sebastien Bacher (seb128) wrote : | #19 |
thanks for the packaging link
"LDFLAGS="-fPIE -pie" ./configure |grep -- -static" returns "yes" on Ubuntu for the record
Yves-Alexis Perez (corsac) wrote : | #20 |
Ok, the -static is irrelevant, it seems.
Thanks Matthias for the hint, the fault was indeed mine, the liblightdm-
Changed in lightdm: | |
status: | Incomplete → Invalid |
Hi Yves-Alexis,
Could you show me the case where the linking fails? liblightdm-gobject should already be linked against gio so this shouldn't be necessary to be in the .pc file, i.e: liblightdm- gobject- 1.so 3000) x86_64- linux-gnu/ libgio- 2.0.so. 0 (0x00007f970dd4 8000)
$ ldd /usr/lib/
linux-vdso.so.1 => (0x00007fff908b
libgio-2.0.so.0 => /usr/lib/