3

I am using SQLite 3 for Database management in my ARM9 based microprocessor.

I want to cross compile the latest version of the SQLite 3 for my project in Linux (Ubuntu 10.04). I am using the arm-none-linux-gnueabi-gcc compiler for development.

I tried to cross compile using following commands,

Downloaded the sqlite-amalgamation-3.7.0.tar I extract it and then write the following command on Terminal,

sudo ./configure --exec-prefix=/media/8CCC8E9BCC8E7F68/SQLIte3/sqliteinstall/  --host=arm --target=arm CC=/opt/arm-2011.03/bin/arm-none-linux-gnueabi-gcc AR=/opt/arm-2011.03/bin/arm-none-linux-gnueabi-ar STRIP=/opt/arm-2011.03/bin/arm-none-linux-gnueabi-strip RANLIB=/opt/arm-2011.03/bin/arm-none-linux-gnueabi-ranlib CFLAGS="-Os"

It successfully cross compiled the SQLite.

Then,

sudo make

command.

It successfully run. Now make install command.

It did not give me an error but when I went to the config.log file i found there is some sentences as following,

 1.conftest.c:17:7: error: size of array 'off_t_is_large' is negative
 2.conftest.c:12:28: fatal error: ac_nonexistent.h: No such file or directory
compilation terminated.
 3.conftest.cpp:23:28: error: ac_nonexistent.h: No such file or directory
 4.conftest.c:67:13: error: invalid type argument of unary '*' (have 'int')

I doubt that weather it has been cross compiled properly or not. I can not understand.

I inserted the library on my board it works fine but the problem is that the speed got very slow. I think there is some problem that i have not set any flags for the GCC compiler.

I could not find any options.How I can set the particular flags for the GCC compiler so that unnecessary features can be omitted.

6
  • I think there is some issue that it can not find the compiler path ,So i find where my GCC compiler is installed and then reconfigured it with the following command. ./configure --host=arm CC=/opt/arm-2011.03/bin/arm-none-linux-gnueabi-gcc AR=/opt/arm-2011.03/bin/arm-none-linux-gnueabi-ar STRIP=/opt/arm-2011.03/bin/arm-none-linux-gnueabi-strip RANLIB=/opt/arm-2011.03/bin/arm-none-linux-gnueabi-ranlib CFLAGS="Os" Mar 15, 2013 at 7:13
  • But it gave me an error : C Compiler cannot create executables. Mar 15, 2013 at 7:16
  • Right now I am getting an error in the cross compilation. It gave me an error that "C COMPILER CANNOT CREATE EXECUTABLES" Mar 15, 2013 at 8:12
  • 3
    Yes, but what I mean is: don't add this to the comments. Edit the question itself such that it reflects exactly where you are stuck.
    – zwets
    Mar 15, 2013 at 8:20
  • Hey I got some useful information about the Cflags and Finally Configueed my SQLIte 3.7.15.2 with the Most appropriate parameters and features. Please go through the Below link for CFALGS. gcc.gnu.org/onlinedocs/gcc/ARM-Options.html Mar 18, 2013 at 9:19

1 Answer 1

1

This worked for me (and it works to cross compile most other third-party software):

$ export PATH=$PATH:<path to directory containing your cross-compiler binaries>
$ cd <path to the directory containing the thirdparty code>
$ ./configure --prefix="<installation path>" --host=arm-unknown-linux-gnueabi

Add your CFLAGS and other configuration parameters to the configuration parameters. E.g.,

$ ./configure --prefix="<installation path>" --host=arm-unknown-linux-gnueabi -CFLAGS="-Os" --enable-threadsafe

If in your case the target system is specified by arm-none-linux-gnueabi, replace the host in the above example:

$ ./configure --prefix="<installation path>" --host=arm-none-linux-gnueabi -CFLAGS="-Os" --enable-threadsafe

The paths to GCC, CC, AR, ... will be found from the host you've set.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .