Re: Does gobject-introspection support the cross-compile?





On 08/13/2014 01:31 PM, Tristan Van Berkom wrote:
On Wed, 2014-08-13 at 09:09 +0800, Rongqing Li wrote:
Hi:

     I want to compile gobject-introspection for arm cpu in x86 host,
both are linux OS. The compilation failed since g-ir-compiler
(compiled for arm) can not run on x86.

     Could you tell me if it supports the cross-compile, if not, what
should I do to enable it? is it possible that I use the host's
g-ir-compiler/g-ir-scanner to compiler the target(arm cpu) file.

This sounds like a typical problem you will run into when cross
compiling your stack, pkg-config is another example.

There are probably a number of techniques you can use, and one
option to consider is to just actually build on the target
arch. If you must cross-compile, one project which I've
used with success is buildroot[0], this solves the said problem
by building two stacks, one 'staging' stack which contains
tools compiled for the build host arch, and then the target
stack which is cross compiled, executing binaries from the
'staging' build directory.

Cheers,
     -Tristan


Thanks for your reply.

I am using the two stacks as you said, but I think something must be
changed like below patch; but it still have issue. could you show me
your fix for cross compilation?

other question about g-ir-compile/g-ir-scanner is:
they are used to generate the *.typefile, are the *.typefile be allarch
{it is not related arch}? like I use x86's g-ir-compile to generate
*.typefile, *.typefile can be used on arm arch?



[PATCH] use host tool

Signed-off-by: Roy Li <rongqing li windriver com>
---
 common.mk |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/common.mk b/common.mk
index 303622f..6f5e15a 100644
--- a/common.mk
+++ b/common.mk
@@ -13,7 +13,7 @@ INTROSPECTION_SCANNER = \
         PYTHONPATH=$(top_builddir):$(top_srcdir) \
         UNINSTALLED_INTROSPECTION_SRCDIR=$(top_srcdir) \
         UNINSTALLED_INTROSPECTION_BUILDDIR=$(top_builddir) \
-        $(top_builddir)/g-ir-scanner
+        g-ir-scanner

 INTROSPECTION_SCANNER_ARGS = \
     --verbose \
@@ -25,7 +25,7 @@ INTROSPECTION_SCANNER_ARGS = \

 INTROSPECTION_COMPILER = \
     env PATH=".libs:$(PATH)" \
-        $(top_builddir)/g-ir-compiler$(EXEEXT)
+        g-ir-compiler$(EXEEXT)

 INTROSPECTION_COMPILER_ARGS = \
     --includedir=$(srcdir) \
@@ -39,7 +39,7 @@ INTROSPECTION_DOCTOOL = \
         PYTHONPATH=$(top_builddir):$(top_srcdir) \
         UNINSTALLED_INTROSPECTION_SRCDIR=$(top_srcdir) \
         UNINSTALLED_INTROSPECTION_BUILDDIR=$(top_builddir) \
-        $(top_builddir)/g-ir-doc-tool
+        g-ir-doc-tool

 INTROSPECTION_DOCTOOL_ARGS = \
     --add-include-path=$(srcdir) \
--
1.7.10.4



-Roy



PS: fwiw there is also a new gobject-introspection mailing list:
     https://mail.gnome.org/mailman/listinfo/gir-devel-list

[0]:http://buildroot.uclibc.org/



-Roy


| ./g-ir-compiler: line 117:
/buildarea1/lirq/mips/bitbake_build/tmp/work/mips64-wrs-linux/gobject-introspection/1.40.0-r0/build/.libs/lt-g-ir-compiler:
cannot execute binary file: Exec format error
| ./g-ir-compiler: line 117:
/buildarea1/lirq/mips/bitbake_build/tmp/work/mips64-wrs-linux/gobject-introspection/1.40.0-r0/build/.libs/lt-g-ir-compiler:
Success
| make[2]: *** [gir/xfixes-4.0.typelib] Error 126
| ./g-ir-compiler: line 117:
/buildarea1/lirq/mips/bitbake_build/tmp/work/mips64-wrs-linux/gobject-introspection/1.40.0-r0/build/.libs/lt-g-ir-compiler:
cannot execute binary file: Exec format error
| ./g-ir-compiler: line 117:
/buildarea1/lirq/mips/bitbake_build/tmp/work/mips64-wrs-linux/gobject-introspection/1.40.0-r0/build/.libs/lt-g-ir-compiler:
Success
| make[2]: *** [gir/xlib-2.0.typelib] Error 126
| Traceback (most recent call last):
|   File "./g-ir-scanner", line 44, in <module>
|     from giscanner.scannermain import scanner_main
|   File
"/buildarea1/lirq/mips/bitbake_build/tmp/work/mips64-wrs-linux/gobject-introspection/1.40.0-r0/gobject-introspection-1.40.0/giscanner/scannermain.py",
line 35, in <module>
|     from giscanner.dumper import compile_introspection_binary
|   File
"/buildarea1/lirq/mips/bitbake_build/tmp/work/mips64-wrs-linux/gobject-introspection/1.40.0-r0/gobject-introspection-1.40.0/giscanner/dumper.py",
line 28, in <module>
|     from .gdumpparser import IntrospectionBinary
|   File
"/buildarea1/lirq/mips/bitbake_build/tmp/work/mips64-wrs-linux/gobject-introspection/1.40.0-r0/gobject-introspection-1.40.0/giscanner/gdumpparser.py",
line 31, in <module>
|     from .transformer import TransformerException
|   File
"/buildarea1/lirq/mips/bitbake_build/tmp/work/mips64-wrs-linux/gobject-introspection/1.40.0-r0/gobject-introspection-1.40.0/giscanner/transformer.py",
line 27, in <module>
|     from .girparser import GIRParser
_______________________________________________
gtk-devel-list mailing list
gtk-devel-list gnome org
https://mail.gnome.org/mailman/listinfo/gtk-devel-list





--
Best Reagrds,
Roy | RongQing Li


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