交叉编译SQLite适用于ARM架构

我正在使用SQLite 3来管理我基于ARM9的微处理器中的数据库。
我想要在Linux(Ubuntu 10.04)中为我的项目交叉编译最新版本的SQLite 3。我正在使用arm-none-linux-gnueabi-gcc编译器进行开发。
我尝试使用以下命令进行交叉编译,
下载了sqlite-amalgamation-3.7.0.tar 我解压它,然后在终端上写入以下命令,
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"

它成功地交叉编译了SQLite。
然后,
sudo make

命令。

它成功运行。现在执行make install命令。

它没有给我任何错误,但当我查看config.log文件时,发现有以下一些句子:

 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')

我怀疑它是否已经正确地进行了交叉编译。 我无法理解。
我在我的板子上插入了库,它工作得很好,但问题是速度变得非常慢。我认为有一些问题,我没有为GCC编译器设置任何标志。
我找不到任何选项。我如何为GCC编译器设置特定的标志,以便可以省略不必要的功能。

我认为有一些问题,它找不到编译器路径,所以我找到了我的GCC编译器安装位置,然后使用以下命令重新配置它。./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
但是它给了我一个错误:C编译器无法创建可执行文件。 - Parthiv Shah
现在我在交叉编译过程中遇到了一个错误。它给出了一个错误提示:"C编译器无法生成可执行文件"。 - Parthiv Shah
3是的,但我的意思是:不要将这个添加到评论中。编辑问题本身,以准确反映你卡住的地方。 - zwets
嘿,我得到了一些关于Cflags的有用信息,并最终配置了我的SQLIte 3.7.15.2,使用了最合适的参数和功能。请点击下面的链接查看CFALGS。http://gcc.gnu.org/onlinedocs/gcc/ARM-Options.html - Parthiv Shah
如果我要猜的话,你唯一的问题就是在不必要的地方使用了sudo。在执行./configuremake时不要使用sudo,最后使用sudo make install - Braiam
1个回答

这对我有效(并且可以用于交叉编译大多数其他第三方软件):
$ 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

将您的CFLAGS和其他配置参数添加到配置参数中。例如,
$ ./configure --prefix="<installation path>" --host=arm-unknown-linux-gnueabi -CFLAGS="-Os" --enable-threadsafe

如果在您的情况下,目标系统由arm-none-linux-gnueabi指定,请将上述示例中的主机替换为目标系统。
$ ./configure --prefix="<installation path>" --host=arm-none-linux-gnueabi -CFLAGS="-Os" --enable-threadsafe

GCC、CC、AR等路径将从您设置的主机中找到。