GNU compilation tool

Source: Internet
Author: User

Development Studio 5 has des a distribution of the GNU Compiler Collection (GCC) and related GNU utilities. This distribution is referred to in this document as the 'gnu compilation tool '.

The GNU compilation tools can be used to build applications and libraries suitable for ARM Linux targets, including the example ARM Linux distribution which can be found in the DS-5 examples. They are:
NotSuitable for building code for 'bare metal' arm targets, for ARM targets running any other operating system, or for non-arm targets.

The GNU compilation tools are a subset of the 2010.09-50 release of the codesourcery g ++ lite distribution for arm gnu/Linux and are based on GCC version 4.5.1. sources can be found in the 'sources' directory of your installation medium.

Terms

This document makes use of the following terms.

Term Meaning
Host The computer used for building and debugging.
Target The system on which the built software is deployed and run.
Target Distribution The Linux distribution running on the target system.
Sysroot A directory on the host system containing a copy of the files that exist in the target distribution and/or extra files required to develop for the target distribution.
Host development tools host development tools

All GNU compilation tools are inbinDirectory. They can be identified by the prefix
arm-none-linux-gnueabi-. The tools can be used from the command line, or in makefile projects in the Eclipse IDE. For Windows users, the DS-5 command prompt has the tools in its path.

Some of the most important tools are:

Tool Description
Arm-None-Linux-gnueabi-ar GNU Librarian
Arm-None-Linux-gnueabi- GNU Explorer
Arm-None-Linux-gnueabi-gcc Gnu c Compiler
Arm-None-Linux-gnueabi-G ++ Gnu c ++ Compiler
Arm-None-Linux-gnueabi-LD GNU linker

Note:

The GNU compilation tools are not 100% compatible with the arm compilation tools. the GNU tools do not accept the default command-line options of the arm tools, but the arm tools can accept GNU command-line options. arm therefore recommends that for Building
Linux applications, GCC command-line option are used. you shoshould also be aware that the GNU and arm reducers consume different syntax. however, both toolchains are Eabi-compliant, meaning that objects and libraries created with either toolchain can be used
With the other toolchain.

Target development tools target board development tools

A gdbserver utility is supported as part of the GNU compilation tools. Builds of this gdbserver utility can be found under
armDirectory of your development Studio 5 installation. you shoshould use the build most suitable for your target system but, if in doubt, the armv5t build is likely to work on the broadest range of target systems. note that you must have compatible
Shared libraries installed to use the gdbserver utility on your target system. This gdbserver utility is taken from the 2010-q1-202 release of codesourcery g ++ lite and corresponds to GDB 7.0.50.

Sysroots system directory of library and header file

Applications and shared libraries for target distributions must be built with respect to resources available on the target distribution. In particle, libraries and corresponding headers from the target distribution must be available on the host. The necessary
Libraries and headers are here referred to asSysroot. A sysroot may or may not also include binaries, configuration files, or any other part of the target distribution.

Sysroot Selection

You shoshould build your code with respect to the headers and libraries for your target distribution. However, the GNU compilation tools contain three sysroots in the following directories:

sw/gcc/arm-none-linux-gnueabi/libc Default armv5t sysroot.
sw/gcc/arm-none-linux-gnueabi/libc/thumb2 Thumb2 sysroot. used if options-mthumb --march=armv7aAre given to the compiler.
sw/gcc/arm-none-linux-gnueabi/libc/armv4t Armv4t sysroot. used if option-march=armv4tIs given to the compiler.

To use your own sysroot, specify its location on your host using--sysroot. The default armv5t sysroot conflict with the GNU compilation tools is sufficient for building applications and libraries for the example Linux distribution conflict DED
In the DS-5 examples, but its libraries are not guaranteed to be debug-compatible with the example distribution.

Note:

Ordinarily, you are able to install sysroot filesystems onto real targets. however, if you are using a Windows host then the provided sysroots will not be suitable for use on a real target, due to differences between Windows and Linux filesystems.

Note:

Locale data files have been removed from the provided sysroots, to save disk space. you may need to add locale files to be able to use the provided sysroots as a basis for a target filesystem. this shoshould have no impact on using the sysroots for Building
Applications.

Floating Point support in the provided sysroots

The provided libraries all use software emulation to provide floating point support. This means that:

  1. All floating point operations saved med by libraries will use software emulation, even when the target has hardware support for Floating Point
  2. Any code you build that uses these libraries must be built-mfloat-abi=softfpIn order to be interface-compatible with the libraries

If you are building with respect to a different set of libraries then you shoshould set
-mfloat-abiOption to be compatible with your libraries.

Dynamic Linkage

The supplied compiler accesses thread-Local Storage Using TLS descriptors. this requires support from the dynamic loader. if your target filesystem's dynamic loader does not support TLS descriptors then you must compile code with the option
-mtls-dialect=arm.

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.