[redland] error when cross compiling
Dave Beckett
dave.beckett at bristol.ac.uk
Wed Sep 4 23:18:36 BST 2002
>>>Seth Ladd said:
> Hello,
>
> I'm trying to compile redland 0.9.11 for the AXIS linux board
> (http://developer.axis.com). I've successfully compiled libxml2 for
> this board, and now I'm onto redland.
>
> Some background info:
>
> compiling redland 0.9.11 on linux 2.4.17 with a cross compiler named
> gcc-cris, target is an axis communications chip running linux 2.4.14.
>
> I get a strange error when compiling. When I use the standard gcc for
> x86, all the source compiles fine. When I use the compiler for the axis
> board (called gcc-cris), I get the below errors. I can usually track
> down simple problems, but this errors points to a line in the code that
> doesn't make any sense.
>
> Any hints or tips would be greatly appreciated. We're committed to
> using redland on this board, so I hope we can get it compiled. :)
This is breaking new ground for m - I've never tried cross-compiling
it and am surpised it worked (see below).
> make[2]: Entering directory `/home/seth/downloads/redland-0.9.11'
> /bin/sh ./libtool --mode=compile gcc-cris -mlinux -isystem
> /home/seth/downloads/axis/devboard_lx/target/cris-axis-linux-gnu/include
> -DHAVE_CONFIG_H -I. -I. -I. -I/usr/include/libxml2 -O2 -c rdf_init.c
> gcc-cris -mlinux -isystem
> /home/seth/downloads/axis/devboard_lx/target/cris-axis-linux-gnu/include
> -DHAVE_CONFIG_H -I. -I. -I. -I/usr/include/libxml2 -O2 -c rdf_init.c -o
> rdf_init.o
> In file included from rdf_init.c:35:
> rdf_hash.h:120: parse error before `*'
> rdf_hash.h:121: parse error before `*'
> rdf_hash.h:121: warning: data definition has no type or storage class
> rdf_hash.h:132: parse error before `librdf_hash_factory'
> rdf_hash.h:151: parse error before `*'
> rdf_hash.h:151: parse error before `librdf_hash_datum'
> rdf_hash.h:151: warning: data definition has no type or storage class
> rdf_hash.h:157: parse error before `librdf_hash_datum'
> rdf_hash.h:160: parse error before `librdf_hash_datum'
> rdf_hash.h:163: parse error before `librdf_hash_datum'
> rdf_hash.h:165: parse error before `librdf_hash_datum'
> rdf_hash.h:166: parse error before `librdf_hash_datum'
> rdf_hash.h:167: parse error before `librdf_hash_datum'
> rdf_hash.h:195: parse error before `librdf_hash_datum'
> rdf_hash.h:196: parse error before `librdf_hash_datum'
> rdf_hash.h:197: parse error before `librdf_hash_datum'
> rdf_hash.h:198: parse error before `librdf_hash_datum'
> rdf_init.c: In function `librdf_new_world':
> rdf_init.c:63: sizeof applied to an incomplete type
> rdf_init.c: In function `librdf_error':
> rdf_init.c:136: dereferencing pointer to incomplete type
> rdf_init.c:137: dereferencing pointer to incomplete type
> rdf_init.c:137: dereferencing pointer to incomplete type
> rdf_init.c: In function `librdf_warning':
> rdf_init.c:161: dereferencing pointer to incomplete type
> rdf_init.c:162: dereferencing pointer to incomplete type
> rdf_init.c:162: dereferencing pointer to incomplete type
> rdf_init.c: In function `librdf_world_set_error':
> rdf_init.c:189: dereferencing pointer to incomplete type
> rdf_init.c:190: dereferencing pointer to incomplete type
> rdf_init.c: In function `librdf_world_set_warning':
> rdf_init.c:207: dereferencing pointer to incomplete type
> rdf_init.c:208: dereferencing pointer to incomplete type
> rdf_init.c: In function `librdf_world_set_digest':
> rdf_init.c:224: dereferencing pointer to incomplete type
> rdf_init.c: In function `librdf_world_set_uris_hash':
> rdf_init.c:240: dereferencing pointer to incomplete type
> make[2]: *** [rdf_init.lo] Error 1
> make[2]: Leaving directory `/home/seth/downloads/redland-0.9.11'
> make[1]: *** [all-recursive] Error 1
> make[1]: Leaving directory `/home/seth/downloads/redland-0.9.11'
Very odd. Looks like something in the configure step went horribly
wrong? Did it fail to define byte, u32 or something?
So I downloaded the cris-dist and linux-headers and after a bit of
fiddling, this works for me, building everything up to the example
files and libraries:
tar xfz redland-0.9.11.1.tar.gz
cd redland-0.9.11/
echo 'ac_cv_c_bigendian=${ac_cv_c_bigendian=no}' > config.cache
CC="gcc-cris -mlinux -isystem /usr/local/cris/linux-headers"
export CC
./configure --target=crislinux --with-libwww=no
make
I don't know about the big-endianness of the target - I had to guess
something. I used --with-libwww to ignore a locally (x86)
available library.
Bits of the log:
$ ./configure --target=crislinux --with-libwww=no
loading cache ./config.cache
checking host system type... ./config.guess: ./dummy-14185: cannot execute binary file
i686-pc-linux-gnu
checking for a BSD compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking whether make sets ${MAKE}... yes
checking for working aclocal... found
checking for working autoconf... found
checking for working automake... found
checking for working autoheader... found
checking for working makeinfo... found
checking for gcc... gcc-cris -mlinux -isystem /usr/local/cris/linux-headers
checking whether the C compiler (gcc-cris -mlinux -isystem /usr/local/cris/linux-headers ) works... yes
checking whether the C compiler (gcc-cris -mlinux -isystem /usr/local/cris/linux-headers ) is a cross-compiler... yes
checking whether we are using GNU C... yes
checking whether gcc-cris -mlinux -isystem /usr/local/cris/linux-headers accepts -g... yes
checking for gcc-cris -mlinux -isystem /usr/local/cris/linux-headers option to accept ANSI C... none needed
checking whether build environment is sane... yes
...
$ make
...
/bin/sh ./libtool --mode=link gcc-cris -mlinux -isystem /usr/local/cris/linux-headers -DLIBRDF_INTERNAL=1 -I./expat/xmlparse -g -o example4 -static example4.o librdf.la
gcc-cris -mlinux -isystem /usr/local/cris/linux-headers -DLIBRDF_INTERNAL=1 -I./expat/xmlparse -g -o example4 example4.o ./.libs/librdf.a
make[2]: Leaving directory `/home/cmdjb/rdf/redland/librdf/redland-0.9.11'
make[1]: Leaving directory `/home/cmdjb/rdf/redland/librdf/redland-0.9.11'
$
There might be some issues with building against the cross-compiled
libxml, since there are run-time configure tests for it, you will
have to hand-edit configure.in for that I think:
checking for main in -lxmltok... no
checking for XML_ParserCreateNS in -lxmlparse... no
checking for XML_ParserCreateNS in -lexpat... no
checking for working expat in libxmlparse and libxmltok... no
checking for working expat in libexpat... no
checking for xml2-config... xml2-config
checking for libxml sources... no
checking for xmlCreatePushParserCtxt in -lxml... no
checking for system (GNOME) libxml library... no
You should especially make sure that the cross-compiled installation
of libxml2 is found - i.e. xml2-config (or xml-config) is in your
PATH.
In my test I just let the default built-in expat compile.
Hope that helps
What are you intending to do with this. Just curious.
Dave
More information about the redland-dev
mailing list