1. I'm try to cross compile fontconfig, it fail at compile stage due to need a host helper programe. Those small utils should be compiled with HOST compiler, not cross-ones. And fontconfig mess this. using "HOST Gcc compile" + "TARGET CFLAGS" is wrong! ERR: gcc -DHAVE_CONFIG_H -I. -I.. -I../src -I.. -Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -fno-strict-aliasing -Os -pipe -DMARCH_CENSORED -DMTUNE_CENSORED -mfpu=neon -mfloat-abi=softfp -fomit-frame-pointer -I/usr/armv7a-softfloat-linux-gnueabi/usr/include/ -I/usr/armv7a-softfloat-linux-gnueabi/include/ -MT fc-case.o -MD -MP -MF .deps/fc-case.Tpo -c -o fc-case.o fc-case.c cc1: error: unrecognized command line option "-mfpu=neon" cc1: error: unrecognized command line option "-mfloat-abi=softfp" make[3]: *** [fc-case.o] Error 1 make[3]: Leaving directory `/var/build/portage/media-libs/fontconfig-2.7.2/work/fontconfig-2.7.2/fc-case' make[2]: *** [all] Error 2 make[2]: Leaving directory `/var/build/portage/media-libs/fontconfig-2.7.2/work/fontconfig-2.7.2/fc-case' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/var/build/portage/media-libs/fontconfig-2.7.2/work/fontconfig-2.7.2' make: *** [all] Error 2 $ emerge-armv7a-softfloat-linux-gnueabi --info Portage 2.1.6.13 (!/usr/local/layman/gentoo-arm-overlay/profiles/default/linux/arm/10.0/neuvoo/armv7a/minimal, gcc-4.4.1, glibc-2.9_p20081201-r3, 2.6.31-rc6-git8 i686) ================================================================= System uname: Linux-2.6.31-rc6-git8-i686-Intel-R-_Core-TM-2_Duo_CPU_P8600_@_2.40GHz-with-gentoo-2.0.1 Timestamp of tree: Sat, 12 Sep 2009 02:45:03 +0000 ccache version 2.4 [disabled] app-shells/bash: 4.0_p33 dev-java/java-config: 2.1.9 dev-lang/python: 2.5.4-r2, 2.6.2-r1, 3.1.1 dev-python/pycrypto: 2.0.1-r8 dev-util/ccache: 2.4-r8 sys-apps/baselayout: 2.0.1 sys-apps/openrc: 0.4.3-r3 sys-apps/sandbox: 2.1 sys-devel/autoconf: 2.63-r1 sys-devel/automake: 1.10.2, 1.11 sys-devel/binutils: 2.19.1-r1 sys-devel/gcc-config: 1.4.1 sys-devel/libtool: 2.2.6a virtual/os-headers: 2.6.30-r1 ACCEPT_KEYWORDS="arm ~arm" CBUILD="i486-pc-linux-gnu" CFLAGS="-Os -pipe -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -fomit-frame-pointer -I/usr/armv7a-softfloat-linux-gnueabi/usr/include/ -I/usr/armv7a-softfloat-linux-gnueabi/include/" CHOST="armv7a-softfloat-linux-gnueabi" CONFIG_PROTECT="/etc /usr/share/config" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/udev/rules.d" CXXFLAGS="-Os -pipe -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -fomit-frame-pointer -I/usr/armv7a-softfloat-linux-gnueabi/usr/include/ -I/usr/armv7a-softfloat-linux-gnueabi/include/" DISTDIR="/mnt/soft/distfiles" FEATURES="buildpkg distlocks fixpackages nodoc noinfo noman parallel-fetch protect-owned sandbox sfperms strict unmerge-orphans userfetch" GENTOO_MIRRORS=" ftp://gentoo.anheng.com.cn/gentoo http://mirrors.163.com/gentoo http://mirror.averse.net/pub/gentoo " LDFLAGS="-L/usr/armv7a-softfloat-linux-gnueabi/lib -L/usr/armv7a-softfloat-linux-gnueabi/usr/lib -Wl,-O1" LINGUAS="zh_CN" MAKEOPTS="-j5" PKGDIR="/usr/armv7a-softfloat-linux-gnueabi/packages/" PORTAGE_CONFIGROOT="/usr/armv7a-softfloat-linux-gnueabi/" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages" PORTAGE_TMPDIR="/var/build/" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/portage /usr/local/layman/moko-git/trunk/openmoko-target /usr/local/layman/enlightenment /usr/local/layman/gentoo-arm-overlay" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="arm berkdb bindist bzip2 cli compat crypt cups dbus fortran gpm iconv isdnlog make-symlinks minimal mudflap ncurses nls nptl nptlonly openmp pam pcre pppd readline reflection session spl ssl sysfs tcpd threads threadsafe truetype unicode xorg xsettings zlib" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="evdev keyboard mouse touchscreen" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="zh_CN" USERLAND="GNU" VIDEO_CARDS="fbdev dummy" Unset: CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LANG, LC_ALL, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Created attachment 203938 [details] build err log for fontconfig
Created attachment 203939 [details] patch against fontconfig-2.7.2.ebuild to fix the problem When calling HOST gcc compiler, we should remove TARGET cflags
Created attachment 203941 [details] sorry, previous submmit
@embedded: could you review this patch? Looks like it fails because of wrong compiler was called, not because of some tools built with wrong compiler...
Created attachment 232525 [details, diff] fix cross compile Works for 2.7.3 too.
Previous patch remove old cross compile fix, it is no longer necessary.
Created attachment 233013 [details, diff] fix cross-compilation by modifiyng Makefile.am Instead of removing CFLAGS in Makefile.in, this patch override COMPILE and LINK variables in {doc,fc-arch,fc-case,fc-glyphname,fc-lang}/Makefile.am. Thoses tools are used at buildtime and should be build with CC_FOR_BUILD (eg $CBUILD-gcc) without the CFLAGS (which are customized for the host compiler) The changes is from: COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ to: COMPILE = $(CC_FOR_BUILD) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) (AM_CPPFLAGS) \ $(CPPFLAGS_FOR_BUILD) $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) LINK = $(CC_FOR_BUILD) $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) $(AM_LDFLAGS) $(LDFLAGS_FOR_BUILD) -o $@ So, CC is replaced by CC_FOR_BUILD, and {C,LD}FLAGS by {C,LD}FLAGS_FOR_BUILD (theses variables are left empty for now), It sounds less confusing that overriding CC by CC_FOR_BUILD.
*** Bug 447000 has been marked as a duplicate of this bug. ***
I have applied Pinky's fix in fontconfig-2.10.2. I'd like to hear from embedded if this works and whether there is a better fix they prefer.
(In reply to comment #9) unfortunately, that fix isn't really that much better, nor is it really needed anymore. the subdirs specifically check for cross-compiling now: if CROSS_COMPILING $(TARG): $(STMPL) fc-glyphname.c $(SGLYPHNAME) @echo Warning: cannot rebuild $(TARG) when cross-compiling else $(TARG): $(STMPL) fc-glyphname$(EXEEXT) $(SGLYPHNAME) $(AM_V_GEN) $(RM) $(TARG); \ ./fc-glyphname$(EXEEXT) $(SGLYPHNAME) < $(STMPL) > $(TARG).tmp && \ mv $(TARG).tmp $(TARG) endif also, the latest version no longer has a fc-arch/ subdir to `sed`: sed: can't read fc-arch/Makefile.in: No such file or directory
i've dropped all the cross-compiling workarounds in 2.10.2 http://sources.gentoo.org/media-libs/fontconfig/fontconfig-2.10.2.ebuild?r1=1.1&r2=1.2