[...] Making all in fc-cache gmake[2]: Entering directory `/var/tmp/fontconfig-2.3.1/fc-cache' if /opt/csw/gcc3/bin/gcc -DHAVE_CONFIG_H -I. -I. -I.. -I.. -I/opt/csw/include/freetype2 -I/opt/csw/include -I/opt/csw/include -g -O2 -MT fc-cache.o -MD -MP -MF ".deps/fc-cache.Tpo" \ -c -o fc-cache.o `test -f 'fc-cache.c' || echo './'`fc-cache.c; \ then mv -f ".deps/fc-cache.Tpo" ".deps/fc-cache.Po"; \ else rm -f ".deps/fc-cache.Tpo"; exit 1; \ fi /bin/bash ../libtool --mode=link /opt/csw/gcc3/bin/gcc -g -O2 -L/opt/csw/lib -R/opt/csw/lib -o fc-cache fc-cache.o ../src/libfontconfig.la mkdir .libs /opt/csw/gcc3/bin/gcc -g -O2 -o .libs/fc-cache fc-cache.o -L/opt/csw/lib ../src/.libs/libfontconfig.so /opt/csw/lib/libfreetype.so -lz /opt/csw/lib/libexpat.so -R/usr/local/lib -R/opt/csw/lib Undefined first referenced symbol in file libiconv_open ../src/.libs/libfontconfig.so libiconv ../src/.libs/libfontconfig.so ld: fatal: Symbol referencing errors. No output written to .libs/fc-cache collect2: ld returned 1 exit status gmake[2]: *** [fc-cache] Error 1 gmake[2]: Leaving directory `/var/tmp/fontconfig-2.3.1/fc-cache' gmake[1]: *** [all-recursive] Error 1 gmake[1]: Leaving directory `/var/tmp/fontconfig-2.3.1' gmake: *** [all] Error 2 ----------- "-liconv' missing?
Created attachment 2346 [details] [review] this patch should correct the bug which also appears on Solaris 2.8 The problem seem to appears when the conditional support for iconv is enabled as the iconv.h header file and the iconv function are found by autoconf. I have added an automake conditional triggered by the result of the autoconf test, to allow adding -liconv to the programs that are built with libfontconfig. This solved the problem for me
Hi Luc, I can confim that your patch solves the problem. Thanks, Alexander
Created attachment 2392 [details] [review] proposed patch to allow both correct build and later use by other products This patch should correct the bug. Applying it adds the -liconv if necessary on the Makefile for building the local applications (fc-cache, fc-list and fc-match) and also adds it in the configured and installed fontconfig.pc file. This allows other tools relying on pkgconfig to find the fontconfig link flags to use the proper -liconv flag if it is needed.
The patch did not work for me. fontconfig 2.3.2 will not compile under Solaris 8 or Solaris 9 (SPARC). It still dies at the fc-cache section. Patch v2.5.4 reported no problems applying the patch; however, Solaris 9 using GCC 3.4.3 and Solaris 8 using GCC 3.3 continue to fail compiling even though libiconv is installed on both systems in /usr/local/lib. Using Sun's default ld: ------------------------------------ gcc -g -O2 -o .libs/fc-cache fc-cache.o ../src/.libs/libfontconfig.so -L/usr/local/lib /usr/local/lib/libfreetype.so -lz /usr/local/lib/libexpat.so -R/usr/local/lib Undefined first referenced symbol in file libiconv_close ../src/.libs/libfontconfig.so libiconv_open ../src/.libs/libfontconfig.so libiconv ../src/.libs/libfontconfig.so ld: fatal: Symbol referencing errors. No output written to .libs/fc-cache collect2: ld returned 1 exit status make[2]: *** [fc-cache] Error 1 make[2]: Leaving directory `/tmp/fontconfig-2.3.2/fc-cache' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/tmp/fontconfig-2.3.2' make: *** [all] Error 2 Using GNU ld v2.16 ------------------ if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I.. -I/usr/local/include/freetype2 -I/usr/local/include -g -O2 -MT fc-cache.o -MD -MP -MF ".deps/fc-cache.Tpo" \ -c -o fc-cache.o `test -f 'fc-cache.c' || echo './'`fc-cache.c; \ then mv -f ".deps/fc-cache.Tpo" ".deps/fc-cache.Po"; \ else rm -f ".deps/fc-cache.Tpo"; exit 1; \ fi /bin/bash ../libtool --mode=link gcc -g -O2 -o fc-cache fc-cache.o ../src/libfontconfig.la mkdir .libs gcc -g -O2 -o .libs/fc-cache fc-cache.o ../src/.libs/libfontconfig.so -L/usr/local/lib /usr/local/lib/libfreetype.so -lz /usr/local/lib/libexpat.so -Wl,--rpath -Wl,/usr/local/lib ../src/.libs/libfontconfig.so: undefined reference to `libiconv_open' ../src/.libs/libfontconfig.so: undefined reference to `libiconv_close' ../src/.libs/libfontconfig.so: undefined reference to `libiconv' collect2: ld returned 1 exit status make[2]: *** [fc-cache] Error 1 make[2]: Leaving directory `/tmp/fontconfig-2.3.2/fc-cache' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/tmp/fontconfig-2.3.2' make: *** [all] Error 2
*** Bug 2775 has been marked as a duplicate of this bug. ***
How does this compare to the patch attached to bug 4083?
> How does this compare to the patch attached to bug 4083? That patch does not fix the problem. It allows me to add --with-libiconv=gnu but even after running "autogen.sh && configure --with-libiconv=gnu" Makefiles of fc-cache, fc-list and fc-match does not contain something like "-liconv". In the meantime my workaround is to use LDFLAGS="-R<path_to_libiconv> <path_to_libiconv>/libiconv.so"
I believe that Behdad's patch for bug 4083 (now committed) should also fix this issue by causing -liconv to be added to libfontconfig_la_LIBADD. Please reopen if this is not the case.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.