我已经使用buildroot设置了一个交叉编译器。
目标设备正在运行Linux,并且具有MIPS处理器(这是Dreambox dm500hd)。
Buildroot配置(仅更改的内容):
目标配置
体系结构:MIPS(小端)
体系结构变体:通用MIPS32
工具链配置
[*]启用C ++支持
[*]启用编译器链接时间优化支持
我遵循了设置过程,并且buildroot使编译器成功(mips-linux-gcc和g ++)。
Hello World文件(test-mips.cpp)
#include
using namespace std;
int main() {
cout << "hello world";
return 0;
}
我可以编译Hello World,但是在目标设备上运行它时会引发错误:
dm500hd:~$ ./test-mips
./test-mips: line 1: EL@4▒�P4: not found
./test-mips: line 1: syntax error: unexpected word (expecting ")")
仅当我为little-endian构建编译器时,才会出现奇怪的字符:使用big-endian编译的程序的错误是相同的,但使用空格而不是▒ .。
我尝试了小字节序和大字节序,但问题是相同的。 那么在配置buildroot时我做错了什么吗?
注意 : cat /proc/cpuinfo游戏给我这个结果。 我应该更改架构变体吗?
system type : BCM7413B1 STB platform
processor : 0
cpu model : Brcm4380 V4.4 FPU V0.1
BogoMIPS : 403.45
cpu MHz : 405.010
wait instruction : yes
microsecond timers : yes
tlb_entries : 32
extra interrupt vector : yes
hardware watchpoint : no
ASEs implemented : mips16
shadow register sets : 1
kscratch registers : 0
core : 0
VCED exceptions : not available
VCEI exceptions : not available
processor : 1
cpu model : Brcm4380 V4.4 FPU V0.1
BogoMIPS : 403.45
cpu MHz : 405.010
wait instruction : yes
microsecond timers : yes
tlb_entries : 32
extra interrupt vector : yes
hardware watchpoint : no
ASEs implemented : mips16
shadow register sets : 1
kscratch registers : 0
core : 0
VCED exceptions : not available
VCEI exceptions : not available