0
votes

I am trying to build a cross compiler for a MIPS system (a router) and am having some trouble. So far I have tried builtroot and crosstool-ng with no luck so I want to make sure I am doing this right.

My test code (hello.c) compiled successfully, but fails on the target with:

Syntax error: "(" unexpected

System info -->

cat version
Linux version 2.6.31 (june.lin@dnixm-compiler3) (gcc version 4.3.3 (GCC) ) #1 The Dec 18 16:24:21

cat cpuinfo
system type:       QCA953x
processor:         0
CPU model:         MIPS 24Kc V7.4
BogoMIPS:          365.56
ASE's implemented: mips16

From going through the lib folder, I can see uClibc-0.9.30.1.

Buildroot cannot find the linux 2.6.31 and the earliest option is 3.2.93. Same goes with GCC.

There are similar questions on here, but no resolution posted or they don't match my system. Has anyone succeeded? Or have any advice on how to approach this?

1

1 Answers

0
votes

It looks like the executable format is not supported by the kernel, and that the kernel interprets it as a shell script instead of an executable. You can try to find out the correct executable format by copying an executable (e.g. /bin/ls) off the system and running "file" on it.

Perhaps you have chosen the wrong endianness?