Atmel website | ARM Community | AVR freaks | Technical Support
Banner
 FAQ •  Search •  Register •  Login 

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: "Hello world" does not run changing filesystem At9
PostPosted: Thu Jan 24, 2008 11:02 am 
Offline

Joined: Mon Nov 19, 2007 6:05 pm
Posts: 7
Hi to all,
I am developing some sample applications using Linux on AT91SAM9260EK board.
My system is based on :
- kernel = 2.6.23.11 generated using CodeSourcery toolchain based on gcc 4.2.0 on a Linux Host
- filesystem = the Angstrom filesystem I have got from Linux4Sam

The application is developed using a Windows host running CodeSourcery Cross-Toolchain based on gcc 4.2.1.

With this configuration I can compile and link a simple "hello World" application, download it on the target and run it with no problems. I do not need to set the "-static" linker option to be able to run the application.

If I change the filesystem with a custom filesystem generated by buildroot (with toolchain set to 4.2.1) what happens is that I am no more able to run the "hello world" application if I do not set the "-static" linker option. If the application is linked without this option the target shell gives me this error message : ->sh : "Application" not found.

What is happening ? can anybody help me ? Linking as static gives obviously too large file size ! Some library incompatibility ?

Best regards

Antonio


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 25, 2008 10:12 pm 
Offline

Joined: Thu Apr 19, 2007 10:15 pm
Posts: 204
Location: USA
Hi there

You've done a good job in identifying the underlying issues. However you seem to be using the static switch without learning what it does and why. You should do a web search on "static linking", "dynamic linking", or compilers and linking with libraries.

If you want to actually see the dynamic (or runtime) linking (and all the system calls an application makes), use the 'strace' command.

Your choices for a (small) root file system are:
1. static link the app with uClibc, and have no libs in the rfs
2. or if there are several apps in the embedded product, install uClibc in the rfs and dynamic link your apps.

Regards


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jan 27, 2008 11:57 am 
Offline
User avatar

Joined: Wed May 12, 2004 6:59 pm
Posts: 161
Location: Bergamo, Italia
Antonio,
when you build a linux application that uses shared libraries you must ensure that libraries you are using on host side are consistent and installed on target side too.
The fastest solution would be to use a Linux embedded distribution providing you coherent tools and libraries.

In order to understand that, you can examine the following command output:
$ ldd ./yourapp
Or as blue_z said:
$ strace ./yourapp

best regards

_________________
Marco Cavallini
Koan s.a.s. - Bergamo - ITALIA
Embedded and Real-Time Software Engineering
- Atmel Third Party Consultant
Tel. +39-(0)35-255.235 - Fax +39-178-223.9748
http://www.KoanSoftware.com | http://www.KaeilOS.com


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: