Re: Cross-compiling GLib 2.18 with arm-linux.



On Fri, 27 Mar 2009 13:00:52 +0200 Felipe Contreras wrote:

> 2009/3/23 John Peterson <j0hnp comcast net>:
> > Hello – I’m not sure I’ve got the right mailing list for this
> > question, but I thought I’d try.
> >
> >
> >
> > I have downloaded glib-2.18.0 on Linux FC4, and am trying to
> > cross-compile with an arm-linux-gcc compiler.  Most of the stuff
> > goes smoothly until I hit the atomic_spin_trylock in the gatomic.c
> > file.
> >
> >
> >
> > This function has some embedded assembly (denoted with the asm
> > keyword). The particular error that I get is:
> >
> >
> >
> > /bin/sh ../libtool --tag=CC   --mode=compile arm-linux-gcc
> > -DHAVE_CONFIG_H -I. -I.. -I.. -DG_LOG_DOMAIN=\"GLib\"
> > -DG_DISABLE_CAST_CHECKS -DG_DISABLE_DEPRECATED -DGLIB_COMPILATION
> > -DPCRE_STATIC -DG_DISABLE_SINGLE_INCLUDES -pthread -mbig-endian
> > -std=c99 -Wall -MT gatomic.lo -MD -MP -MF .deps/gatomic.Tpo -c -o
> > gatomic.lo gatomic.c
> >
> > arm-linux-gcc -DHAVE_CONFIG_H -I. -I.. -I.. -DG_LOG_DOMAIN=\"GLib\"
> > -DG_DISABLE_CAST_CHECKS -DG_DISABLE_DEPRECATED -DGLIB_COMPILATION
> > -DPCRE_STATIC -DG_DISABLE_SINGLE_INCLUDES -pthread -mbig-endian
> > -std=c99 -Wall -MT gatomic.lo -MD -MP -MF .deps/gatomic.Tpo -c
> > gatomic.c -fPIC -DPIC -o .libs/gatomic.o
> >
> > gatomic.c: In function `atomic_spin_trylock':
> >
> > gatomic.c:570: `asm' undeclared (first use in this function)
> >
> > gatomic.c:570: (Each undeclared identifier is reported only once
> >
> > gatomic.c:570: for each function it appears in.)
> >
> > gatomic.c:570: parse error before "volatile"
> >
> >
> >
> > I’m guessing that my arm-linux-gcc compiler is not compatible with
> > the embedded assembly directive, and that’s why I’m getting the
> > error.  However, I thought I’d check to see if maybe there was some
> > other setting that might make this work.
> 
> Which arm compiler are you using? I've tried with codesourcery and
> scratchbox2... glib builds fine.

Hell, I've built glib for ARM using gcc 2.95.3 and it's worked fine.

Try removing -std=c99 from your compiler command line (or replace it
with -std=gnu99 if you must).  Inline assembly might be a GNU
extension... I don't remember, though.

	-brian


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]