After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 456513 - Libs line in pc file needs to mention gailutil library
Libs line in pc file needs to mention gailutil library
Status: RESOLVED NOTABUG
Product: libgnomecanvas
Classification: Deprecated
Component: core
2.19.x
Other Solaris
: Normal normal
: ---
Assigned To: libgnomecanvas maintainers
libgnomecanvas maintainers
Depends on:
Blocks:
 
 
Reported: 2007-07-13 09:18 UTC by Damien Carbery
Modified: 2008-06-25 02:22 UTC
See Also:
GNOME target: ---
GNOME version: 2.19/2.20


Attachments
Add -lgailutil to libgnomecanvas-2.0.pc.in file. (440 bytes, patch)
2007-07-13 09:18 UTC, Damien Carbery
rejected Details | Review
Add gail to Requires instead of Libs line of .pc file. (443 bytes, patch)
2007-07-24 16:24 UTC, Damien Carbery
none Details | Review

Description Damien Carbery 2007-07-13 09:18:21 UTC
While building libbonoboui 2.19.4 it fails when linking with libgnomecanvas library (2.19.1)

Undefined			first referenced
 symbol  			    in file
gail_text_util_new                  /usr/lib/libgnomecanvas-2.so
gail_text_util_get_text             /usr/lib/libgnomecanvas-2.so
gail_text_util_text_setup           /usr/lib/libgnomecanvas-2.so
gail_text_util_buffer_setup         /usr/lib/libgnomecanvas-2.so
gail_misc_buffer_get_run_attributes /usr/lib/libgnomecanvas-2.so
gail_misc_get_origins               /usr/lib/libgnomecanvas-2.so
ld: fatal: Symbol referencing errors. No output written to .libs/bonobo-hello

Adding '-lgailutil' to the libgonmecanvas-2.0.pc.in file fixes this.
This is required because libgnomecanvas now requires gail.
Comment 1 Damien Carbery 2007-07-13 09:18:56 UTC
Created attachment 91723 [details] [review]
Add -lgailutil to libgnomecanvas-2.0.pc.in file.
Comment 2 Daniel Macks 2007-07-13 20:34:39 UTC
Does libgnomecanvas really need to instruct everything that links against it to link against gailutil, or is a cleaner solution to have only libgnomecanvas itself link agsinst gailutil? Based on the error message, the latter. I see the .pc already lists Requires:gail, so the intent here (probably:) is that libgnomecanvas itself is compiled with 'pkg-config gail'.
Comment 3 Damien Carbery 2007-07-24 14:41:38 UTC
Actually the .pc file only mentions gail in the 'Requires.private' line, not the 'Requires' line.
AFAIK, this is for static linking. Maybe adding 'gail' to 'Requires' will fix the issue.
Comment 4 Daniel Macks 2007-07-24 15:16:32 UTC
Ah yeah. Having it .private is consistent with the apparent intent of having libgnomecanvas itself link gail, not instruct all who link against libgnomecanvas users to link against gail also. configure.in does:

CANVAS_MODULES="dnl
  gtk+-2.0 >= gtk_required_version dnl
  gail >= gail_required_version dnl
  libart-2.0 >= libart_required_version dnl
  pango >= pango_required_version dnl
  pangoft2 >= pango_required_version"
PKG_PROG_PKG_CONFIG([0.18])
PKG_CHECK_MODULES(LIBGNOMECANVAS, $CANVAS_MODULES)

and libgnomecanvas/Makefile.am does:
libgnomecanvas_2_la_LIBADD = \
        $(LIBGNOMECANVAS_LIBS)

so libgnomecanvas-2.so *should be* being compiled with gail.pc's flags. What the heck??

gail as a stand-alone lib is apparently being deprecated, so it's probably not a good idea to be publishing instructions to link against gail. Actually, it looks like gail's source is being copied into libgnomecanvas (bug #363103)...maybe something went wrong (or is not complete) there?
Comment 5 Sven Herzberg 2007-07-24 15:34:06 UTC
According to http://build.gnome.org:8080/libbonoboui/ everything builds fine on Linux. Did you build GNOME with jhbuild? If not, how did you build it? (I think it's more likely to be a problem on your side than with gnome canvas.)

I also reject this patch as -lgailutil is not supposed to be mentioned in libgnomecanvas-2.0.pc because the whole pkg-config system is supposed to track dependencies (otherwise -lgtk-2.0 would have to be there since ages).

Li, are you aware of any solaris-related build failures due to the migration?
Comment 6 Damien Carbery 2007-07-24 16:23:05 UTC
I tried a new patch where I add gail to the Requires line. This works for me.

I build with pkgbuild (rpm-like interface for package building on Solaris: http://pkgbuild.sourceforge.net/).
See: http://www.opensolaris.org/os/project/jds/contributing/building/#jds-cbe
Comment 7 Damien Carbery 2007-07-24 16:24:09 UTC
Created attachment 92290 [details] [review]
Add gail to Requires instead of Libs line of .pc file.
Comment 8 Li Yuan 2007-07-25 09:24:00 UTC
This may because we doesn't ship *.la files on Solaris which can be found on Linux. In /usr/lib/libgnomecanvas-2.la we can find "/usr/lib/libgailutil.la" in dependency_libs. 
Comment 9 Damien Carbery 2007-08-09 11:25:54 UTC
What are your opinions on the new patch that adds gail to the Requires line?
Comment 10 Daniel Macks 2007-10-09 18:35:36 UTC
Still opposed--still no evidence that packages linking against gnomecanvas need to link gail. Based on the errors, it appears that you're trying to solve a problem involving a linking against b linking against c by instructing a to link against c...seems contrary to the whole idea of dynamic linking (or do some platforms have a linker that insists on every symbol being defined explicitly instead of in sub-linked libs). Does ldd indicate that the latest gnomecanvas not link libgail?
Comment 11 Damien Carbery 2008-06-24 08:45:45 UTC
You are right, the root cause seems to be that when I build libgnomecanvas with a not-yet-installed gail (and therefore using gail-uninstalled.pc) the uninstalled.pc file was pointing to the wrong .la file and therefore not linking correctly. The mistaken was (re)introduced with bug #536430 and I will add the correct patch for gail-uninstalled.pc file there.

Thanks for the critical review of my patches.

This bug can be closed as NotABug or Invalid.