设为首页 加入收藏

TOP

龙芯1B开发板移植SQLite 3.6.20
2014-11-24 01:09:11 】 浏览:1254
Tags:龙芯 开发 移植 SQLite 3.6.20

附注:在sqlite 版本为大于3.6.20无需参考本博客


目标平台:loongson 1B


目标开发板架构:mipsel架构


交叉工具链: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,-rpath -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完成移植。


】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇Python三重引号编写多行字符串块 下一篇undefined reference to `png_cre..

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目