EmbDev.net

Forum: ARM programming with GCC/GNU tools Libraries


von Harold R. (hlritter)


Rate this post
useful
not useful
Hi all,

I have installed Yagarto and imported the sam7s blinky project supplied
by Atmel for the 7S-EK board. I have successfully compiled downloaded
and run the code and am able to use all debug functions.

My question is:

The Atmel demo project supplied its own libraries "libc.a, libgcc.a and
libm.a" does anybody know where these libraries come from? Can anybody
tell me how to use Newlib with Yagarto. I dont want to have to compile
it myself. Is the newlib library available already compiled for arm?
Does Yagarto come with Newlib?

Thanks!
Harold

von Martin T. (mthomas) (Moderator)


Rate this post
useful
not useful
> The Atmel demo project supplied its own libraries "libc.a, libgcc.a and
> libm.a" does anybody know where these libraries come from?
I did not notice this. Could you please give the URL from where you have
downloaded the demo?

> Can anybody
> tell me how to use Newlib with Yagarto. I dont want to have to compile
> it myself. Is the newlib library available already compiled for arm?
> Does Yagarto come with Newlib?
http://www.yagarto.de/ : ...Newlib-1.16.0...

von Harold R. (hlritter)


Rate this post
useful
not useful
> I did not notice this. Could you please give the URL from where you have
> downloaded the demo?

I downloaded so much stuf that I cant remember where I got it from but
the project is called demo_at91sam7_blink_flash and it is authored by
James P Lynch.

I included the lib files I mentioned.

von Harold R. (hlritter)


Rate this post
useful
not useful
Thanks Martin,

So how in the makefile do I tell the linker to use Yagarto's newlib? I
have searched the yagarto directory and have found library files under
diferent directories. Which one is newlib? Are they all collectively
newlib?



Martin Thomas wrote:
>> The Atmel demo project supplied its own libraries "libc.a, libgcc.a and
>> libm.a" does anybody know where these libraries come from?
> I did not notice this. Could you please give the URL from where you have
> downloaded the demo?
>
>> Can anybody
>> tell me how to use Newlib with Yagarto. I dont want to have to compile
>> it myself. Is the newlib library available already compiled for arm?
>> Does Yagarto come with Newlib?
> http://www.yagarto.de/ : ...Newlib-1.16.0...

von Martin T. (mthomas) (Moderator)


Rate this post
useful
not useful
Well, I can not speak for Yagarto, but as far as I know Michael an I use
the same code-base (binutils, gcc, newlib), similar
configuration-options and build-methods.

> So how in the makefile do I tell the linker to use Yagarto's newlib?
Pass -lc and -lm as options for linking. libc.a and libm.a are both
based on the newlib-sources, so you use "Yagarto's newlib". Make sure to
call the linker through the front-end (arm-elf-gcc), do not use direct
calls to the linker (arm-elf-ld). This will avoid problems.

> I  have searched the yagarto directory and have found library files under
> diferent directories.
Yes, it's because the toolchain supports different targets (i.e. ARM,
thumb, little-endian, big-endian). There are special "builds" of libm.a
and libc.a for every target (read about multilibs in the binutils and
gcc documentation).

> Which one is newlib?
All of them are based on the newlib-sources.

> Are they all collectively newlib?
Just different libraries based on the same code. Look into the map-file
and disassembly, the full path to the used libc.a and libm.a should be
shown for every runtime-library function.

Please log in before posting. Registration is free and takes only a minute.
Existing account
Do you have a Google/GoogleMail account? No registration required!
Log in with Google account
No account? Register here.