libc and libstdc++

Guest #1171653
Rate this post
• ▲ 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
Guest #1171654
Rate this post
• ▲ 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
#1171655
Rate this post
• ▲ 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-toolchain.html (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
Guest #1171656
Rate this post
• ▲ 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

Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.

Formatting
  • [c]C-Code[/c]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]
  • [[Title]] – link to an article
  • Link to another post: right-click its post ID (#8078628), copy the address, paste it into the text

More about formatting

Post long source code as an attachment, not in the text.

Already registered? Log in

Not shown to anyone. We send you a link; your post appears once you confirm it there.

By submitting you create a free account and accept the terms of use.