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 609184 - Build failure: doesn't look for some required libs
Build failure: doesn't look for some required libs
Status: RESOLVED FIXED
Product: eog
Classification: Core
Component: general
2.26.x
Other Mac OS
: Normal normal
: ---
Assigned To: EOG Maintainers
EOG Maintainers
: 609553 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2010-02-06 19:47 UTC by Daniel Macks
Modified: 2010-03-07 17:20 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Include gthread in EOG pkg-config (555 bytes, patch)
2010-02-06 19:53 UTC, Daniel Macks
committed Details | Review
Explicitly link to libX11 (with fallback) (2.79 KB, patch)
2010-02-12 16:56 UTC, Felix Riemann
committed Details | Review

Description Daniel Macks 2010-02-06 19:47:54 UTC
/bin/sh ../libtool --tag=CC   --mode=link gcc  -Os -pipe -export-dynamic -no-undefined -export-symbols-regex "^[[^_]].*" -L/sw/lib/fontconfig2/lib -L/sw/lib -o eog eog-main.o libeog.la -L/sw/lib/fontconfig2/lib -L/sw/lib -Wl,-framework,CoreServices -Wl,-framework,ApplicationServices -lgnome-desktop-2 -lstartup-notification-1 -lgconf-2 -lart_lgpl_2 -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lgdk_pixbuf-2.0 -lpangocairo-1.0 -lcairo -lpango-1.0 -lfreetype -lz -lfontconfig -lgmodule-2.0 -lexif -lm -llcms -ldbus-glib-1 -ldbus-1 -lpthread -lgobject-2.0 -lglib-2.0 -lintl  -ljpeg ../cut-n-paste/toolbar-editor/libtoolbareditor.la ../cut-n-paste/totem-screensaver/libtotemscrsaver.la ../jpegutils/libeog-jpegutils.la -lz 
libtool: link: gcc -Os -pipe -o eog eog-main.o -Wl,-framework -Wl,CoreServices -Wl,-framework -Wl,ApplicationServices  -L/sw/lib/fontconfig2/lib -L/sw/lib ./.libs/libeog.a /sw/lib/libgnome-desktop-2.dylib /sw/lib/libstartup-notification-1.dylib /sw/lib/libgconf-2.dylib /sw/lib/libart_lgpl_2.dylib /sw/lib/libgtk-x11-2.0.dylib /sw/lib/libgdk-x11-2.0.dylib /sw/lib/libatk-1.0.dylib /sw/lib/libgio-2.0.dylib /sw/lib/pango-ft219/lib/libpangoft2-1.0.dylib /sw/lib/libgdk_pixbuf-2.0.dylib /sw/lib/pango-ft219/lib/libpangocairo-1.0.dylib /sw/lib/libcairo.dylib /sw/lib/pango-ft219/lib/libpango-1.0.dylib /sw/lib/freetype219/lib/libfreetype.dylib /sw/lib/fontconfig2/lib/libfontconfig.dylib /sw/lib/libgmodule-2.0.dylib /sw/lib/libexif.dylib -lm /sw/lib/liblcms.dylib /sw/lib/libdbus-glib-1.dylib /sw/lib/libdbus-1.dylib -lpthread /sw/lib/libgobject-2.0.dylib /sw/lib/libglib-2.0.dylib /sw/lib/libintl.dylib /sw/lib/libjpeg.dylib ../cut-n-paste/toolbar-editor/.libs/libtoolbareditor.a /sw/lib/libxml2.dylib ../cut-n-paste/totem-screensaver/.libs/libtotemscrsaver.a ../jpegutils/.libs/libeog-jpegutils.a -lz
/usr/libexec/gcc/powerpc-apple-darwin8/4.0.1/ld: Undefined symbols:
_g_thread_init
_XFree
_XGetWindowProperty
_XGetScreenSaver
_XLockDisplay
_XSetScreenSaver
_XUnlockDisplay
collect2: ld returned 1 exit status
make[3]: *** [eog] Error 1


This is from eog-2.26.3 but I see same code and build-file segments on git trunk.
Comment 1 Daniel Macks 2010-02-06 19:53:40 UTC
Created attachment 153159 [details] [review]
Include gthread in EOG pkg-config

Several sources use g_thread_init directly, so easiest to include gthread as part of the EOG_{CFLAGS,LIBS} flag-set.

This might not be needed on platforms other than OS X (linux allows indirect symbol resolution via directly-listed libs, darwin *only* looks in directly-listed libs). Also, my gtk was built with a ./configure flag that suppresses publishing some internal-use-only dependencies...best for eog not to rely on not-guaranteed-stable/public features of its dependencies.
Comment 2 Daniel Macks 2010-02-06 21:50:13 UTC
In src/Makefile.am, eog_LDADD includes $X_LIBS, but that variable is never set anywhere. Perhaps (as in Comment #1) the flags are not required to be passed directly in many build situations? I think X11 is only used in some build configurations (maybe only if lcms is enabled?), so simply hard-coding -lX11 is probably overkill. And the standard autoconf macros (AC_PATH_X and AC_PATH_XTRA) seem to set the -I and -L but not -lX11. If someone can decipher the cases where an X11 function is used, would be easy to patch configure.ac and/or various Makefile.am appropriately.
Comment 3 Felix Riemann 2010-02-08 11:38:33 UTC
Review of attachment 153159 [details] [review]:

(In reply to comment #1)
> Created an attachment (id=153159) [details] [review]
> Include gthread in EOG pkg-config
> 

Correct. This is actually mentioned in GLib docs. :)

commit 6cebe233786101783ae3e649bc3241e9c490ef22
Author: Daniel Macks <>
Date:   Mon Feb 8 12:31:07 2010 +0100

    Explicitly link to GThread
    
    Should fix linker errors related to GThread on systems that don't
    recursively resolve linked libraries like OS X. See bug #609184.

I'll try to take a look on the X11 problem later today.
Comment 4 Felix Riemann 2010-02-08 12:41:15 UTC
The $X_LIBS in the Makefile template appears to be a leftover from pre-2.20 days.

Currently X11 is used for getting the display profile when lcms is enabled and to inhibit the screensaver as a fallback when running eog in fullscreen modes (when GDK is compiled for the X11 target; see cut-n-paste/totem-screensaver) and you're not using gnome-screensaver over DBus.

I guess I could come up with possible configure check for this. libX11 seems to support pkg-config as well now. Does it on OS X as well?
Comment 5 Daniel Macks 2010-02-08 17:24:26 UTC
The most recent releases of OS X does have x11.pc and friends. Older-but-in-use don't have all of them, but PKG_CHECK_MODULES provides standard way for user to force-feed results if detection of a certain lib set isn't/won't work for him. The alternative (according to gtk+/configure.in for example) is to AC_PATH_XTRA and then hardcode append a best-guess at the -l flags. gtk+ tries pkg-config, falls back to hardcoded guess if that fails.
Comment 6 Bastien Nocera 2010-02-11 14:55:21 UTC
*** Bug 609553 has been marked as a duplicate of this bug. ***
Comment 7 Felix Riemann 2010-02-12 16:56:37 UTC
Created attachment 153637 [details] [review]
Explicitly link to libX11 (with fallback)

Please try this one.
It's pretty selective where to become explicit with linking to X11 and also has a fallback for X11 releases without pkgconfig support.
Comment 8 Daniel Macks 2010-02-16 19:29:09 UTC
Will be a week or so before I'm back to gnome hacking, will follow up as soon as I am on it
Comment 9 Felix Riemann 2010-02-22 22:21:57 UTC
Review of attachment 153637 [details] [review]:

Putting it into 2.29.91 as the pkg-config part seems to be straight forward enough for me (if I'm wrong there's 2.29.92).
Please test the fallback for non-pkg-config X11's.
Comment 10 Daniel Macks 2010-03-02 06:37:59 UTC
The alternative (no x11.pc) flag-detection/passing works for me (eog-2.28.2 + Comment #7 patch builds completely)
Comment 11 Felix Riemann 2010-03-07 17:20:57 UTC
(In reply to comment #10)
> The alternative (no x11.pc) flag-detection/passing works for me (eog-2.28.2 +
> Comment #7 patch builds completely)

Thanks for confirming. Resolving this then.