主题 : transmission 交叉编译后在开发板上无法运行 复制链接 | 浏览器收藏 | 打印
级别: 新手上路
UID: 5603
精华: 0
发帖: 15
金钱: 150 两
威望: 150 点
综合积分: 30 分
注册时间: 2009-04-30
最后登录: 2011-05-01
楼主  发表于: 2009-05-09 16:46

 transmission 交叉编译后在开发板上无法运行

我用scratchbox交叉编译了一个transmissioncli文件,我直接用U盘拷贝到开发板上运行:

复制代码
  1. #./transmissioncli
  2. ~/bin/sh: ./transmissioncli:not found


请问这是怎么回事呢?
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
1楼  发表于: 2009-05-09 21:53
文件是否加了可执行权限?
"If you have an apple and I have an apple and we exchange apples, then you and I will
still each have one apple. But if you have an idea and I have an idea and we exchange
these ideas, then each of us will have two ideas."
级别: 新手上路
UID: 5603
精华: 0
发帖: 15
金钱: 150 两
威望: 150 点
综合积分: 30 分
注册时间: 2009-04-30
最后登录: 2011-05-01
2楼  发表于: 2009-05-10 09:15
-rwxrwxrwx有可执行的权限,网上有人说可能是busybox的问题,要将busybox中的静态编译去掉,改为动态编译。但是我不知道要如何将busybox中的静态编译去掉,改为动态编译。编译好如何替换现在的busybox?
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
3楼  发表于: 2009-05-10 09:19
这个和busybox是动态还是静态没关系,它只是通过busybox的shell加载。你把编译出来的执行档贴上来看看吧
"If you have an apple and I have an apple and we exchange apples, then you and I will
still each have one apple. But if you have an idea and I have an idea and we exchange
these ideas, then each of us will have two ideas."
级别: 新手上路
UID: 5603
精华: 0
发帖: 15
金钱: 150 两
威望: 150 点
综合积分: 30 分
注册时间: 2009-04-30
最后登录: 2011-05-01
4楼  发表于: 2009-05-10 20:44
好的,这是我编译的,第一个是make的时候生成的,第二个是make install的时候生成的
附件: cli.tar.gz (713 K) 下载次数:10
附件: transmissioncli.tar.gz (685 K) 下载次数:11
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
5楼  发表于: 2009-05-10 21:45
这是你编译出来的transmissioncli运行所必须的共享库,你必须确保开发板的文件系统里有这些库,并且可以被动态链接到:

alex@alex-desktop:~/project3/qq2440/utils/tmp$ readelf -a transmissioncli  |grep NEEDED
0x00000001 (NEEDED)                     Shared library: [libnsl.so.0]
0x00000001 (NEEDED)                     Shared library: [librt.so.0]
0x00000001 (NEEDED)                     Shared library: [libresolv.so.0]
0x00000001 (NEEDED)                     Shared library: [libcurl.so.4]
0x00000001 (NEEDED)                     Shared library: [libssl.so.0.9.8]
0x00000001 (NEEDED)                     Shared library: [libcrypto.so.0.9.8]
0x00000001 (NEEDED)                     Shared library: [libdl.so.0]
0x00000001 (NEEDED)                     Shared library: [libm.so.0]
0x00000001 (NEEDED)                     Shared library: [libgcc_s.so.1]
0x00000001 (NEEDED)                     Shared library: [libpthread.so.0]
0x00000001 (NEEDED)                     Shared library: [libc.so.0]

关于共享库的链接,你可以在调用执行档之前设置环境变量LD_DEBUG=files来看输出的信息,帮助诊断问题。有关这方面的信息,可以参考http://www.linux.org/docs/ldp/howto/Program-Library-HOWTO/shared-libraries.html
"If you have an apple and I have an apple and we exchange apples, then you and I will
still each have one apple. But if you have an idea and I have an idea and we exchange
these ideas, then each of us will have two ideas."
级别: 新手上路
UID: 5603
精华: 0
发帖: 15
金钱: 150 两
威望: 150 点
综合积分: 30 分
注册时间: 2009-04-30
最后登录: 2011-05-01
6楼  发表于: 2009-05-10 22:19
谢谢, 我再试试
级别: 新手上路
UID: 5603
精华: 0
发帖: 15
金钱: 150 两
威望: 150 点
综合积分: 30 分
注册时间: 2009-04-30
最后登录: 2011-05-01
7楼  发表于: 2009-05-10 22:55
我把附件里面的lib全部拷贝到了开发板上面的/lib/里面,然后export DL_DEBUG=files, 结果执行./transmissioncli后没有输出debug信息(我输出ls的时候是有的),执行结果还是

   #./transmissioncli
   ~/bin/sh: ./transmissioncli:not found
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
8楼  发表于: 2009-05-16 10:09
你编译的transmissioncli似乎不是ARM EABI的,无法在2.6.29内核的系统上运行。

alex@alex-desktop:~/project3/qq2440/utils/tmp$ /usr/local/arm/4.3.2/bin/arm-none-linux-gnueabi-readelf -h transmissioncli           ELF Header:
  Magic:   7f 45 4c 46 01 01 01 61 00 00 00 00 00 00 00 00
  Class:                             ELF32
  Data:                              2's complement, little endian
  Version:                           1 (current)
  OS/ABI:                            ARM
  ABI Version:                       0
  Type:                              EXEC (Executable file)
  Machine:                           ARM
  Version:                           0x1
  Entry point address:               0xaaac
  Start of program headers:          52 (bytes into file)
  Start of section headers:          1546064 (bytes into file)
  Flags:                             0x2, has entry point, GNU EABI
  Size of this header:               52 (bytes)
  Size of program headers:           32 (bytes)
  Number of program headers:         6
  Size of section headers:           40 (bytes)
  Number of section headers:         36
  Section header string table index: 33
alex@alex-desktop:~/project3/qq2440/utils/tmp$
alex@alex-desktop:~/project3/qq2440/utils/tmp$
alex@alex-desktop:~/project3/qq2440/utils/tmp$ /usr/local/arm/4.3.2/bin/arm-none-linux-gnueabi-readelf -h ../../rootfs/root_qtopia/bin/busybox
ELF Header:
  Magic:   7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00
  Class:                             ELF32
  Data:                              2's complement, little endian
  Version:                           1 (current)
  OS/ABI:                            UNIX - System V
  ABI Version:                       0
  Type:                              EXEC (Executable file)
  Machine:                           ARM
  Version:                           0x1
  Entry point address:               0x12658
  Start of program headers:          52 (bytes into file)
  Start of section headers:          436452 (bytes into file)
  Flags:                             0x4000002, has entry point, Version4 EABI
  Size of this header:               52 (bytes)
  Size of program headers:           32 (bytes)
  Number of program headers:         6
  Size of section headers:           40 (bytes)
  Number of section headers:         25
  Section header string table index: 24
"If you have an apple and I have an apple and we exchange apples, then you and I will
still each have one apple. But if you have an idea and I have an idea and we exchange
these ideas, then each of us will have two ideas."
级别: 新手上路
UID: 1222
精华: 0
发帖: 49
金钱: 490 两
威望: 391 点
综合积分: 98 分
注册时间: 2008-08-04
最后登录: 2010-11-24
9楼  发表于: 2009-05-25 13:42
那怎么解决?!