Differences between arm-elf and arm-linux

Source: Internet
Author: User
What is the difference between arm-elf and arm-linux-general Linux technology-Linux programming and kernel information? For more information, see the following. The following are the differences between the two cross-compilation environments:

These two cross environments have been used

In the development of ARM-based embedded systems, there are often two types of GCC tool chains that use cross-Compilation: arm-linux-* and arm-elf -*, the difference between the two lies in the use of different C library files. Arm-linux-* uses GNU Glibc, while arm-elf-* generally uses uClibc/uC-libc or the C library newlib. Glibc specially developed for Embedded Systems Using REDHAT. Both uClibc, uC-libc, and newlib are C language library files, but they are used in different fields. Glibc is developed for PCs, uClibc/uC-libc is a small C language library compatible with Glibc APIs and implements some Glibc functions.

For details about uClibc/uC-libc, refer to the following:

There are two libc libraries commonly used with uClinux. uC-libc and uClibc. They are quite different despite their similar names. Here is a quick overview of how they are different.

UC-libc is the original library for uClinux. it was based on sources from the Linux-8086 C library which was part of the ELKs project with m68000 support added by Jeff Dionne and kenth Albanowski. it is a fairly complete libc implementation, however, some of the API's are a little non-standard and quite a few common libc routines are not present. currently it has stable support for m68000, ColdFire and ARM (Non-MMU) ubuntures. it was primary design goal is to be small and light weight. it does try to conform to any standards, although its API tries to be compatible with most libcs, it is not always exactly the same.

The uClinux distribution provides an environment that can compile using either uC-libc or uClibc depending on your needs. for m68000 and Coldfire platforms it is generally better to chose uC-libc as it supports shared libraries and is the most commonly used libc for these CPUs. uClibc also works quite well with almost all platforms supported by the distribution. which libc you choose to use will be decided by your requirements

UClinux has two frequently used libc libraries: uC-libc and uClibc. Although the two names are very similar, there are actually differences. Next we will briefly introduce the differences between the two. UC-libc is the first library developed for uClinux and is supported by Jeff Dionne and kenth Albanowski to port m68000 on Linux-8086 C library source code in the EKLs project. UC-libc is a complete libc implementation, but some APIs are non-standard and some libc standards are not implemented. UC-libc stably supports m68000, ColdFire, and ARM without MMU. Its main design goals are "small" and "light", and try to be consistent with the standard, although its API is compatible with many libc, but it does not seem to be as consistent with all standards as it expects.

UClibc is developed from uC-libc to solve this problem. All its APIs are standard (correct return types, parameters, and so on). It makes up for the libc standard that is not implemented in uC-libc and has now been transplanted to multiple architectures. Generally, it is compatible with glibc as much as possible to make it easier for applications to rewrite with uClibc. UClibc can be used in standard VM linux and uClinux. To simplify the application, it can even be compiled into a shared library on many platforms that support MMU. Erik Anderson has done a lot of work behind uClibc. UClibc supports many series of processors: m68000, Coldfire, ARM, MIPS, v850, x86, i960, iSCSI, SuperH, Alpha, PowerPC, and Hitachi 8. The increasing platform support shows that uClibc can easily adapt to new architectures. The uClinux release provides an environment for you to choose to use uC-libc or uClibc for compilation. For m68000 and Coldfire platforms, it is better to choose uC-libc because it supports shared libraries, which are frequently used by these CPUs. uClibc works well with almost all platforms. Depending on your needs.

Newlib is an open-source C language library for embedded systems. It consists of two libraries: libc and libm. It features lightweight, fast, and can be transplanted to many CPU Structures. Newlib implements many complex functions, including String Support, floating point operations, memory allocation (such as malloc) and I/O flow functions (printf, fprinf ). Among them, libc provides the implementation of the c language library, while libm provides floating point operation support.

When the gcc compiler is compiled for ARM, different configuration options are specified for gcc, And the C language library is different. By default, the gcc compiler uses Glibc, you can also use uClibc/uC-libc (basically compatible with the Glibc API). When you use -- with-newlib, the gcc compiler does not use Glibc. When Glibc is not cross-compiled, you can use -- with-newlib to disable Glibc connection and compile the bootstrap gcc compiler. From the t-linux and t-arm-elf in the config/arm directory under the gcc source directory, we can see that different -- targets also affect gcc connection to the C language library, t-linux (-- target = arm-linux) uses Glibc by default, and-arm-elf (-- target = arm-elf) uses-Dinhibit_libc to disable Glibc connection, in this case, we can use newlib and other C language libraries to compile the GCC tool chain.

Although the GCC tool chain is configured with different C language libraries, these C language libraries can be used to support GCC, and there is no major difference in the processing of core data. Therefore, the differences between arm-linux-* and arm-elf-* are mainly manifested in the implementation of the C language library, such as the implementation of different system calls and different function sets, different ABI \ Startup codes and different system features are slightly different.

There is no absolute standard for the use of arm-linux-* and arm-elf-* To eliminate implementation differences between different libraries. gcc can compile any system. Both arm-linux-* and arm-elf-* Can be used to compile bare metal programs and operating systems, but the system programs are more coordinated when following the descriptions below:

Arm-linux-* For linux-running ARM machines, it depends on the specified C language library Glibc, because Glibc linux is also used, the compilation of arm-linux-* on the ARM machine running linux is more harmonious.

Arm-elf-* is an independent compilation system. It does not rely on the specified C language library Glibc. It can use other C language libraries such as newlib and does not require support from the operating system, when using some lightweight C language libraries designed for embedded systems, it compiles bare metal programs (without programs for large operating systems such as linux), such as monitoring programs, bootloader and so on can make the system program more compact and fast.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.