I've set up a cross compiler using buildroot.
The target device is running Linux and it has a MIPS processor (it's a Dreambox dm500hd).
Buildroot configuration (only the things that I've changed):
- Target configuration
- Architecture: MIPS (little endian)
- Architecture variant: Generic MIPS32
- Toolchain configuration
- [*] Enable C++ Support
- [*] Enable compiler link-time-optimization support
I've followed the setup procedure and buildroot makes the compiler successfully (mips-linux-gcc and g++).
Hello World file (test-mips.cpp)
#include <iostream>
using namespace std;
int main() {
cout << "hello world";
return 0;
}
I can compile Hello World, but when I run it on the target device an error is thrown:
dm500hd:~$ ./test-mips
./test-mips: line 1: EL@4▒�P4: not found
./test-mips: line 1: syntax error: unexpected word (expecting ")")
The strange characters appear only if I build the compiler for little-endian: the error for programs compiled with big-endian is the same, but with spaces instead of ▒�
.
I tried both little endian and big endian but the problem is the same. Have I done something wrong while configuring buildroot then?
Note: cat /proc/cpuinfo
game me this result. Should I change the Architecture Variant?
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