GNOME Bugzilla – Bug 75452
libintl linking problems on Tru64Unix and FreeBSD
Last modified: 2009-08-15 18:40:50 UTC
When starting GIMP 1.2.3 built either with native CC or GCC 3.0.4 a lot of error messages are given. They read LibGimp-WARNING **: gimp: wire_read: unexpected EOF 384843:/usr/lib/perl-5.6.0/bin/perl: /sbin/loader: Fatal Error: call to unresolved symbol from /usr/lib/perl-5.6.0/lib/site_perl/5.6.0/alpha-dec_osf/auto/Gimp/Gimp.so (pc=0x30000003da4)
The message "gimp: wire_read: unexpected EOF" means that the GIMP has detected that a plug-in has crashed instead of sending the expected data (during the initial handshake, in this case). In your output, the error message from the plug-in is printed next: it shows that the Perl plug-in was not able to start because of some unresolved symbols in the Gimp-Perl module (Gimp.so). This is probably happening for all Perl scripts on your system. This could be due to the fact that Perl or Gimp-Perl was compiled with a different compiler or with different settings than the GIMP itself. You should re-install the Gimp-Perl module (and maybe re-configure and re-install the GIMP afterwards - not that it is important to re-configure the GIMP _after_ the new Gimp-Perl is installed). Please report if this solves the problem or not.
I did try to reconfigure GIMP-PERL. I did then get a complaint about unresolved external references in libgimpui.so, the symbol is dgettext. I then rememebered that when I built gimp, a number of unresolved references were reported on the program gimp-2. These were all libintl symbols so I added -L../intl -lintl -liconv to the makefile and tried a rebuild that succeeded. Tru64Unix have no libintl. All the shared libs (libgimp and libgimpui and also Gimp.so) refers libintl modules, but they cannot be resolved because they are not included in any library Any thoughts about this?
Have you tried configuring the GIMP with --with-included-gettext? Adding (or removing) this option might solve your linking problems. If that does not work, you could try installing libiconv-1.7 and gettext-0.10.40. Both of them are available from any GNU mirror and should compile without problems on your system.
In the first place I did the following setenv CPPFLAGS -I/usr/local/include setenv LDFLAGS -L/usr/local/include ./configure /usr/local/bin/gmake On your suggestion I added --with-included-gettext to configure but that didn't do any difference. The problem is the following: Configure doesn't find any libintl.a on this system so it sets up for the local lib ./intl instead. When running make the local libintl.a is successfully built. When building the rest, proper -I../intl flags have been added and in most cases proper -L../intl -lintl -liconv are added. There are two exceptions to this. The libgimp.so and the gimp itself (gimp-1.2) is not setup to link with libintl.a. The -I flags are there but no -L flags. This causes an invalid libgimp.so to be built and make to terminate because of unresolved references in gimp-1.2 I did a manual change in two places, then built everything and it ended up with a working gimp in gimp-1.2.3/app/Makefile I changed GTK_LIBS = -L/usr/local/lib -lgtk -lgdk -lgmodule -lglib -lXext -lXext -lX11 -ldnet_stub -lm into GTK_LIBS = -L/usr/local/lib -lgtk -lgdk -lgmodule -lglib -lXext -lXext -lX11 -ldnet_stub -L../intl -lintl -liconv -lm in gimp-1.2.3/libgimp/Makefile I changed libgimp_la_LIBADD = $(GLIB_LIBS) -lm into libgimp_la_LIBADD = $(GLIB_LIBS) -L../intl -lintl -liconv -lm After that everything is fine!
This is strange indeed since app/Makefile.am contains $(INTLLIBS) in gimp_1_2_LDADD which should expand to the proper linker flags. The Makefile.am in libgimp shouldn't need $(INTLLIBS) since there's no executable build here. Also passing --with-included-gettext to configure is supposed to work. However if no libintl is found on your system configure should be able to detect that and fall back to the included gettext even if you didn't explicetely specify --with-included-gettext.
For some strange reason, app/Makefile.am contains a very suspicious line 13: INTLLIBS = This clears any definition of INTLLIBS. This line should probably be removed, but I am curious to know why it was added there. Question to Olle: did you remove config.cache before running configure --with-included-gettext? Maybe the configure script took some cached values from a previous build.
Oops, forget my previous comment: this suspicious line is inside "if OS_WIN32" so it should not affect UNIX builds. So I do not understand why INTLLIBS was not correctly expanded in app/Makefile. Olle, could you do a "grep INTLLIBS config.status" and report what value has been set for this variable (maybe try with and without the --with-included-gettext option)?
Created attachment 7263 [details] [review] makefile in app (with my modification)
I did reconfigure from a clean distribution so there were no cache file there. A grep of config.status gives s%@INTLLIBS@%$(top_builddir)/intl/libintl.a -liconv%g looks alright to me but there is no defition i app/Makefile. There are in the toplevel Makefile and also in others like plug-ins/Makefile You are probably right about libgimp in most cases. But the symbols have to be define somewhere and if they are not defined in the shared lib they have to be defined in the application. I did find 2 occasions where unresolved referecences occured. 1) When doing perl Makefile.PL in plug-ins/perl libgimpui.so reported gettext are unresolved. Apparently is isn't define anywhere 2) When browsing plugins at startup Gimp.so reported an unresolved reference. That is also because is missing both in the library and in the application.
One more question... Instead of grep'ing for INTLLIBS in config.status, could you just grep for INTL and include the results here? I would be interested in the value of BUILD_INCLUDED_LIBINTL and USE_INCLUDED_LIBINTL. Both should be set to yes in your case, but I would like to be sure about that. Regarding your points 1) and 2), this looks like a problem in the Perl directory. In principle, you should not have to run perl Makefile.PL yourself, because this should be done when you configure (and it should use the correct options). And the generated Makefile should use libintl correctly, but it looks like it doesn't...
search for intl in config.status skalman.cb.uu.se> grep INTL config.status s%@INTLDEPS@%%g s%@INTLLIBS@%$(top_builddir)/intl/libintl.a -liconv%g s%@INTLOBJS@%$(GETTOBJS)%g s%@INTLBISON@%bison%g s%@BUILD_INCLUDED_LIBINTL@%yes%g s%@USE_INCLUDED_LIBINTL@%yes%g s%@INTL_LIBTOOL_SUFFIX_PREFIX@%%g
Thanks. So everything looks correct for the configure script. I think that I have located the problem, but I am not sure about the root cause: the file app/Makefile.in generated from app/Makefile.am does not contain the definition of INTLLIBS, and this definition is therefore not included in the final app/Makefile. If you look at line 122 of app/Makefile.in, you will find this: INTLBISON = @INTLBISON@ INTLDEPS = @INTLDEPS@ INTLOBJS = @INTLOBJS@ INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@ IN_GIMP = @IN_GIMP@ [...] In the other directories, Makefile.in contains this: INTLBISON = @INTLBISON@ INTLDEPS = @INTLDEPS@ INTLLIBS = @INTLLIBS@ INTLOBJS = @INTLOBJS@ INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@ IN_GIMP = @IN_GIMP@ [...] Note that the line defining INTLLIBS is missing from app/Makefile.in. This could be a bug in automake. Maybe it was confused by the empty definition of INTLLIBS inside the "if OS_WIN32" section? This is the only significant difference that I could find between the Makefile.am in the app directory and in the other directories.
Most interestingly, no other Makefile.am than the one in app contains the suspicous line INTLLIBS = inside if OS_WIN32 so it seems that it is actually not needed at all. I have added Tor to the Cc: list so hopefully he can comment on this.
I really don't know any longer why I added the INTLLIBS= line inside the if OS_WIN32. It can safely be removed, will do that.
*** Bug 78678 has been marked as a duplicate of this bug. ***
According to bug #78678 the same problem occurs on FreeBSD so I have changed the summary of this bug report accordingly. I suspect that it occurs on many operating systems (all those that require libintl, so almost all UNIX variants except for Linux) but I cannot test that because I have already installed GNU gettext in the default include path and library path on all my Solaris workstations.
2002-03-21 Tor Lillqvist <tml@iki.fi> * app/Makefile.am: Remove unnecessary empty assignment to INTLLIBS from inside "if OS_WIN32".
Did this change solve the problem? Can be tested with gimp-1.2.4-pre1. Feedback would be highly appreciated.
We got no reply but I will assume that Tor's change was the right fix and thus mark this report as FIXED.
The fix is part of the stable release 1.2.4 (hopefully). Closing this bug.