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,-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完成移植。

發佈了25 篇原創文章 · 獲贊 5 · 訪問量 6萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章