顯示具有 GM812x 標籤的文章。 顯示所有文章
顯示具有 GM812x 標籤的文章。 顯示所有文章

2013年8月19日 星期一

FIX: libmpfr.so.4: cannot open shared object file: No such file or directory

在ubuntu上使用toolchain產生zlib-1.2.5時發生了問題,在使用configure出現了:
======================================================
Checking for shared library support...
Tested arm-buildroot-linux-uclibcgnueabi-gcc -w -c -O ztest17184.c
/home/ken/WrkSrc/toolchain/buildroot-2012.11.1/output/host/usr/bin/../libexec/gcc/arm-buildroot-linux-uclibcgnueabi/4.4.0/cc1: error while loading shared libraries: libmpfr.so.4: cannot open shared object file: No such file or directory
Tested cc -shared -O -o ztest17184.so ztest17184.o
cc: error: ztest17184.o: No such file or directory
cc: fatal error: no input files
compilation terminated.
======================================================

可是當初在fedora 11上使用時卻沒有出現這樣的問題(
======================================================
Checking for shared library support...
Building shared library libz.so.1.2.5 with arm-buildroot-linux-uclibcgnueabi-gcc.
Checking for off64_t... Yes.
Checking for fseeko... Yes.
======================================================

所以上google搜尋,發現了以下的網頁
其中有類似的問題,然而解決的方式是:宣告 "LD_LIBRARY_PATH",所以嘗試 "LD_LIBRABY_PATH" 指向到 toolchain 的 lib 目錄後就可以正常 configure。


PS:
當以上步驟做完後,可以一起解決"lzp=2.04" configure遇到的問題。
cd lzo-2.04; CC=arm-buildroot-linux-uclibcgnueabi-gcc RANLIB=/home/ken/WrkSrc/toolchain/buildroot-2012.11.1/output/host/usr/bin/arm-buildroot-linux-uclibcgnueabi-ranlib ./configure --host=arm-buildroot-linux-uclibcgnueabi --prefix=/home/ken/WrkSrc/toolchain/buildroot-2012.11.1/output/host/usr/arm-buildroot-linux-uclibcgnueabi/
configure: WARNING: if you wanted to set the --build type, don't use --host.
    If a cross compiler is detected then cross compile mode will be used
configure: Configuring LZO 2.04
checking build system type... x86_64-unknown-linux-gnu
checking host system type... arm-buildroot-linux-uclibcgnueabi
checking target system type... arm-buildroot-linux-uclibcgnueabi
checking whether to enable maintainer-specific portions of Makefiles... no
checking for arm-buildroot-linux-uclibcgnueabi-gcc... arm-buildroot-linux-uclibcgnueabi-gcc
checking whether the C compiler works... no
configure: error: in `/home/ken/WrkSrc/svn/grain/platform/faraday/toolchain_lib/lzo-2.04':
configure: error: C compiler cannot create executables
See `config.log' for more details
make: *** [prebuild] Error 77

2013年2月6日 星期三

build uClibc toolchains using Buildroot for GM812x (續一) (補2/4)

參考來源:



  • http://communities.mentor.com/community/cs/archives/arm-gnu/msg01673.html
  • http://communities.mentor.com/community/cs/archives/arm-gnu/msg02332.html


問題解決:


  • 在產生nsboot.bin (gm8126_mp) 發生以下錯誤:
output/host/usr/lib/gcc/arm-buildroot-linux-uclibcgnueabi/4.6.3/libgcc.a(_dvmd_lnx.o): In function `__aeabi_ldiv0':
output/toolchain/gcc-4.6.3/libgcc/../gcc/config/arm/lib1funcs.asm:1266: undefined reference to `raise'
make: *** [nsboot] Error 1

網路上有幾篇文章有相關類似的說明,大致上應該是boot 通常都是 non GNU/Linux application,而ARM EABI" toolchains 卻是 GNU/Linux,所以導致相衝的問題。
解決方案:

  1. 直接修改原始檔,將 raise() 直接回傳 zero. (只是不清楚要改哪,所以跳過)
  2. 直接使用原廠提供的glibc 產生的 nsboot.bin檔。不再產生uClibc 的nsboot.bin。 

 

build uClibc toolchains using Buildroot for GM812x (補2/1)

參考來源:

  • uClibc Web site : http://uclibc.org/toolchains.html
  • http://linux.derkeiler.com/Mailing-Lists/Kernel/2009-03/msg04460.html
  • http://www.crifan.com/make_uimage_error_conflicting_types_for_getline_stdio_h_previously_declaration_was_here/
  • https://bugzilla.redhat.com/show_bug.cgi?id=493941


步驟:
1. 在uClibc官網中(http://uclibc.org/toolchains.html)有簡易的說明如何此用 Buildroot 來產生 uClibc 的 toolchains.
2. 下載 Buildroot,然後修改設定檔:(run 'make menuconfig')

  • Target Architecture (ARM (little endian))
  • Target Architecture Variant (arm926t)
  • Target ABI (EABI)
  • Toolchain  --->
    • Kernel Headers (Linux 2.6 (manually specified version))
    • (2.6.28) linux version 
  • Filesystem images ==> 全部取消
3. run 'make'

問題修正:

  • 當在build 到 output/toolchain/linux-2.6.28 kernal時會出現以下的錯誤。


   scripts/unifdef.c:209: error: conflicting types for 'getline'
   /usr/include/stdio.h:653: note: previous declaration of 'getline' was here
   make[2]: *** [scripts/unifdef] Error 1
   make[1]: *** [__headers] Error 2
   make[1]: Leaving directory `/home/ken/WrkSrc/test1/Grain/grain/test_tmp/buildroot-      2012.11.1/output/toolchain/linux-2.6.28'
  make: *** [/home/ken/WrkSrc/test1/Grain/grain/test_tmp/buildroot-2012.11.1/output/toolchain/linux/.configured] Error 2

        在網路上搜尋到有兩種解決方式(請看參考來源),一種是直接修改 "scripts/unifdef.c",將"getline"函式直接修改成其他的名字(例:parseline);另外一種是在 CFLAGS 中加入 "-D_POSIX_C_SOURCE=200112L"。
※ 若是採用第一種方式,每次當 buildroot run 'make clean' 後,就必須再修改一次。(至於第二種不知道加在哪,所以沒試)
        此外網路上也有說明這問題已經在2009/04已經修正。


  • 安裝額外的lib (prec)時,發生需要支援 large file support.
    => 修改 buuild 設定檔。
    • Toolchain  --->
      •  [*] Enable large file (files > 2 GB) support
 

2013年1月31日 星期四

GM812x cramfs測試步驟


PS: 已經有一個cramfs image file大小約3M

1. 以目前的ramdiskfs模式下,使用chroot 測試cramfs:
  1.1 變更kernal MTD table(mtdblock5),切割一塊3M的partition。
  1.2 enable kernal config to support cramfs.
  1.3 更新FW,讓kernal能support cramfs
  1.4 上傳測試用cramfs,將其寫入mtdblock5:
      dd if=/upload/roo.img of=/dev/mtdblock5
  1.5 切換rootfs:
     mount -t cramfs /dev/mrdblock5 /mnt/mtd
    chroot /mnt/mtd
2. 在kernal boot command 直接開啟cramfs
  2.1 disable kernal config to dissupport ramdiskfs
  2.2 修改kernal boot command,加入cramfs 開機指令:
    ... rootfs=/dev/mtdbloack5 rootfstype=cramfs