你是对的,你需要一个正确的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做到这一点.