Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 151632 - media-libs/fontconfig cross-compile fails
Summary: media-libs/fontconfig cross-compile fails
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Fonts Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-10-16 13:27 UTC by Gerry
Modified: 2008-09-21 06:16 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gerry 2006-10-16 13:27:02 UTC
Another cross-compile bug.  Using cross-compile environment for i686 host on amd64 build, set up after this (also using the xmerge script found there in stead of emerge):
http://www.gentoo.org/proj/en/base/embedded/cross-development.xml

fontconfig fails as soon as it finishes with configure and starts compiling:
--- 8< ---
(...)
Making all in fc-case
make[2]: Entering directory `/var/tmp/portage/fontconfig-2.3.2-r1/work/fontconfig-2.3.2/fc-case'
if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../src -I.. -I/usr/include/freetype2 -Wall -Wpointer-arith -Wstrict-prototypes    -Wmissing-prototypes -Wmissing-declarations     -Wnested-externs -fno-strict-aliasing    -march=i686 -O2 -pipe -fomit-frame-pointer -MT fc-case.o -MD -MP -MF ".deps/fc-case.Tpo" -c -o fc-case.o fc-case.c; \
        then mv -f ".deps/fc-case.Tpo" ".deps/fc-case.Po"; else rm -f ".deps/fc-case.Tpo"; exit 1; fi
fc-case.c:1: error: CPU you selected does not support x86-64 instruction set
fc-case.c:1: error: CPU you selected does not support x86-64 instruction set
make[2]: *** [fc-case.o] Error 1
make[2]: Leaving directory `/var/tmp/portage/fontconfig-2.3.2-r1/work/fontconfig-2.3.2/fc-case'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/var/tmp/portage/fontconfig-2.3.2-r1/work/fontconfig-2.3.2'
make: *** [all] Error 2

!!! ERROR: media-libs/fontconfig-2.3.2-r1 failed.
Call stack:
  ebuild.sh, line 1546:   Called dyn_compile
  ebuild.sh, line 937:   Called src_compile
  fontconfig-2.3.2-r1.ebuild, line 55:   Called die

!!! (no error message)
!!! If you need support, post the topmost build error, and the call stack if relevant.
--- 8< ---
Fontconfig should have used i686-pc-linux-gnu-gcc here, not just plain gcc (which is the native amd64 one).  Since fontconfig does use CFLAGS, and the CFLAGS are incompatible with the native gcc (nice safeguard there), the compile fails.  Also, setting the CC environment variable has no effect.

(emerge --info and xmerge --info in next comment)
Comment 1 Gerry 2006-10-16 13:28:16 UTC
# emerge --info
Portage 2.1.1-r1 (default-linux/amd64/2006.1/desktop, gcc-4.1.1, glibc-2.4-r3, 2.6.17-gentoo-r8 x86_64)
=================================================================
System uname: 2.6.17-gentoo-r8 x86_64 AMD Athlon(tm) 64 X2 Dual Core Processor 4200+
Gentoo Base System version 1.12.5
Last Sync: Mon, 16 Oct 2006 00:30:01 +0000
app-admin/eselect-compiler: [Not Present]
dev-java/java-config: 1.3.7, 2.0.30
dev-lang/python:     2.3.5-r2, 2.4.3-r4
dev-python/pycrypto: 2.0.1-r5
dev-util/ccache:     [Not Present]
dev-util/confcache:  [Not Present]
sys-apps/sandbox:    1.2.17
sys-devel/autoconf:  2.13, 2.59-r7
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2
sys-devel/binutils:  2.16.1-r3
sys-devel/gcc-config: 1.3.13-r4
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.11-r2
ACCEPT_KEYWORDS="amd64"
AUTOCLEAN="yes"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=k8 -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/gconf /etc/java-config/vms/ /etc/revdep-rebuild /etc/terminfo"
CXXFLAGS="-march=k8 -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig ccache distlocks metadata-transfer parallel-fetch sandbox sfperms strict userpriv usersandbox"
GENTOO_MIRRORS="ftp://trumpetti.atm.tut.fi/gentoo/ http://mirror.gentoo.no/"
LANG="nb_NO.UTF-8"
LC_ALL="nb_NO.UTF-8"
LINGUAS="no nb no_NO nb_NO"
MAKEOPTS="-j1"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude='/distfiles' --exclude='/local' --exclude='/packages'"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage /usr/local/initng-portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="amd64 16bit 7zip S3TC X Xaw3d a52 aac aalib acl acpi alsa ao aotuv apache2 applet arts artworkextra asf audiofile bash-completion berkdb bitmap-fonts browserplugin bzip2 cairo capslib ccache cdparanoia cdr cli crypt css ctype cups curl cvs dbus dlloader dri dvd dvdr dvdread eds elf elibc_glibc emboss emul-linux-x86 encode esd exif expat fam fame fat ffmpeg firefox flac flash fortran gcj gd gdb gdbm gif gimp glitz glut glx gmp gnome gpm graphviz gstreamer gtk gtk2 gtkhtml guile gzip h323 hal i8x0 icecast idn ieee1394 imagemagick imap imlib imlib2 initng_plugins_also initng_plugins_bash_launcher initng_plugins_chdir initng_plugins_chroot initng_plugins_conflict initng_plugins_cpout initng_plugins_critical initng_plugins_cron initng_plugins_daemon initng_plugins_dev initng_plugins_dllaunch initng_plugins_envparser initng_plugins_find initng_plugins_fstat initng_plugins_history initng_plugins_idleprobe initng_plugins_initctl initng_plugins_interactive initng_plugins_iparser initng_plugins_last initng_plugins_limit initng_plugins_logfile initng_plugins_netprobe initng_plugins_ngc4 initng_plugins_pause initng_plugins_pidfile initng_plugins_provide initng_plugins_reload initng_plugins_renice initng_plugins_rlparser initng_plugins_simple_launcher initng_plugins_stcmd initng_plugins_stdout initng_plugins_suid initng_plugins_syncron initng_plugins_syslog initng_plugins_unneeded input_devices_joystick input_devices_keyboard input_devices_mouse intl ipv6 jabber jack jack-tmpfs java javascript joystick jpeg kde kdeenablefinal kdehiddenvisibility kernel_linux kqemu lame lcms ldap libcaca libg++ linguas_nb linguas_nb_NO linguas_no linguas_no_NO linuxthreads-tls logitech-mouse lua lzo mad matroska md5sum mhash mikmod ming mjpeg mmap mng mod modplug mono mozilla moznocompose moznoirc moznomail moznoroaming mp3 mp4 mp4live mpeg mpeg2 mplayer mpm-prefork musepack music musicbrainz ncurses nforce2 nls no nptl nptlonly nsplugin ntfs nvidia nvram objc ocaml ogg oggvorbis openal opengl openssh openssl oss pam paste64 pcre pdf perl php physfs png pnp povray ppds pppd python qemu-fast qt3 qt4 quicktime rar readline reflection samba scanner sdk sdl sdl-sound session sharedext sharedmem sid slang smp sms speex spell spl sse-filters ssl startup-notification stencil-buffer subtitles subversion svg sysfs tcpd tga theora thesaurus threads tiff timidity transcode truetype truetype-fonts type1 type1-fonts udev unicode usb userland_GNU vcd video_cards_fbdev video_cards_nv video_cards_nvidia video_cards_vesa videos vorbis wma wma123 wxwindows x264 xanim xine xml xml2 xmms xorg xpm xrandr xscreensaver xv xvid yv12 zip zlib"Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LDFLAGS, PORTAGE_RSYNC_EXTRA_OPTS

# xmerge --info
Portage 2.1.1-r1 (default-linux/x86/no-nptl/2.4, gcc-4.1.1, unavailable, 2.6.17-gentoo-r8 x86_64)
=================================================================
System uname: 2.6.17-gentoo-r8 x86_64 AMD Athlon(tm) 64 X2 Dual Core Processor 4200+
Gentoo Base System version 1.12.5
Last Sync: Mon, 16 Oct 2006 00:30:01 +0000
app-admin/eselect-compiler: [Not Present]
dev-java/java-config: 1.3.7, 2.0.30
dev-lang/python:     2.3.5-r2, 2.4.3-r4
dev-python/pycrypto: 2.0.1-r5
dev-util/ccache:     [Not Present]
dev-util/confcache:  [Not Present]
sys-apps/sandbox:    1.2.17
sys-devel/autoconf:  2.13, 2.59-r7
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2
sys-devel/binutils:  2.16.1-r3
sys-devel/gcc-config: 1.3.13-r4
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.11-r2
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=i686 -O2 -pipe -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/gconf /etc/java-config/vms/ /etc/revdep-rebuild /etc/terminfo"
CXXFLAGS="-march=i686 -O2 -pipe -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig distlocks metadata-transfer sandbox sfperms strict"
GENTOO_MIRRORS="ftp://trumpetti.atm.tut.fi/gentoo/ http://mirror.gentoo.no/"
LANG="nb_NO.UTF-8"
LC_ALL="nb_NO.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j1"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude='/distfiles' --exclude='/local' --exclude='/packages'"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X alsa aotuv apm arts berkdb bindist bitmap-fonts cli crypt cups dlloader dri eds elibc_glibc emboss encode esd fbcon foomaticdb fortran gdbm gif gnome gpm gstreamer gtk gtk2 imlib input_devices_joystick input_devices_keyboard input_devices_mouse ipv6 isdnlog jpeg kde kdeenablefinal kernel_linux libg++ libwww mad mikmod minimal motif mp3 mpeg ncurses nls ogg opengl oss pam pcre perl png pppd python qt3 qt4 quicktime readline reflection sdl session spell spl ssl tcpd truetype truetype-fonts type1-fonts unicode userland_GNU video_cards_none vorbis x86 xml xmms xorg xv zlib"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LINGUAS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY
Comment 2 Charles W. Barbour II 2006-10-19 15:59:53 UTC
I seem to be having similar issues in an attempt to merge this package.  I get the following errors

Can't locate SGMLS/Output.pm in @INC (@INC contains: /etc/perl /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux /usr/lib64/perl5/vendor_perl/5.8.8 /usr/lib64/perl5/vendor_perl/5.8.7 /usr/lib64/perl5/vendor_perl/5.8.7/x86_64-linux /usr/lib64/perl5/vendor_perl /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux /usr/lib64/perl5/site_perl/5.8.8 /usr/lib64/perl5/site_perl /usr/lib64/perl5/5.8.8/x86_64-linux /usr/lib64/perl5/5.8.8 /usr/local/lib/site_perl .) at /usr/bin/sgmlspl line 56.
BEGIN failed--compilation aborted at /usr/bin/sgmlspl line 56.
make[2]: *** [fc-cache.1] Error 8
make[2]: Leaving directory `/var/tmp/portage/media-libs/fontconfig-2.4.1/work/fontconfig-2.4.1/fc-cache'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/var/tmp/portage/media-libs/fontconfig-2.4.1/work/fontconfig-2.4.1'
make: *** [all] Error 2

!!! ERROR: media-libs/fontconfig-2.4.1 failed.
Call stack:
  ebuild.sh, line 1568:   Called dyn_compile
  ebuild.sh, line 937:   Called src_compile
  fontconfig-2.4.1.ebuild, line 53:   Called die

!!! (no error message)
!!! If you need support, post the topmost build error, and the call stack if relevant.


emerge --info

Portage 2.1.2_pre3-r5 (default-linux/amd64/2006.1, gcc-4.1.1, glibc-2.5-r0, 2.6.18-gentoo-r1 x86_64)
=================================================================
System uname: 2.6.18-gentoo-r1 x86_64 AMD Athlon(tm) 64 Processor 3500+
Gentoo Base System version 1.12.5
Last Sync: Thu, 19 Oct 2006 19:00:01 +0000
app-admin/eselect-compiler: [Not Present]
dev-java/java-config: [Not Present]
dev-lang/python:     2.2.3-r6, 2.3.5-r3, 2.4.3-r4
dev-python/pycrypto: 2.0.1-r5
dev-util/ccache:     [Not Present]
dev-util/confcache:  [Not Present]
sys-apps/sandbox:    1.2.18.1
sys-devel/autoconf:  2.13, 2.60
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10
sys-devel/binutils:  2.17
sys-devel/gcc-config: 1.3.13-r4
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.17-r1
ACCEPT_KEYWORDS="amd64 ~amd64"
AUTOCLEAN="yes"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=k8 -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config"
CONFIG_PROTECT_MASK="/etc/env.d /etc/gconf /etc/revdep-rebuild /etc/splash /etc/terminfo /etc/texmf/web2c"
CXXFLAGS="-march=k8 -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig distlocks metadata-transfer sandbox sfperms strict"
GENTOO_MIRRORS="ftp://ftp.gtlib.gatech.edu/pub/gentoo ftp://ftp.ucsb.edu/pub/mirrors/linux/gentoo/ http://gentoo.chem.wisc.edu/gentoo/ ftp://lug.mtu.edu/gentoo "
LINGUAS="en"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="amd64 64bit X alsa amd apache2 apm arts asf audiofile avi bash-completion berkdb bitmap-fonts bootsplash bzip2 cairo cdr cli cpudetection cracklib crypt ctype cups dba dlloader doc dri dvd eds elibc_glibc emboss encode esd ethereal exif expat fam fastbuild foomaticdb force-cgi-redirect fortran ftp gcc64 gd gdbm gif glut gmp gnome gpm gstreamer gtk gtk2 gtkhtml guile idn imlib input_devices_evdev input_devices_keyboard input_devices_mouse ipv6 isdnlog ivtv javascript jpeg jpeg2k kde kernel_linux lcms libg++ libwww linguas_en lirc lirc_devices_hauppauge mad memlimit mikmod mng motif mozilla mp3 mpeg mysql mythtv ncurses nls nptl nptlonly nvidia ogg openexr opengl oss pam pcre pdf pdflib perl png posix ppds pppd python qt quicktime readline reflection samba sdk sdl session simplexml slang soap sockets spell spl ssl swat symlink tcltk tcpd tiff tokenizer transcode transmitter truetype truetype-fonts type1-fonts udev unicode userland_GNU video_cards_fbdev video_cards_nv video_cards_nvidia video_cards_vesa video_cards_vga vorbis xml xml2 xmms xorg xsl xv xvid zlib"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LDFLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY

Comment 3 foser (RETIRED) gentoo-dev 2006-12-04 07:34:02 UTC
Gerry, since I have little clue about crosscompiling, any chance you could fix this yourself and provide us with a patch ? Check if 2.4.2 fixes this first.

@ comment #2 (Charles) : you should rebuild your perl-modules since you upgraded perl. 
Comment 4 Gerry 2006-12-04 12:53:39 UTC
(In reply to comment #3)
> Gerry, since I have little clue about crosscompiling, any chance you could fix
> this yourself and provide us with a patch ? Check if 2.4.2 fixes this first.

Well, if I was still trying to make cross-compiling work, I would.  However, I ran into so many problems trying to get this to work -- most packages had issues, and even many of the packages that seemed to support cross-compiling at first glance turned out to have more subtle problems -- that I gave up on that idea and decided to just use a chroot environment instead, like I used to do.  It's a bit more work to set up initially (if cross-compiling had worked, that is), but once it's set up there's no problems at all, which makes things easier when you just want something that works.  So, sorry, but it seems the gentoo cross-compiling tools just isn't ready for real use yet.  This font-config issue is just a tiny tip of the iceberg.
Comment 5 Dave Paden 2007-08-08 13:32:27 UTC
I also noticed this problem when cross-compiling for arm.  It appears the CFLAGS are mixed up between the host CFLAGS and the build CFLAGS on the sources that need to be built using the build CC.  It looks like if I run the configure script manually (./configure --with-arch=arm --host=arm-unknown-linux-gnu --build=i686-pc-linux-gnu) the Makefiles are generated with the correct flags.  However, if I run the same command through the ebuild and skip the econf line, the Makefiles are still generated incorrectly.  I am still trying to track it down, but I am thinking the CFLAG variable from portage is overriding the configure script detection.

Comment 6 Dave Paden 2007-08-08 22:36:44 UTC
I'm trying to get a patch put together to fix this.  I've gotten past the initial CFLAGS problem for now by using CFLAGS=@FFLAGS@ in the Makefile.am's for the sources needed on the build environment (FFLAGS isn't set to the host FFLAGS, just the build FFLAGS).  I don't know if using FFLAGS is safe for everyone...but it sure works for me :)!

Now when it gets to linking libfontconfig.la, it says libfreetype.so is the wrong format (of course...it's trying to use /usr/lib/libfreetype instead of /[cross-target-root]/usr/lib/libfreetype.  It gets to this via -lfreetype -lz which is the FREETYPE_LIBS flag in the Makefile.

Now, what's really strange is when I rename/remove /usr/lib/libfreetype.so and run make again, it magically decides to use the cross-target's libfreetype.so with the warning:

libtool: link: warning: library '/usr/arm-unknown-linux-gnu/usr/lib//libfreetype.la was moved'

I get this same error with libexpat and moving libexpat.so yields the same results as with freetype.  Any better ideas on how to solve this?  I don't think it's safe to move these two shared libs until the compile is done...


BTW, Here's my emerge --info:
Portage 2.1.2.9 (default-linux/x86/2007.0/desktop, gcc-3.4.4, glibc-2.3.6-r4, 2.6.17.6 i686)
=================================================================
System uname: 2.6.17.6 i686 Intel(R) Pentium(R) 4 CPU 2.80GHz
Gentoo Base System release 1.12.9
Timestamp of tree: Mon, 30 Jul 2007 15:30:10 +0000
dev-lang/python:     2.4.4-r4
dev-python/pycrypto: 2.0.1-r5
sys-apps/sandbox:    1.2.17
sys-devel/autoconf:  2.13, 2.61
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1, 1.10
sys-devel/binutils:  2.17.50.0.16
sys-devel/gcc-config: 1.3.16
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.11-r2
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=pentium4 -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config"
CONFIG_PROTECT_MASK="/etc/env.d /etc/gconf /etc/revdep-rebuild /etc/terminfo"
CXXFLAGS="-O2 -march=pentium4 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="distlocks metadata-transfer sandbox sfperms strict"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --filter=H_**/files/digest-*"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X acl acpi alsa arts berkdb bitmap-fonts cairo cdr cdrom cli cracklib crypt cups dbus dri dvd dvdr dvdread eds emboss encode esd evo fam firefox fortran gdbm gif gpm gstreamer hal iconv ipv6 isdnlog jpeg kerberos ldap libg++ mad midi mikmod mp3 mpeg mpfr mudflap ncurses nls nptl nptlonly ogg opengl openmp oss pam pcre pdf perl png pppd python qt3 qt3support qt4 quicktime readline reflection samba sdl session spell spl ssl svg tcpd tiff truetype truetype-fonts type1-fonts unicode vesa vorbis win32codecs x86 xml xorg xv zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" USERLAND="GNU" VIDEO_CARDS="apm ark chips cirrus cyrix dummy fbdev glint i128 i740 i810 imstt mach64 mga neomagic nsc nv r128 radeon rendition s3 s3virge savage siliconmotion sis sisusb tdfx tga trident tseng v4l vesa vga via vmware voodoo"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LDFLAGS, LINGUAS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS


and xmerge --info:
Portage 2.1.2.9 (default-linux/arm/2007.0, gcc-3.4.6, unavailable, 2.6.17.6 i686)
=================================================================
System uname: 2.6.17.6 i686 Intel(R) Pentium(R) 4 CPU 2.80GHz
Unknown Host Operating System
Timestamp of tree: Mon, 30 Jul 2007 15:30:10 +0000
dev-lang/python:     2.4.4-r4
dev-python/pycrypto: 2.0.1-r5
sys-apps/sandbox:    1.2.17
sys-devel/autoconf:  2.13, 2.61
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1, 1.10
sys-devel/binutils:  2.17.50.0.16
sys-devel/gcc-config: 1.3.16
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.11-r2
ACCEPT_KEYWORDS="arm"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-Os -pipe -march=armv5te"
CHOST="arm-unknown-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config"
CONFIG_PROTECT_MASK="/etc/env.d /etc/gconf /etc/revdep-rebuild /etc/terminfo"
CXXFLAGS="-Os -pipe -march=armv5te"
DISTDIR="/usr/portage/distfiles"
FEATURES="distlocks metadata-transfer sandbox sfperms strict"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --filter=H_**/files/digest-*"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="acl arm berkdb bitmap-fonts bzip2 cli cracklib crypt cups fortran iconv isdnlog midi mudflap ncurses nls nptl nptlonly openmp pam pcre perl ppds pppd python readline reflection session spl ssl symlink tcpd truetype-fonts type1-fonts unicode xorg zlib" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" USERLAND="GNU" VIDEO_CARDS="chips dummy fbdevglint mach64 mga nv r128 radeon s3 s3virge savage sisusb tdfx trident v4l vga voodoo"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LDFLAGS, LINGUAS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY
Comment 7 Dave Paden 2007-08-09 21:17:05 UTC
Alright, I've tried everything I can think of and I can't get the final library to link.  I created a freetype-config2 script which executes with --prefix=${ROOT}/usr to force the following flags to be added when linking:

# ROOT=$SYSROOT freetype-config2 --libs
-L/usr/arm-unknown-linux-gnu/usr/lib -Wl,--rpath -Wl,/usr/arm-unknown-linux-gnu/usr/lib -lfreetype -lz
# ROOT=$SYSROOT freetype-config2 --cflags
-I/usr/arm-unknown-linux-gnu/usr/include/freetype2 -I/usr/arm-unknown-linux-gnu/usr/include

Everything works fine until I go to build the shared library.  I see that the correct flags have been added to the libtool/gcc commands, but the system is STILL trying to use /usr/lib/libfreetype.so!  Is there anyway to force libtool to look at the right place without removing the native version of the library?  What am I missing?
Comment 8 solar (RETIRED) gentoo-dev 2008-05-23 06:43:28 UTC
I just cross compiled fontconfig for arm using.

EXTRA_ECONF="--with-arch=arm" giz -q fontconfig -pv
[ebuild   R   ] media-libs/fontconfig-2.5.0-r1 to /usr/armv5te-softfloat-linux-gnueabi/ USE="-doc -xml" 

giz is just a wrapper around the right portage/emerge env variables.
Comment 9 solar (RETIRED) gentoo-dev 2008-05-23 06:47:18 UTC
FYI: to outsmart the libtool shit we use.

#!/bin/bash

function strip_path()
{
        echo $1 | grep -Eo "[^\/]+$"
}

function re_safe()
{
        echo $1 | gawk '{ gsub("/","\\/"); print }'
}

CROSS_ROOT="/usr/armv5te-softfloat-linux-gnueabi"

for LA in $(find $CROSS_ROOT/usr/lib/ -iname *.la); do
        printf "Scanning $(strip_path $LA)\t"
        sed -i -e "s;libdir='/usr/lib';libdir='$CROSS_ROOT/usr/lib';" $LA
        if [[ $? -eq 0 ]]; then
                printf "DONE\n"
        else
                printf "FAIL\n"
        fi
done

for PC in $CROSS_ROOT/usr/lib/pkgconfig/*.pc; do
        printf "Scanning $(strip_path $PC)\t"
        sed -i -e "s/^prefix\\=\\/usr$/prefix\=$(re_safe "$CROSS_ROOT")\\/usr/" $PC
        if [[ $? -eq 0 ]]; then
                printf "DONE\n"
        else
                printf "FAIL\n"
        fi 
done
Comment 10 Peter Volkov (RETIRED) gentoo-dev 2008-06-22 16:28:02 UTC
solar, please, comment. Why nobody suggested patch to add --with-arch=${ARCH} to econf? Is it safe to do so?
Comment 11 solar (RETIRED) gentoo-dev 2008-09-21 06:16:29 UTC
I committed a fix for this tonight. Reopen if bug continues.