@H_403_1@附注:在sqlite 版本为大于3.6.20无需参考本博客
@H_403_1@
@H_403_1@目标平台:loongson 1B
@H_403_1@目标开发板架构:mipsel架构
@H_403_1@编译平台:ubuntu13.04
@H_403_1@交叉工具链:gcc-4.3-ls232-softfloat
@H_403_1@@H_403_1@备注:本文所有操作均在root用户下进行。
@H_403_1@@H_403_1@解压源码sqlite 3.6.20.tar.gz压缩包,进入sqlite3.6.20文件夹后执行:
1)./configure --host=mipsel-linux(指定交叉编译工具链) --prefix=/opt/mispel-linux-sqlite 2) make 3) make install
@H_403_1@@H_403_1@在执行make中会出现下面错误:
@H_403_1@@H_403_1@libtool: link: mipsel-linux-gcc -shared .libs/tclsqlite.o -Wl,-rpath -Wl,/opt/sqlite-3.6.20-embedded/.libs -Wl,/opt/mipsel-linux-sqlite/lib ./.libs/libsqlite3.so -L/opt/tcl8.5.15/unix -ltclstub8.5 -lpthread -Wl,-soname -Wl,libtclsqlite3.so -o .libs/libtclsqlite3.so/opt/gcc-4.3-ls232-softfloat/lib/gcc/mipsel-linux/4.3.0/../../../../mipsel-linux/bin/ld: skipping incompatible /opt/gcc-4.3-ls232-softfloat/lib/gcc/mipsel-linux/4.3.0/../../../../mipsel-linux/lib/libtclstub8.5.a when searching for -ltclstub8.5/opt/gcc-4.3-ls232-softfloat/lib/gcc/mipsel-linux/4.3.0/../../../../mipsel-linux/bin/ld: cannot find -ltclstub8.5collect2: ld returned 1 exit statusmake: *** [libtclsqlite3.la] 错误 1
@H_403_1@出现:skipping incompatible 一般是不同处理器架构引用了不属于自己处理器架构的库,
@H_403_1@上面出现的情况,就是mipsel架构的引用了x86架构的库 libtclstub8.5。
@H_403_1@@H_403_1@所以要源码交叉编译tclsh才能解决上述问题。
@H_403_1@@H_403_1@解决方法:解压tcl8.5.15-src.tar.gz,并进入源码文件夹tcl8.5.15
1)./configure --host=mipsel-linux --prefix=/opt/mipsel-linux-tclsh 2) make 3) make install
@H_403_1@@H_403_1@但在 ./configure --host=mipsel-linux --prefix=/opt/mipsel-linux-tclsh
@H_403_1@@H_403_1@fixstrtod.o: In function `fixstrtod':fixstrtod.c:(.text+0x0): multiple definition of `fixstrtod'strtod.o:strtod.c:(.text+0x0): first defined herecollect2:
@H_403_1@@H_403_1@ld returned 1 exit statusmake: *** [libtcl8.5.so] 错误 1
@H_403_1@执行下面语句:
[root@CaM/opt/tcl-embedded/unix 11:45]#export ac_cv_func_strtod=yes [root@CaM/opt/tcl-embedded/unix 11:46]#export tcl_cv_strtod_buggy=1
@H_403_1@@H_403_1@编译安装完成后,在mipsel-linux-sqlite目录下分别生成bin、include和lib目录。
@H_403_1@@H_403_1@将bin/sqlite3与lib/libsqlite3.so.0.8.6分别拷至文件系统/bin目录与/lib目录下,
@H_403_1@@H_403_1@并将libsqlite3.so.0.8.6更名为libsqlite3.so.0完成移植。
原文链接:https://www.f2er.com/sqlite/200735.html