# Forum: ARM programming with GCC/GNU tools reentrant syscalls WinARM 200606 and arm-elf vs arm-linux!?

 Author: Bagera H. (bagera) Posted on: 2008-07-31 13:40

Rate this post
 0 ▲ useful ▼ not useful
Hi,

I currently use an arm toolchain that requires a linux host
(arm-920tsoftfloat-linux-gnueabi). When I found WinArm 200606, I was
hoping that it would enable me to compile my apps on Windows hosts as
well. The gcc version of arm-elf matches the one I use on linux, and it
also uses the gnu eabi.

However, when compiling with WinArm 200606 I quickly found that I needed
to implement some reentrant syscalls. I want to use the syscalls from
Linux. What should I do? Is this why the toolchain is named arm-elf and
not arm-linux? What's the difference anyway? Linux uses the Executable
and Linkable Format, does it not?

I guess my final question is if I should pick a different cross-compiler
than WinARM? Can I make my arm-elf compiled app work in an linux
environment that was built with an arm-920tsoftfloat-linux-gnueabi
cross-compiler? I mean when the gcc version is identical and so on. I
guess the glibc versions have to be identical as well, else it will
break the abi (I'm compiling c++ applications). Newlib is similar to
glibc in my arm-linux toolchain, right? But the versioning is very
different.. How come?

/Bagera

instructions in the ReadMe file. That is unzip and some directories to
PATH. When I try to compile a simple hello world application, consisting
of just one cpp file with a main function, I get lots of undefined
references:

I have also tried the arm-elf-gcc compiler with the very same result.

 Author: Clifford S. (clifford) Posted on: 2008-08-01 15:04

Rate this post
 0 ▲ useful ▼ not useful
Bagera Hvaskjera wrote:

> I currently use an arm toolchain that requires a linux host
> (arm-920tsoftfloat-linux-gnueabi). When I found WinArm 200606, I was
> hoping that it would enable me to compile my apps on Windows hosts as
> well. The gcc version of arm-elf matches the one I use on linux, and it
> also uses the gnu eabi.

This seems backwards. The Newlib library is designed for OS-less
systems, or at least systems with a minimal kernel without existing I/O
and memory management. If you use Newlib on Linus, you would implement
them using Linux calls. But normally on Linus you would us a Linus
targeted compiler that uses GNU libc and would have the library already
hooked into the low level OS services.

> However, when compiling with WinArm 200606 I quickly found that I needed
> to implement some reentrant syscalls. I want to use the syscalls from
> Linux. What should I do? Is this why the toolchain is named arm-elf and
> not arm-linux? What's the difference anyway? Linux uses the Executable
> and Linkable Format, does it not?
You don't normally call the syscalls directly, the library uses them to
hook into the platform specific services (or to actually implement the
services on a barebones system).

The reentrant calls primarily merely give you a per-thread copy of the
errno variable, so that one thread's library call does not override the
errno of another. There is not much magic in that.

>
> I guess my final question is if I should pick a different cross-compiler
> than WinARM?
Yes, you need a Linux targeted compiler. Get one here:
http://www.codesourcery.com/gnu_toolchains/arm/por...
either Windows or Linux hosted.

> But the versioning is very
> different.. How come?
>
Because it is a different project with different release schedules.
That's a bit like asking why OpenOffice.org is not at the same version
number as MS Office! They do the same thing, but they are not the same
thing.

Clifford

• $formula (LaTeX syntax)$