Bug 2774 - Solaris 10 / fontconfig 2.3.1 - fc-cache libiconv problem
Summary: Solaris 10 / fontconfig 2.3.1 - fc-cache libiconv problem
Status: RESOLVED FIXED
Alias: None
Product: fontconfig
Classification: Unclassified
Component: fc-cache (show other bugs)
Version: 2.2
Hardware: SPARC Solaris
: high normal
Assignee: Keith Packard
QA Contact:
URL:
Whiteboard:
Keywords:
: 2775 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-03-19 14:01 UTC by Alexander
Modified: 2006-04-25 08:39 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
this patch should correct the bug which also appears on Solaris 2.8 (1.90 KB, patch)
2005-04-07 11:11 UTC, Luc.Maisonobe
Details | Splinter Review
proposed patch to allow both correct build and later use by other products (2.53 KB, patch)
2005-04-11 11:19 UTC, Luc.Maisonobe
Details | Splinter Review

Description Alexander 2005-03-19 14:01:32 UTC
[...]
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?
Comment 1 Luc.Maisonobe 2005-04-07 11:11:40 UTC
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
Comment 2 Alexander 2005-04-11 04:36:13 UTC
Hi Luc,

I can confim that your patch solves the problem.

Thanks,
Alexander
Comment 3 Luc.Maisonobe 2005-04-11 11:19:38 UTC
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.
Comment 4 John Berger 2005-10-03 13:14:48 UTC
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
Comment 5 Patrick Lam 2006-02-22 02:08:09 UTC
*** Bug 2775 has been marked as a duplicate of this bug. ***
Comment 6 Patrick Lam 2006-02-22 17:21:39 UTC
How does this compare to the patch attached to bug 4083?
Comment 7 Alexander 2006-03-13 19:58:20 UTC
> 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" 
Comment 8 Patrick Lam 2006-04-26 01:39:00 UTC
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.