Topic: Glib2.0 ARM

I've been cross compiling various things for the chumby (I have gotten Nano-X running, binary anyone?) I'm trying to get GTK+ working, but I need glib. I can't compile this for some reason. I can run

./configure --target=arm-linux --prefix=/arm-linux

And it configures fine.
But then I get this error on

arm-linux-make LIBTOOL=arm-linux-libtool

(I've cross-compiled libtool, you need it. I've got the binary if anyone wants it)
It goes for about a minute, then I get...

if arm-linux-libtool --mode=compile arm-linux-gcc -DHAVE_CONFIG_H -I. -I. -I.. -I.. -DG_LOG_DOMAIN=\"GLib\" -DG_DISABLE_CAST_CHECKS -DG_DISABLE_DEPRECATED -DGLIB_COMPILATION   -pthread  -g -O2 -Wall -MT gatomic.lo -MD -MP -MF ".deps/gatomic.Tpo" \
          -c -o gatomic.lo `test -f 'gatomic.c' || echo './'`gatomic.c; \
        then mv -f ".deps/gatomic.Tpo" ".deps/gatomic.Plo"; \
        else rm -f ".deps/gatomic.Tpo"; exit 1; \
        fi
arm-linux-gcc -DHAVE_CONFIG_H -I. -I. -I.. -I.. -DG_LOG_DOMAIN=\"GLib\" -DG_DISABLE_CAST_CHECKS -DG_DISABLE_DEPRECATED -DGLIB_COMPILATION -pthread -g -O2 -Wall -MT gatomic.lo -MD -MP -MF .deps/gatomic.Tpo -c gatomic.c  -fPIC -DPIC -o .libs/gatomic.o
gatomic.c: In function `IA__g_atomic_int_compare_and_exchange':
gatomic.c:61: error: impossible constraint in `asm'
gatomic.c:59: warning: `result' might be used uninitialized in this function

If you're wondering; gatomic.c lines 59-65:
...
  gint result;

  __asm__ __volatile__ ("lock; cmpxchgl %2, %1"
            : "=a" (result), "=m" (*atomic)
            : "r" (newval), "m" (*atomic), "0" (oldval));

  return result == oldval;
...

Thanks. If anyone was able to build this, please let me know, and send me a binary tongue

Re: Glib2.0 ARM

It looks to me like it's not cross-compiling - the assembly code in that block is x86, not ARM.

In particular, 'cmpxchgl' is clearly an x86 instruction.  You should not be getting this error at all, since this code should not be compiling.

Re: Glib2.0 ARM

For glib, you need a cache file which defines some architectural stuff, since you can't run any of the checks natively. Make a file in the glib source dir called "arm.cache", dump the following into it (works for me anyways):
glib_cv_long_long_format=ll
glib_cv_stack_grows=no
glib_cv_sane_realloc=yes
glib_cv_have_strlcpy=no
glib_cv_va_val_copy=yes
glib_cv_rtldglobal_broken=no
glib_cv_uscore=no
glib_cv_monotonic_clock=no
ac_cv_func_nonposix_getpwuid_r=no
ac_cv_func_posix_getpwuid_r=yes
glib_cv_use_pid_surrogate=yes
ac_cv_func_printf_unix98=no
ac_cv_func_vsnprintf_c99=yes

Then ./configure [everything you want here] --target=arm-linux --host=arm-linux --build=i386-linux  --cache-file=arm.cache

I've been tinkering with the idea of getting GTK+ running via DirectFB, but I haven't done it yet. I think I'll give it a try just to see...

4 (edited by zachninme 2007-09-18 02:42:46)

Re: Glib2.0 ARM

Ah, thanks awalton.
It configured, which is new with the --host variable smile

EDIT: Anndd compiled! Thanks big_smile

Re: Glib2.0 ARM

nano-X sounds cool.

Yes, please post binaries when you have them.  I would love to try them out.

Justin

Re: Glib2.0 ARM

nano-X, in itself, is quite boring tongue
When you add it with nanowm and say, ntetris, or nxscribble, you start going somewhere tongue

I'll zip them up and email them to you ;-)

Re: Glib2.0 ARM

Zach,

What is your linux distro?  Did you install the standard toolchain available from the wiki?

All,

I was thinking about writing a wxWidgets application.  I could either use Nano-X, or I could attempt to make wxWidgets talk directly to the framebuffer.  What d'yall think is the best route?

Cheers,
-J