loongson 1B 开发板移植sqlite3.6.20
附注:在sqlite 版本为大于3.6.20无需参考本博客
目标平台:loongson 1B 目标开发板架构:mipsel架构 编译平台:ubuntu13.04 交叉工具链:gcc-4.3-ls232-softfloat 在loongson 移植 sqlite3 备注:本文所有操作均在root用户下进行。
解压源码sqlite 3.6.20.tar.gz压缩包,进入sqlite3.6.20文件夹后执行:
1)./configure --host=mipsel-linux(指定交叉编译工具链) --prefix=/opt/mispel-linux-sqlite 2) make 3) make install 在执行make中会出现下面错误: 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 出现:skipping incompatible 一般是不同处理器架构引用了不属于自己处理器架构的库, 上面出现的情况,就是mipsel架构的引用了x86架构的库 libtclstub8.5。 所以要源码交叉编译tclsh才能解决上述问题。 解决方法:解压tcl8.5.15-src.tar.gz,并进入源码文件夹tcl8.5.15 执行:
1)./configure --host=mipsel-linux --prefix=/opt/mipsel-linux-tclsh 2) make 3) make install
但在 ./configure --host=mipsel-linux --prefix=/opt/mipsel-linux-tclsh 过程中会出现以下错误: fixstrtod.o: In function `fixstrtod':fixstrtod.c:(.text+0x0): multiple definition of `fixstrtod'strtod.o:strtod.c:(.text+0x0): first defined herecollect2: ld returned 1 exit statusmake: *** [libtcl8.5.so] 错误 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 就可以解决了。 编译安装完成后,在mipsel-linux-sqlite目录下分别生成bin、include和lib目录。 将bin/sqlite3与lib/libsqlite3.so.0.8.6分别拷至文件系统/bin目录与/lib目录下, 并将libsqlite3.so.0.8.6更名为libsqlite3.so.0完成移植。 (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |