EmbDev.net

Forum: ARM programming with GCC/GNU tools Libraries


von Harold R. (hlritter)


Rate this post
0 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
0 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
0 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
0 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
0 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.

Reply

Entering an e-mail address is optional. If you want to receive reply notifications by e-mail, please log in.

Rules — please read before posting

  • Post long source code as attachment, not in the text
  • Posting advertisements is forbidden.

Formatting options

  • [c]C code[/c]
  • [avrasm]AVR assembler code[/avrasm]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]




Bild automatisch verkleinern, falls nötig
Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.