gio-2.0 missing from liblightdm-gobject-1.pc

Bug #916477 reported by Yves-Alexis Perez
6
This bug affects 1 person
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.

Revision history for this message
Robert Ancell (robert-ancell) wrote :

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:
$ ldd /usr/lib/liblightdm-gobject-1.so
 linux-vdso.so.1 => (0x00007fff908b3000)
 libgio-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0 (0x00007f970dd48000)

Changed in lightdm:
status: New → Incomplete
importance: Undecided → Medium
Revision history for this message
Yves-Alexis Perez (corsac) wrote :

What fails is the lightdm-gtk-greeter 1.1 build, at link time:

  CCLD lightdm-gtk-greeter
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/liblightdm-gobject-1.a(liblightdm_gobject_1_la-user.o): undefined reference to symbol 'g_file_monitor'
/usr/bin/ld: note: 'g_file_monitor' is defined in DSO /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libgio-2.0.so so try adding it to the linker command line
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libgio-2.0.so: could not read symbols: Invalid operation

Revision history for this message
Robert Ancell (robert-ancell) wrote :

Not sure what's going on there but there are some strange issues...
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/liblightdm-gobject-1.a(liblightdm_gobject_1_la-user.o): undefined reference to symbol 'g_file_monitor'
- 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/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libgio-2.0.so: could not read symbols: Invalid operation

Revision history for this message
Yves-Alexis Perez (corsac) wrote :
Download full text (3.2 KiB)

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/lightdm-gtk-greeter-1.1.1/src'
/bin/bash ../libtool --tag=CC --mode=link gcc -DGETTEXT_PACKAGE=\"lightdm-gtk-greeter\" -DLOCALEDIR=\""/usr/share/locale"\" -DGREETER_DATA_DIR=\"""\" -DCONFIG_FILE=\""/lightdm-gtk-greeter.conf"\" -DGSEAL_ENABLE -pthread -I/usr/include/gtk-3.0 -I/usr/include/atk-1.0 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/lightdm-gobject-1 -I/usr/include/cairo -I/usr/include/libxml2 -Wall -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wno-sign-compare -g -O2 -fPIE -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -fPIE -pie -Wl,-z,relro -Wl,-z,now -Wl,--as-needed -Wl,-O1 -o lightdm-gtk-greeter lightdm_gtk_greeter-lightdm-gtk-greeter.o -pthread -Wl,--export-dynamic -lgtk-3 -lgdk-3 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo-gobject -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lgthread-2.0 -llightdm-gobject-1 -lgmodule-2.0 -lrt -lglib-2.0
libtool: link: gcc -DGETTEXT_PACKAGE=\"lightdm-gtk-greeter\" -DLOCALEDIR=\"/usr/share/locale\" -DGREETER_DATA_DIR=\"\" -DCONFIG_FILE=\"/lightdm-gtk-greeter.conf\" -DGSEAL_ENABLE -pthread -I/usr/include/gtk-3.0 -I/usr/include/atk-1.0 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/lightdm-gobject-1 -I/usr/include/cairo -I/usr/include/libxml2 -Wall -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wno-sign-compare -g -O2 -fPIE -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -fPIE -pie -Wl,-z -Wl,relro -Wl,-z -Wl,now -Wl,--as-needed -Wl,-O1 -o lightdm-gtk-greeter lightdm_gtk_greeter-lightdm-gtk-greeter.o -pthread -Wl,--export-dynamic -lgtk-3 -lgdk-3 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 /usr/lib/libcairo-gobject.so /usr/lib/libcairo.so -lpango-1.0 /usr/lib/x86_64-linux-gnu/libfreetype.so -lfontconfig -lgobject-2.0 -lgthread-2.0 -llightdm-gobject-1 -lgmodule-2.0 -lrt -lglib-2.0 -pthread
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/liblightdm-gobject-1.a(liblightdm_gobject_1_la-user.o): undefined reference to symbol 'g_file_monitor'
/usr/bin/ld: note: 'g_file_monitor' is defined in DSO /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libgio-2.0.so so try adding it to the linker command line
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libgio-2.0.so: could not read symbols: Invalid operation
collect2: ld returned 1 exit status
make[2]: *** [lightdm-gtk-greeter] Error 1
make[2]: Leaving directory `/tmp/buildd/lightdm-gtk-greeter-1.1.1/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/tmp/buildd/l...

Read more...

Revision history for this message
Sebastien Bacher (seb128) wrote :

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.

Revision history for this message
Sebastien Bacher (seb128) wrote :

could you add the full build log to the bug?

Revision history for this message
Yves-Alexis Perez (corsac) wrote :

Here's a build log for 1.1.2.

Revision history for this message
Yves-Alexis Perez (corsac) wrote :
Download full text (3.6 KiB)

And with V=1:

scapa# make V=1
make all-recursive
make[1]: Entering directory `/tmp/buildd/lightdm-gtk-greeter-1.1.2'
Making all in data
make[2]: Entering directory `/tmp/buildd/lightdm-gtk-greeter-1.1.2/data'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/tmp/buildd/lightdm-gtk-greeter-1.1.2/data'
Making all in po
make[2]: Entering directory `/tmp/buildd/lightdm-gtk-greeter-1.1.2/po'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/tmp/buildd/lightdm-gtk-greeter-1.1.2/po'
Making all in src
make[2]: Entering directory `/tmp/buildd/lightdm-gtk-greeter-1.1.2/src'
/bin/bash ../libtool --tag=CC --mode=link gcc -DGETTEXT_PACKAGE=\"lightdm-gtk-greeter\" -DLOCALEDIR=\""/usr/share/locale"\" -DGREETER_DATA_DIR=\"""\" -DCONFIG_FILE=\""/lightdm-gtk-greeter.conf"\" -DGSEAL_ENABLE -pthread -I/usr/include/gtk-3.0 -I/usr/include/atk-1.0 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/lightdm-gobject-1 -I/usr/include/cairo -I/usr/include/libxml2 -Wall -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wno-sign-compare -g -O2 -fPIE -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -fPIE -pie -Wl,-z,relro -Wl,-z,now -Wl,--as-needed -Wl,-O1 -o lightdm-gtk-greeter lightdm_gtk_greeter-lightdm-gtk-greeter.o -pthread -Wl,--export-dynamic -lgtk-3 -lgdk-3 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo-gobject -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lgthread-2.0 -lX11 -llightdm-gobject-1 -lgmodule-2.0 -lrt -lglib-2.0
libtool: link: gcc -DGETTEXT_PACKAGE=\"lightdm-gtk-greeter\" -DLOCALEDIR=\"/usr/share/locale\" -DGREETER_DATA_DIR=\"\" -DCONFIG_FILE=\"/lightdm-gtk-greeter.conf\" -DGSEAL_ENABLE -pthread -I/usr/include/gtk-3.0 -I/usr/include/atk-1.0 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/lightdm-gobject-1 -I/usr/include/cairo -I/usr/include/libxml2 -Wall -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wno-sign-compare -g -O2 -fPIE -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -fPIE -pie -Wl,-z -Wl,relro -Wl,-z -Wl,now -Wl,--as-needed -Wl,-O1 -o lightdm-gtk-greeter lightdm_gtk_greeter-lightdm-gtk-greeter.o -pthread -Wl,--export-dynamic -lgtk-3 -lgdk-3 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 /usr/lib/libcairo-gobject.so /usr/lib/libcairo.so -lpango-1.0 /usr/lib/x86_64-linux-gnu/libfreetype.so -lfontconfig -lgobject-2.0 -lgthread-2.0 -lX11 -llightdm-gobject-1 -lgmodule-2.0 -lrt -lglib-2.0 -pthread
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/liblightdm-gobject-1.a(liblightdm_gobject_1_la-user.o): undefined reference to symbol 'g_file_monitor'
/usr/bin/ld: note: 'g_file_monitor' is defined in DSO /usr/lib/gcc/x86_64-linux-gnu/4.6...

Read more...

Revision history for this message
Yves-Alexis Perez (corsac) wrote :

Here's a (verbose) build with the following patch added to lightdm:

Index: lightdm-1.1.1/liblightdm-gobject/liblightdm-gobject-1.pc.in
===================================================================
--- lightdm-1.1.1.orig/liblightdm-gobject/liblightdm-gobject-1.pc.in 2012-01-17 06:44:03.000000000 +0100
+++ lightdm-1.1.1/liblightdm-gobject/liblightdm-gobject-1.pc.in 2012-01-31 07:50:32.516042389 +0100
@@ -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}/lightdm-gobject-1

Extract from the relevant build lines:

/bin/bash ../libtool --tag=CC --mode=link gcc -DGETTEXT_PACKAGE=\"lightdm-gtk-greeter\" -DLOCALEDIR=\""/usr/share/locale"\" -DGREETER_DATA_DIR=\"""\" -DCONFIG_FILE=\""/lightdm-gtk-greeter.conf"\" -DGSEAL_ENABLE -pthread -I/usr/include/gtk-3.0 -I/usr/include/atk-1.0 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/lightdm-gobject-1 -I/usr/include/cairo -I/usr/include/libxml2 -Wall -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wno-sign-compare -g -O2 -fPIE -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -fPIE -pie -Wl,-z,relro -Wl,-z,now -Wl,--as-needed -Wl,-O1 -o lightdm-gtk-greeter lightdm_gtk_greeter-lightdm-gtk-greeter.o -pthread -Wl,--export-dynamic -lgtk-3 -lgdk-3 -latk-1.0 -lpangoft2-1.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo-gobject -lcairo -lpango-1.0 -lfreetype -lfontconfig -lX11 -llightdm-gobject-1 -lgio-2.0 -lgobject-2.0 -lgthread-2.0 -lgmodule-2.0 -lrt -lglib-2.0
libtool: link: gcc -DGETTEXT_PACKAGE=\"lightdm-gtk-greeter\" -DLOCALEDIR=\"/usr/share/locale\" -DGREETER_DATA_DIR=\"\" -DCONFIG_FILE=\"/lightdm-gtk-greeter.conf\" -DGSEAL_ENABLE -pthread -I/usr/include/gtk-3.0 -I/usr/include/atk-1.0 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/lightdm-gobject-1 -I/usr/include/cairo -I/usr/include/libxml2 -Wall -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wno-sign-compare -g -O2 -fPIE -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -fPIE -pie -Wl,-z -Wl,relro -Wl,-z -Wl,now -Wl,--as-needed -Wl,-O1 -o lightdm-gtk-greeter lightdm_gtk_greeter-lightdm-gtk-greeter.o -pthread -Wl,--export-dynamic -lgtk-3 -lgdk-3 -latk-1.0 -lpangoft2-1.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 /usr/lib/libcairo-gobject.so /usr/lib/libcairo.so -lpango-1.0 /usr/lib/x86_64-linux-gnu/libfreetype.so -lfontconfig -lX11 -llightdm-gobject-1 -lgio-2.0 -lgobject-2.0 -lgthread-2.0 -lgmodule-2.0 -lrt -lglib-2.0 -pthread

Revision history for this message
Yves-Alexis Perez (corsac) wrote :

And (sorry for spamming) a wdiff might be more readable:

/bin/bash ../libtool --tag=CC --mode=link gcc -DGETTEXT_PACKAGE=\"lightdm-gtk-greeter\" -DLOCALEDIR=\""/usr/share/locale"\" -DGREETER_DATA_DIR=\"""\" -DCONFIG_FILE=\""/lightdm-gtk-greeter.conf"\" -DGSEAL_ENABLE -pthread -I/usr/include/gtk-3.0 -I/usr/include/atk-1.0 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/lightdm-gobject-1 -I/usr/include/cairo -I/usr/include/libxml2 -Wall -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wno-sign-compare -g -O2 -fPIE -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -fPIE -pie -Wl,-z,relro -Wl,-z,now -Wl,--as-needed -Wl,-O1 -o lightdm-gtk-greeter lightdm_gtk_greeter-lightdm-gtk-greeter.o -pthread -Wl,--export-dynamic -lgtk-3 -lgdk-3 -latk-1.0 {+-lgio-2.0+} -lpangoft2-1.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo-gobject -lcairo -lpango-1.0 -lfreetype -lfontconfig [--lX11 -llightdm-gobject-1 -lgio-2.0-] -lgobject-2.0 -lgthread-2.0 {+-lX11 -llightdm-gobject-1+} -lgmodule-2.0 -lrt -lglib-2.0

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-gobject-1. So maybe this should be changed in lightdm-gtk-greeter Makefiles.

Revision history for this message
Yves-Alexis Perez (corsac) wrote :

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.

Revision history for this message
Matthias Klose (doko) wrote :

this seems to be wrong:

  CCLD lightdm-gtk-greeter
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/liblightdm-gobject-1.a(liblightdm_gobject_1_la-user.o): undefined reference to symbol 'g_file_monitor'

investigate why the static lib is used, and not the shared one.

Revision history for this message
Sebastien Bacher (seb128) wrote :

your build log has
"checking if gcc static flag -static works... no"

is that normal? could you add your config.log to the bug?

Revision history for this message
Yves-Alexis Perez (corsac) wrote :

Here it is.

Revision history for this message
Sebastien Bacher (seb128) wrote :

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

Revision history for this message
Yves-Alexis Perez (corsac) wrote :

Yes, I've commited at http://anonscm.debian.org/viewvc/pkg-xfce/goodies/trunk/lightdm-gtk-greeter/

What puzzles me even more is that, if I manually run dh_auto_configure, it correctly find that gcc can use -static.

Revision history for this message
Yves-Alexis Perez (corsac) wrote :

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.

Revision history for this message
Sebastien Bacher (seb128) wrote :

thanks for the packaging link

"LDFLAGS="-fPIE -pie" ./configure |grep -- -static" returns "yes" on Ubuntu for the record

Revision history for this message
Yves-Alexis Perez (corsac) wrote :

Ok, the -static is irrelevant, it seems.

Thanks Matthias for the hint, the fault was indeed mine, the liblightdm-gobject-1-dev package didn't depend on liblightdm-gobject-1-0 so the shared lib wasn't installed. Sorry for that.

Changed in lightdm:
status: Incomplete → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.