Eu comprei uma câmera P2P chinesa e não havia fluxo MJPEG, então eu queria compilar mjpg-streamer
para ela. Aqui está a informação da minha CPU:
# cat /proc/cpuinfo
system type : Ralink SoC
processor : 0
cpu model : MIPS 24K V4.12
BogoMIPS : 239.61
wait instruction : yes
microsecond timers : yes
tlb_entries : 32
extra interrupt vector : yes
hardware watchpoint : yes
ASEs implemented : mips16 dsp
VCED exceptions : not available
VCEI exceptions : not available
# uname -a
Linux (none) 2.6.21 #878 Tue Oct 29 09:53:25 CST 2013 mips unknown
Eu tentei usar o Sourcery CodeBench para MIPS GNU / Linux (versão mais recente) e tentou compilar um exemplo simples de "Hello world" com este comando:
$ mips-linux-gnu-gcc -Wall hello.c -o hello
Após a execução, recebi a seguinte mensagem:
# ./hello
./hello: line 1: ELF@04: not found
./hello: line 2: syntax error: "(" unexpected
Em seguida, tentei recompilar com este comando:
$ mips-linux-gnu-gcc -mips16 -Wall hello.c -o hello
Mas o resultado foi:
# ./hello
./hello: line 1: syntax error: "(" unexpected
- Estou usando o compilador incorreto? Em caso afirmativo, qual é o correto?
- Estou perdendo ou usando os argumentos errados?
EDITAR:
$readelf -h HKIPC #Extracted file from the device
ELF Header:
Magic: 7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00
Class: ELF32
Data: 2's complement, little endian
Version: 1 (current)
OS/ABI: UNIX - System V
ABI Version: 0
Type: EXEC (Executable file)
Machine: MIPS R3000
Version: 0x1
Entry point address: 0x406420
Start of program headers: 52 (bytes into file)
Start of section headers: 643764 (bytes into file)
Flags: 0x10001007, noreorder, pic, cpic, o32, mips2
Size of this header: 52 (bytes)
Size of program headers: 32 (bytes)
Number of program headers: 6
Size of section headers: 40 (bytes)
Number of section headers: 25
Section header string table index: 24
$file HKIPC
HKIPC: ELF 32-bit LSB executable, MIPS, MIPS-II version 1 (SYSV), dynamically linked (uses shared libs), stripped
-
$readelf -h hello #Compiled with mips-linux-gnu-gcc -mips2 -EL -mabi=32 hello.c -o hello
ELF Header:
Magic: 7f 45 4c 46 01 01 01 00 01 00 00 00 00 00 00 00
Class: ELF32
Data: 2's complement, little endian
Version: 1 (current)
OS/ABI: UNIX - System V
ABI Version: 1
Type: EXEC (Executable file)
Machine: MIPS R3000
Version: 0x1
Entry point address: 0x400430
Start of program headers: 52 (bytes into file)
Start of section headers: 2732 (bytes into file)
Flags: 0x70001005, noreorder, cpic, o32, mips32r2
Size of this header: 52 (bytes)
Size of program headers: 32 (bytes)
Number of program headers: 8
Size of section headers: 40 (bytes)
Number of section headers: 34
Section header string table index: 31
$file hello
hello: ELF 32-bit LSB executable, MIPS, MIPS32 rel2 version 1, dynamically linked (uses shared libs), with unknown capability 0xf41 = 0x756e6700, with unknown capability 0x70100 = 0x1040000, not stripped