Re: Cross compile glib for ARM



Hi Mike,

I have experienced the same problem when I am also tring to cross
compile gtk and its dependencies...

I successfully did it through the following:

 Do not set the PATH first to your gtk prefix installation directory
(directory destination)

(/usr/local/arm/3.4.1/arm-linux/bin). When this is set, cross compiled
glib-genmarshall is detected which causes the error:
    >>/home/mike/embedded/GUI/glib-2.0.6/gobject/.libs/lt-glib-genmarshal:
    >>cannot execute binary file


1) Natively compile first the glib to the PC. If you already installed
it on your PC, It is   located in /usr/bin directory so no need to
compile it natively. Proceed to next step.
    The purpose of natively compiled first is cross compiling glib
uses it's own native
     compile "glib-genmarshall" and executes it. If the cross compiled
one is detected error
      will occur.

2) set PATH to your toolchain path

    export PATH={path-to-arm-toolchain}/bin:$PATH

3) Configure it like what you have done
     ./configure --prefix=/usr/local/arm/3.4.1/arm-linux --host=arm-linux

4) Issue a make command
    make



On 1/5/06, mike lee <mikelee avantwave com> wrote:
> Hi all
>    Does glib/gtk support cross compile? Do i need any other patch?
>
>    I fail to cross compile latest glib 2.6 and also 2.0 with
>        ./configure --prefix=/usr/local/arm/3.4.1/arm-linux --host=arm-linux
>        make
>
>     Also try to fake configure, but it fail to run glib-genmarshal which
> can not excute in i386.
>        ./configure
>        make CC=arm-linux-gcc LD=arm-linux-ld
>
> Making all in gobject
> make[2]: Entering directory `/home/mike/embedded/GUI/glib-2.0.6/gobject'
> arm-linux-gcc -DHAVE_CONFIG_H -I. -I. -I..
> -DG_LOG_DOMAIN=\"GLib-GObject\" -I.. -I../glib -I..
> -DGOBJECT_COMPILATION -DG_DISABLE_CONST_RETURNS    -g -O2 -Wall
> -D_REENTRANT -c glib-genmarshal.c
> /bin/sh ../libtool --mode=link arm-linux-gcc  -g -O2 -Wall
> -D_REENTRANT  -o glib-genmarshal  glib-genmarshal.o ../glib/libglib-2.0.la
> arm-linux-gcc -g -O2 -Wall -D_REENTRANT -o .libs/glib-genmarshal
> glib-genmarshal.o  ../glib/.libs/libglib-2.0.so -Wl,--rpath
> -Wl,/usr/local/lib
> creating glib-genmarshal
> echo "#ifndef __G_MARSHAL_H__" > xgen-gmh \
> && echo "#define __G_MARSHAL_H__" >> xgen-gmh \
> && ./glib-genmarshal --nostdinc --prefix=g_cclosure_marshal
> ./gmarshal.list --header >> xgen-gmh \
> && echo "#endif /* __G_MARSHAL_H__ */" >> xgen-gmh \
> && (cmp -s xgen-gmh ./gmarshal.h || cp xgen-gmh ./gmarshal.h) \
> && rm -f xgen-gmh xgen-gmh~ \
> && echo timestamp > stamp-gmarshal.h
> ./glib-genmarshal: line 109:
> /home/mike/embedded/GUI/glib-2.0.6/gobject/.libs/lt-glib-genmarshal:
> cannot execute binary file
> ./glib-genmarshal: line 109:
> /home/mike/embedded/GUI/glib-2.0.6/gobject/.libs/lt-glib-genmarshal: Success
> make[2]: *** [stamp-gmarshal.h] Error 1
> make[2]: Leaving directory `/home/mike/embedded/GUI/glib-2.0.6/gobject'
> make[1]: *** [all-recursive] Error 1
> make[1]: Leaving directory `/home/mike/embedded/GUI/glib-2.0.6'
> make: *** [all-recursive-am] Error 2
>
> Thx
> Mike,Lee
>
> _______________________________________________
> gtk-list mailing list
> gtk-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtk-list
>



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