GNOME Bugzilla – Bug 90181
gtk+ fails to build for latest CVS head sources
Last modified: 2011-02-04 16:11:52 UTC
gtk+ fails to get build for the latest CVS head for linux platform only. see the error messages at time of make below. gcc -g -I/opt/gnome-2.0/include -Wall -Wl,--export-dynamic -o .libs/gtk- query-immodules-2.0 queryimmodules.o -Wl,--export-dynamic -L/opt/gnome- 2.0/lib -L/usr/X11R6/lib ./.libs/libgtk-x11-2.0.so /gnome/src-2.0n- 080802/gtk+/gdk/.libs/libgdk-x11-2.0.so /opt/gnome-2.0/lib/libatk- 1.0.so ../gdk-pixbuf/.libs/libgdk_pixbuf-2.0.so ../gdk/.libs/libgdk-x11- 2.0.so /gnome/src-2.0n-080802/gtk+/gdk-pixbuf/.libs/libgdk_pixbuf-2.0.so - lXft -lXrender -lXext -lX11 /opt/gnome-2.0/lib/libfreetype.so /opt/gnome- 2.0/lib/libpangoxft-1.0.so /opt/gnome-2.0/lib/libpangox-1.0.so /opt/gnome- 2.0/lib/libpango-1.0.so /opt/gnome-2.0/lib/libgobject-2.0.so /opt/gnom e-2.0/lib/libgmodule-2.0.so -ldl /opt/gnome-2.0/lib/libglib-2.0.so - lpthread -lm /opt/gnome-2.0/lib/libintl.so -Wl,--rpath -Wl,/opt/gnome- 2.0/lib/gnome/src-2.0n-080802/gtk+/gdk/.libs/libgdk-x11-2.0.so: undefined reference to`pango_xft_shutdown_display' /gnome/src-2.0n-080802/gtk+/gdk/.libs/libgdk-x11-2.0.so: undefined reference to`XftDrawPicture' collect2: ld returned 1 exit status make[3]: *** [gtk-query-immodules-2.0] Error 1 make[3]: Leaving directory `/gnome/src-2.0n-080802/gtk+/gtk' make[2]: *** [all-recursive] Error 1 make[2]: Leaving directory `/gnome/src-2.0n-080802/gtk+/gtk' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/gnome/src-2.0n-080802/gtk+' make: *** [all-recursive-am] Error 2 --->8--- output of make command ends ------ ERROR: Failed to compile package gtk+ (2)
Fixed as a side-effect of: Thu Aug 8 23:26:05 2002 Owen Taylor <otaylor@redhat.com> * gdk/x11/gdkmain-x11.c gdk/x11/gdkscreen-x11.c: Remove explicit calls to pango_x/xft_shutdown_display() since Pango now does it by itself on XCloseDisplay(). Thanks.
Still getting an undefined reference to `XftDrawPicture' as below. Request your attention into this. /gnome/src-2.0n-090802/gtk+/gdk/.libs/libgdk-x11-2.0.so: undefined reference to `XftDrawPicture' collect2: ld returned 1 exit status make[3]: *** [gtk-query-immodules-2.0] Error 1 make[3]: Leaving directory `/gnome/src-2.0n-090802/gtk+/gtk' make[2]: *** [all-recursive] Error 1 make[2]: Leaving directory `/gnome/src-2.0n-090802/gtk+/gtk' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/gnome/src-2.0n-090802/gtk+' make: *** [all-recursive-am] Error 2 --->8--- output of make command ends ------ ERROR: Failed to compile package gtk+ (2)
I have confirmed that gdk/x11/gdk-x11-drawable.c now explicitly calls Xft API that my older version of Xft (the one distributed with RH7.1) does not contain; i.e. it calls XftDrawPicture. So although gtk+ HEAD can use pango 1.0, this change introduces a (new) dependency on Xft2 in gtk+ HEAD. Isn't this a problem?
Hmm, I guess I was deluded to think that Xft1 had DrawPicture since it *could* have had XftDrawPicture. It should be straighforward enough to dig the old code from before my changes of 2 Aug and conditionalize on HAVE_XFT2. I'd take such a patch, though, since I don't have Xft1 around any more, it would be hard for me to develop/test it. (A simpler change would to not define HAVE_XFT unless Xft2 is found, but if it's easy enough, it would be nice to retain Xft1 support until we kill pango-1.0 support)
Created attachment 10640 [details] [review] patch to reinstate xft1 codepatch for gdk_x11_drawable_get_picture
this patch has been tested on linux+xft2, and does not alter the non-xft codepath. It awaits testing on linux+xft1 (the stack where the problem first was reported).
Created attachment 10649 [details] [review] improved patch (fixes leaked 'picture')
confirmed that the patch above works on Solaris without XFT, on Linux (RH7.1) with Xft1, and on Linux (RH7.1) with Xft2.
With this patch I found that gtk+ is getting build successfully in RH7.1 and hence I am closing this bug.
Please NEVER close a bug just because the proposed fix works! A bug is fixed if it's fixed in CVS. Reopening this until either this or another fix is integrated.
Hope this bug gets fixed soon... I have also checked that the patch works with Red Hat 7.3 with the autoconf links changed to point to the autoconf 2.53 that comes with the distribution. Every string from other charset doesn't appear correctly, thouhg it can be a problem of configuration, don't know. It is also giving me problems building gdkenumtypes.h and gdkenumtypes.c in the correct order. But this problem should go in another bug-report, I suppose.
Could somebody mark the OS field as Linux, please?
This bug is reoccurring trying to compile gtk+-2.1.0 released on September 30th 2002. Xfree86-4.2.1 present.
Yep, I tried to compile gtk+2.1 and get the same gdk undefined reference using XFree 4.2.1 Steve Griff
I've committed an (untested) change now that should fix the problem. It differs from Bill's patch in that it more literally goes back to the old code for the non-Xft2 case, instead of creating a picture as well as the XftDraw. Testing appreciated. Thu Oct 3 17:09:23 2002 Owen Taylor <otaylor@redhat.com> * gdk/x11/{gdkdrawable-x11.[ch],gdkpixmap-x11.c, gdkwindow-x11.c}: Restore the pre-Xft2 code to render text directly via RENDER, conditionalized with !HAVE_XFT2 so that we'll build again on Xft1 systems. (#90181)
I've tried changing the #ifdef HAVE_XFT to #if !HAVE_XFT2 and it didn't worked for me, although i'm not really sure if this is what you meant by 'conditionalizing'. My distr is RH7.3 and i'm trying to install gnome from cvs tree. /tmp/gnome/gtk+-2.1.0/gdk/.libs/libgdk-x11-2.0.so: undefined reference to `XftDrawPicture' collect2: ld returned 1 exit status make[3]: *** [gtk-query-immodules-2.0] Error 1 make[3]: Leaving directory `/tmp/gnome/gtk+-2.1.0/gtk' make[2]: *** [all-recursive] Error 1 make[2]: Leaving directory `/tmp/gnome/gtk+-2.1.0/gtk' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/tmp/gnome/gtk+-2.1.0' make: *** [all-recursive-am] Error 2
It's not a simple change - it's a whole big bunch of code changes. You'll either need to install from CVS or wait for 2.1.1. (Probably sometime early next week)