Developping on A13

Started by mouha, January 06, 2013, 09:09:34 PM

Previous topic - Next topic

mouha

Hi,

I have installed the cross compilation toolchain as explained in :
http://www.agilart.com/blog/debugging-on-embedded-using-opensource-tools-part-1

(which is "arm-linux-gnueabi" not  "..unknown.." by the way. )

From there I compiled the HelloWorld-Linuxino program, which consist simply of :

include <iostream>
using namespace std;

int main()
{
cout << "Hello World" << endl; // prints !!!Hello World!!!
return 0;
}


It compiles with no error nor warning. But when I try to execute it on the A13 board :

"syntax error word unexpected (expecting ) )"

I have checked that it was compiled properly by doing a "file HelloWorld-Linuxino" this gives :

QuoteHello-olinuxino: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, not stripped

What lead to the syntax error message ?

PS : I've seen there is already another thread about quite the same subject but here this is different as the app doesn't complains about a missing library.



mouha

#1
As a confirmation :


* I've created a symbolic link to "/lib/arm-linux-gnueabihf/" where the lib is -> fails
* I've copied my ld-linux.so.3 in the current dir where I execute my Hello...  -> also fails
* I've also created a new C project from Eclipse template  (previous try was from C++) : same results.


my tip
:

instead of opening exe file in a text editor as proposed in Olimex Wiki = to detect missing libs, maybe it would be easier by using:


readelf -a Hellolinuxino | grep "Requesting"


that will return something like :

Quote[Requesting program interpreter: /lib/ld-linux.so.3]

if something missing

luckyLuc

Try to compile your source with -static ?


mouha

#3
not sure:

ld-linux.so.3 (which is a symbolic link to ld-2.11.2.so) is a shared library which actually an executable in a special format with entry points specified. It does not have all the information needed to link statically.

You can't statically link shared library (or dynamically link static). This means that the satic version have to be recompiled from sources ?

mouha

EDIT :

the library in cause is not "ld-linux.so.3" but libc.so.6 as I've used readelf instead of arm-gnueabi...readelf.
But the issue is still true as doing same things with that lib won't change anything.

I wonder if using emdebian as such is a solution as the provided Debian image is using

"arm-linux-gnueabi-gcc"

when on PC Emdebian is compiling with

"arm-linux-gnueabihf-gcc"