EmbDev.net

Forum: ARM programming with GCC/GNU tools libc and libstdc++


Author: Mirec Talasek (Guest)
Posted on:

Rate this post
0 useful
not useful
Please in every make file script is -lc or -lstdc++ but i dont have it.
I am using only arm-elf-gcc/g++ on linux.
In my ARM7TDMI i don use any os only my compiled binary.

Please tell me how i compile libc, libm a and libstdc++ (without any
parts which need kernel (syscalls , iostreams .....))

THX

Author: Martin Thomas (Guest)
Posted on:

Rate this post
0 useful
not useful
Mirec Talasek wrote:
> Please in every make file script is -lc or -lstdc++ but i dont have it.
> I am using only arm-elf-gcc/g++ on linux.
> In my ARM7TDMI i don use any os only my compiled binary.
>
> Please tell me how i compile libc, libm a and libstdc++ (without any
> parts which need kernel (syscalls , iostreams .....))

There are several choices for an "embedded" libc/libm. The libc used in
most precompiled free GNU arm-elf-toolchains is the newlib but there are
others available too (i.e. dietlibc, uclibc). Beside the technical
aspects check the licenses for the different libs. There should be
several tutorials available in the net which explain how to build a
cross-compiler with gcc and newlib.

libstdc++ ist part of the gcc-distribution and should be build
"automaticly" when enabling C++-support. (Maybe it does not build when
there is no libc for the target so try to build a "cross"-libc first.)

Martin Thomas

Author: Clifford Slocombe (clifford)
Posted on:

Rate this post
0 useful
not useful
Mirec Talasek wrote:
> Please in every make file script is -lc or -lstdc++ but i dont have it.
> I am using only arm-elf-gcc/g++ on linux.
> In my ARM7TDMI i don use any os only my compiled binary.
>
> Please tell me how i compile libc, libm a and libstdc++ (without any
> parts which need kernel (syscalls , iostreams .....))
>
> THX

The GNU C library assumes a Linux/Unix-like subsystem, and is not really
suited to OS-less or non-Posix RTOS based embedded systems. The most
common solution is to use the Newlib C library (which incidentally has
fewer licence restrictions that GPL code).

GNU libstdc++ will work hapilly with Newlib as its low-level runtime
support.

The libraries are normally build with the compiler, so it is surprising
that you do not have them. Last time I built GCC for ARM I used the
instructions here: http://ecos.sourceware.org/build-toolchain.html
(don't worry about the "for eCOS" references, the critical thing is that
it is not "for Linux". A similar pagem but which is specific to GCC
4.1.1 is at
http://www.jstuber.net/lego/nxt-programming/arm-to... (oddly,
these instructions have a separate build stage for Newlib, despite it
being built with GCC - the eCOS instructions simply copy the library to
the required location. It is possible to build Newlib separately, but
the GCC configure script seems to deal with creating all the necessary
architecture variations for Thumb, FPE, etc. Which I have never been
able to get the Newlib script to do (perhaps because I know very little
about all that configure script stuff!).

With Newlib, it is your responsibility to provide the necessary
low-level glue by implementing some or all of the syscall routines. The
examples provided assume the existance of one of the supported ROM
monitor interfaces, which may not be suitable in your case.

Clifford

Author: Mirec Talasek (Guest)
Posted on:

Rate this post
0 useful
not useful
Martin Thomas wrote:
> Mirec Talasek wrote:
>> Please in every make file script is -lc or -lstdc++ but i dont have it.
>> I am using only arm-elf-gcc/g++ on linux.
>> In my ARM7TDMI i don use any os only my compiled binary.
>>


than you very much

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.