mips-linux-gnu-gcc: cannot execute binary file ,请指点迷津

thomas的动力火车 2012-11-15 11:57:56
完全参考 http://developer.mips.com/tools/compilers/open-source-toolchain-linux/
指导来操作,将mips-linux-gnu-gcc 的工具链解压在 /opt目录下:
linux-thomas:/opt/mips_linux_toolchain # ls
README bin etc include info lib lib64 libexec man mips-linux-gnu share sysroot
linux-thomas:/opt/mips_linux_toolchain

以root用户登录系统
运行下面可执行程序
linux-thomas:/opt/mips_linux_toolchain/bin # ./mips-linux-gnu-gcc
-bash: ./mips-linux-gnu-gcc: cannot execute binary file
linux-thomas:/opt/mips_linux_toolchain/bin#
查看其属性如下:
linux-thomas:/opt/mips_linux_toolchain/bin # ll
total 111936
-rwxr-xr-x 1 1000 1000 3817295 Oct 31 2011 mips-linux-gnu-addr2line
-rwxr-xr-x 2 1000 1000 3972454 Oct 31 2011 mips-linux-gnu-ar
-rwxr-xr-x 2 1000 1000 5684844 Oct 31 2011 mips-linux-gnu-as
-rwxr-xr-x 2 1000 1000 618720 Oct 31 2011 mips-linux-gnu-c++
-rwxr-xr-x 1 1000 1000 3790656 Oct 31 2011 mips-linux-gnu-c++filt
-rwxr-xr-x 1 1000 1000 613717 Oct 31 2011 mips-linux-gnu-cpp
-rwxr-xr-x 1 1000 1000 76513 Oct 31 2011 mips-linux-gnu-elfedit
-rwxr-xr-x 2 1000 1000 618720 Oct 31 2011 mips-linux-gnu-g++
-rwxr-xr-x 2 1000 1000 611790 Oct 31 2011 mips-linux-gnu-gcc
-rwxr-xr-x 2 1000 1000 611790 Oct 31 2011 mips-linux-gnu-gcc-4.4.6
-rwxr-xr-x 1 1000 1000 16368 Oct 31 2011 mips-linux-gnu-gccbug
-rwxr-xr-x 1
...全文
615 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
samqsu_amba 2012-11-17
  • 打赏
  • 举报
回复
引用 4 楼 kuangsong 的回复:
我的机器是x86 pc,linux运行在虚拟机上.而我在公司里的linux刀片服务器上(x86 cpu)则是不会出上面那种问题的.
那你的虚拟机需要安装和你公司一样的linux版本即可。
  • 打赏
  • 举报
回复
我的机器是x86 pc,linux运行在虚拟机上.而我在公司里的linux刀片服务器上(x86 cpu)则是不会出上面那种问题的.
samqsu_amba 2012-11-17
  • 打赏
  • 举报
回复
mips-linux-gnu-gcc这个是mips cpu 跑的执行文件,你的cpu是mips的吗?要cpu对应的才可以。
帅得不敢出门 2012-11-16
  • 打赏
  • 举报
回复
看来你的交叉编译器有问题.
deep_pro 2012-11-16
  • 打赏
  • 举报
回复
file /opt/mips_linux_toolchain/bin/mips-linux-gnu-gcc

23,115

社区成员

发帖
与我相关
我的任务
社区描述
Linux/Unix社区 应用程序开发区
社区管理员
  • 应用程序开发区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧