Problem configuring libffi when trying to cross-compile

Boris Zbarsky bzbarsky@MIT.EDU
Mon Jan 25 17:25:00 GMT 2010


I was recently trying to cross-compile Mozilla (which uses libffi for 
its js-ctypes module); compiling on a Linux host and creating Mac 
binaries.  See http://weblogs.mozillazine.org/bz/archives/020363.html 
for the steps for setting up the toolchain and such.

During the configure step for libffi, the build fails.  The relevant 
configure call looks like this:

mozilla/js/ctypes/libffi/configure  --disable-shared --enable-static 
--disable-raw-api --enable-debug --with-pic 
--build=x86_64-unknown-linux-gnu --host=i686-apple-darwin9 
--target=i686-apple-darwin9 
--cache-file=../../../js/ctypes/libffi/config.cache 
--srcdir=/home/bzbarsky/mozilla/mac-test/mozilla/js/ctypes/libffi

(I tried various permutations of target and host, but they all had the 
same effect).  The failure is:

   config.status: executing src commands
   nsinstall.c
   pathsub.c
   ld: unknown option: --eh-frame-hdr
   collect2: ld returned 1 exit status

The --eh-frame-hdr option is not in fact supported by Apple's ld (which 
is not a gnu ld).

Other possibly-relevant output from the configure step:

   checking whether we are cross compiling... yes
   checking whether we are using the GNU C compiler... yes
   checking if the linker (/Developer/usr/bin/ld) is GNU ld... no
   configure: WARNING: using cross tools not prefixed with host triplet

If someone wants to try reproducing (and I do apologize for the very 
non-minimal steps to reproduce), the mozconfig file I'm using is 
attached, as well as a patch to mozilla's toplevel configure that is 
needed to make sure libffi's configure is running independently of the 
toplevel one.

I'm also happy to run whatever people want me to run locally to help 
sort this out.

-Boris
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: libffi-configure.patch
URL: <http://sourceware.org/pipermail/libffi-discuss/attachments/20100125/4250ac9b/attachment.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: mozconfig
URL: <http://sourceware.org/pipermail/libffi-discuss/attachments/20100125/4250ac9b/attachment-0001.ksh>


More information about the Libffi-discuss mailing list