Mar 29, 2008

交叉編譯usbutils

先編譯 libusb


這是放在arm-linux上,給usbutils使用的library
(libusb-0.1.12\) $ ./configure --host=arm-linux --build=i686-linux --enable-shared \


--prefix=/usr/local/arm/3.4.1/arm-linux


(libusb-0.1.12\) $ make


(libusb-0.1.12\) # make install


主角usbutils


(usbutils-0.73\) $ CC=arm-linux-gcc ./configure --host=arm-linux --build=i686-linux\


--prefix=/home2/fyodor/FileSystem/rootfs/usr

(usbutils-0.73\)  $ make


錯誤:undefined reference to `rpl_malloc'


修改config.h,把 #define malloc rpl_malloc 註解



(usbutils-0.73\)  # make install


 


動態編譯,所以查看需要的library


$ arm-linux-readelf -d ../sbin/lsusb



Dynamic segment at offset 0xf214 contains 21 entries:
  Tag        Type                         Name/Value
0x00000001 (NEEDED)                     Shared library: [libusb-0.1.so.4]
0x00000001 (NEEDED)                     Shared library: [libc.so.6]
0x0000000c (INIT)                       0x8c94
0x0000000d (FINI)                       0x11230
0x00000004 (HASH)                       0x8128
0x00000005 (STRTAB)                     0x8778
0x00000006 (SYMTAB)                     0x8348
0x0000000a (STRSZ)                      683 (bytes)
0x0000000b (SYMENT)                     16 (bytes)
0x00000015 (DEBUG)                      0x0
0x00000003 (PLTGOT)                     0x1f2f8
0x00000002 (PLTRELSZ)                   376 (bytes)
0x00000014 (PLTREL)                     REL
0x00000017 (JMPREL)                     0x8b1c
0x00000011 (REL)                        0x8aec
0x00000012 (RELSZ)                      48 (bytes)
0x00000013 (RELENT)                     8 (bytes)
0x6ffffffe (VERNEED)                    0x8aac
0x6fffffff (VERNEEDNUM)                 1
0x6ffffff0 (VERSYM)                     0x8a24
0x00000000 (NULL)                       0x0



libc之前就已經包進去了


libusb編譯的時候,prefix在 /usr/local/arm/3.4.1/arm-linux


所以libusb-0.1.so.4會在/usr/local/arm/3.4.1/arm-linux/lib


注意一下,其實libusb-0.1.so.4是一個指向libusb-0.1.so.4.4.4 的soft link


把它複製到rootfs/usr/lib,依樣畫葫蘆做個soft link


接著就是重包rootfs.jffs2


 


 


 


執行的時候還是有問題.............悶

0 comments:

Post a Comment