linux上交叉编译x86,linux – 从x86交叉编译MIPS路由器

你是对的,你需要一个正确的mips工具链来交叉编译你的应用程序,而

Buildroot可以做到这一点.但是您可能需要调整buildroot的菜单选项.

根据文件的输出,您的选项可能会更改.在我的系统上,二进制应用程序通知以下内容:

ELF 32位MSB可执行文件,MIPS,MIPS32 rel2版本1(SYSV)

这些是我为Buildroot的menuconfig启用的选项:

Target Architecture (mips) --->

Target Architecture Variant (mips 32r2) --->

Target ABI (o32) --->

Target options --->

Build options --->

(/opt/cross-mips-buildroot) Toolchain and header file location?

Toolchain --->

Toolchain type (Buildroot toolchain) --->

Kernel Headers (Linux 2.6.34.x kernel headers) --->

uClibc C library Version (uClibc 0.9.31.x) --->

[*] Build/install a shared libgcc?

[*] Enable compiler tls support

[*] Build gdb debugger for the Target

[*] Build gdb server for the Target

[*] Build gdb for the Host

GDB debugger Version (gdb 6.8) --->

[*] Enable large file (files > 2 GB) support?

[*] Enable WCHAR support

[*] Use software floating point by default

[*] Enable stack protection support

[*] Build/install c++ compiler and libstdc++?

[*] Include target utils in cross toolchain

Package Selection for the target --->

[*] BusyBox

[*] Run BusyBox's own full installation

Libraries --->

Networking --->

[*] libcurl

Text and terminal handling --->

[*] icu

-*- ncurses

Target filesystem options --->

Bootloaders --->

Kernel --->

工具链本身安装在/ opt / cross-mips-buildroot.你可以在/ opt / cross-mips-buildroot /usr/bin /

尝试编译一个简单的hello world应用程序,看看是否可以在mips系统中运行它.

注意:此配置不会构建C编译器.如果需要,您可以grep LIBSTDCPP .config并检查是否启用,并将其更改为您的喜好.然后让menuconfig做到这一点.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值