Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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.

share|improve this question
    
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" –  Parthiv Shah Mar 15 '13 at 7:13
    
But it gave me an error : C Compiler cannot create executables. –  Parthiv Shah Mar 15 '13 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" –  Parthiv Shah Mar 15 '13 at 8:12
2  
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 '13 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 –  Parthiv Shah Mar 18 '13 at 9:19
show 1 more comment

1 Answer 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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.