3
votes

I am trying to compile a Hello World for ARM-1136J-S processor. When I compile the C source using CodeSourcery arm-none-linux-gnueabi-gcc (2008q3 edition), it executes successfully on the ARM, but when I compile same code using arm-linux-gnueabi-gcc (installed through apt-get in Ubuntu 12.01) it gives the following error:

./helloworld: line 1: syntax error: unexpected word (expecting ")")

readelf of both the executables show that the binary compiled using Ubuntu toolchain has following extra attributes:

Tag_CPU_unaligned_access: v6
Tag_DIV_use: Not allowed

How can I make it run using Ubuntu toolchain? Can anyone give some hint on that? Thanks

2
What's the actual problem? Those just look like informative tags (use ARMv6 unaligned access patterns, and don't use hardware divide), both of which make perfect sense to be set for an ARM-11 (as they are ARMv6 architecture cores).solidpixel
This seems very unusual, but there isn't enough information here in the question. Please explain step-by-step what you have done to cause this errorCharles Baylis
The error was gone once I compiled the app with Code Sourcery 2014q version.Arshan

2 Answers

1
votes
./helloworld: line 1: syntax error: unexpected word (expecting ")")

This doesn't look like a native code error at all - it looks like a script error. Are you sure "helloworld" is actually your compiled binary. Running compiled C code binaries does not give syntax errors ...

1
votes

Check that your kernel has support for THUMB binaries: zcat /proc/config.gz |grep THUMB

Try running 'readelf' on your executable. If the entry point address is an odd number (indicating THUMB or mixed ARM/Thumb) and your kernel lacks THUMB executable support, your binary will be rejected by the kernel, and will be attempted to be run as a shell script.