What is the difference between converting to arm-Linux-GCC and arm-elf-GCC?

Source: Internet
Author: User

In the development of ARM-based embedded systems, there are usually two types of GCC tool chains that use cross-Compilation: Arm-Linux-* and
Arm-elf-*, the main 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 newlib. glibc, a C Library specially developed for embedded systems, using RedHat. Uclibc/UC-libc and
Newlib is a C language library file, but it is only used in different fields. glibc is developed for PC, and uclibc/UC-libc is different from glibc
The small C language library compatible with APIs 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
Quick overview of how they are different.
UC-libc is
Original library for uClinux. It was based on sources from
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
Your Requirements
Translation:
UClinux has two frequently used libc libraries: UC-libc and uclibc. Although
However, their names are very similar, but they are actually different. The following describes the differences between the two. UC-libc is the first library developed for uClinux and is Jeff
Dionne and kenth albanowski support m68000 in Linux-8086 for ekls Projects
C library source code. UC-libc is a complete libc implementation, but some APIs are non-standard and some libc standards are not implemented. UC-libc stable support
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 APIs, it seems
It is not as consistent with all standards as it expects.
Uclibc is developed from UC-libc to solve this problem. All its APIs are standard (correct
It makes up for the libc standard that is not implemented in UC-libc and has been transplanted to multiple architectures. Generally, it is best compatible with glibc for application
Uclibc is easy to rewrite. Uclibc is available in standard VMS
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 encoding.
Translation. For m68000 and ColdFire platforms, it is better to choose UC-libc because it supports shared libraries, which are frequently used by these CPUs.
Libc. 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 libc and libm libraries. It features lightweight, fast, and can be transplanted to many CPU Structures. Newlib implementation
It provides many complex functions, including String Support, floating point operations, memory allocation (such as malloc), and I/O Stream functions (printf, fprinf ). Among them, libc provides C
Language Library implementation, and libm provides floating point operation support.
When the GCC compiler is cross-compiled for ARM and different configuration options are specified for GCC, the C language library used is not
The GCC compiler uses glibc by default, or uclibc/UC-libc (basically compatible with glibc ).
When -- With-newlib is used, the GCC compiler does not use glibc. When glibc is not cross-compiled, you can use -- With-newlib to disable connection.
Compile Bootstrap with glibc
GCC compiler. We can see from the T-Linux and T-arm-elf in the config/arm in the GCC source directory that different -- targets also affect GCC connection to C language.
Library, T-Linux (-- target = arm-Linux) uses glibc by default,-arm-elf (-- target = arm-elf) uses-
Dinhibit_libc disconnects to glibc. In this case, we can use other C language libraries such as newlib to compile the GCC tool chain.
Although GCC tool chain configuration
Different C language libraries, but since these C language libraries can be used to support GCC, there is no major difference in processing core data. Therefore, arm-Linux-* and
The differences between ARM-elf-* are mainly manifested in the implementation of C language libraries, such as 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.
Some lightweight C language libraries designed for Embedded Systems compile bare metal programs (without programs for large operating systems such as Linux), such as monitoring programs and bootloader, to make system programs smaller
Quick and convenient.
  
  
How can we explain the differences between ARM-Linux-GCC and arm-elf-GCC in one sentence?
Arm-Linux-GCC is a development environment for ARM + linux. The kernel uses Linux, not uClinux, and arm has MMU hardware.
While arm-elf-GCC is a development environment for no mmu arm + uClinux. The kernel uses uClinux and the hardware is a cheap ARM chip without MMU.
Arm-Linux-GCC is similar to Linux development in X86 PC.
The following is an English explanation:
Xxx-elf is for standalone application. xxx-Linux is for application running on
Linux. These two toolchains are almost same, struct t for different macros
Defined when preprocessing and different libraries linked in when performing
Linking.

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.