我从来没有交叉编译不同的cpu架构,不知道如何完全识别我需要做的事情.我试图使用uClibc,因为它似乎在系统的其余部分使用,但我不知道如何配置buildroot的调制解调器环境.我做了一个best guess的配置应该基于以下proc的信息,但是由于一个简单的C应用程序只返回0编译的C应用程序无法正常运行.
# cat /proc/version linux version 2.4.17_mvl21-malta-mips_fp_le ([email protected]) (gcc version 2.95.3 20010315 (release/MontaVista)) #1 Thu Apr 21 18:04:37 PDT 2005# cat /proc/cpuinfo processor : 0cpu model : MIPS 4KEc V4.8BogoMIPS : 149.91wait instruction : nomicrosecond timers : yesextra interrupt vector : yesharDWare watchpoint : yesVCED exceptions : not availableVCEI exceptions : not available解决方法 你是对的,你需要一个正确的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做到这一点.
总结以上是内存溢出为你收集整理的linux – 从x86交叉编译MIPS路由器全部内容,希望文章能够帮你解决linux – 从x86交叉编译MIPS路由器所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)