ebook img

ARM Compiler toolchain - ARM - The Architecture For The Digital World PDF

51 Pages·2011·0.43 MB·English
by  
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview ARM Compiler toolchain - ARM - The Architecture For The Digital World

ARM® Compiler toolchain Version 4.1 Building Linux Applications with the ARM® Compiler toolchain and GNU Libraries Copyright ©2010-2011 ARM. All rights reserved. ARM DUI 0483C (ID080411) ARM Compiler toolchain Building Linux Applications with the ARM Compiler toolchain and GNU Libraries Copyright ©2010-2011 ARM. All rights reserved. Release Information The following changes have been made to this book. Change History Date Issue Confidentiality Change 28 May 2010 A Non-Confidential ARM Compiler toolchain v4.1 Release 30 September 2010 B Non-Confidential Update 1 for ARM Compiler toolchain v4.1 28 January 2011 C Non-Confidential Update 2 for ARM Compiler toolchain v4.1 Patch 3 30 April 2011 C Non-Confidential Update 3 for ARM Compiler toolchain v4.1 Patch 4 29 July 2011 C Non-Confidential Update 4 for ARM Compiler toolchain v4.1 Patch 5 Proprietary Notice Words and logos marked with ® or ™ are registered trademarks or trademarks of ARM in the EU and other countries, except as otherwise stated below in this proprietary notice. Other brands and names mentioned herein may be the trademarks of their respective owners. Neither the whole nor any part of the information contained in, or the product described in, this document may be adapted or reproduced in any material form except with the prior written permission of the copyright holder. The product described in this document is subject to continuous developments and improvements. All particulars of the product and its use contained in this document are given by ARM in good faith. However, all warranties implied or expressed, including but not limited to implied warranties of merchantability, or fitness for purpose, are excluded. This document is intended only to assist the reader in the use of the product. ARM shall not be liable for any loss or damage arising from the use of any information in this document, or any error or omission in such information, or any incorrect use of the product. Where the term ARM is used it means “ARM or any of its subsidiaries as appropriate”. Confidentiality Status This document is Non-Confidential. The right to use, copy and disclose this document may be subject to license restrictions in accordance with the terms of the agreement entered into by ARM and the party that ARM delivered this document to. Product Status The information in this document is final, that is for a developed product. Web Address http://www.arm.com ARM DUI 0483C Copyright ©2010-2011 ARM. All rights reserved. ii ID080411 Non-Confidential Contents ARM Compiler toolchain Building Linux Applications with the ARM Compiler toolchain and GNU Libraries Chapter 1 Conventions and feedback Chapter 2 About building Linux applications with the ARM Compiler toolchain and GNU libraries 2.1 About the ARM Compiler toolchain and GNU libraries ................................................. 2-2 2.2 Expected use cases for developing Linux applications ................................................ 2-3 2.3 Limitations when building Linux applications ................................................................ 2-4 2.4 Target processor requirements for building Linux applications .................................... 2-6 2.5 Build requirements for Linux applications ..................................................................... 2-7 2.6 About the ARM Application Binary Interface ................................................................. 2-8 2.7 Interactions between mixed-ABI components .............................................................. 2-9 Chapter 3 Using the ARM Compiler toolchain to build a Linux application or library 3.1 About using the ARM Compiler toolchain to build a Linux application or library ........... 3-2 3.2 Configuration of the ARM Compiler toolchain for Linux applications ............................ 3-3 3.3 Configuring the ARM Compiler toolchain automatically ................................................ 3-5 3.4 Configuring the ARM Compiler toolchain manually ...................................................... 3-6 3.5 Building for ARM Linux using normal ARM Compiler toolchain options ....................... 3-7 3.6 Using the ARM Compiler toolchain as a drop-in replacement for GCC and GNU Id .... 3-8 3.7 GCC emulation mode in armcc ..................................................................................... 3-9 3.8 Passing normal armcc options in GNU emulation mode ............................................ 3-10 3.9 Differences in behavior and limitations between GCC and armcc emulation mode ... 3-11 3.10 Migrating a build from an earlier version of the ARM tools ......................................... 3-12 3.11 Minimal migration path without using a configuration file ........................................... 3-13 ARM DUI 0483C Copyright ©2010-2011 ARM. All rights reserved. iii ID080411 Non-Confidential Contents 3.12 Migration using a configuration ................................................................................... 3-15 3.13 Typical assembler command-line options ................................................................... 3-16 3.14 Additional headers from the ARM Compiler toolchain ................................................ 3-17 3.15 Building a shared library with the ARM Compiler toolchain ........................................ 3-18 3.16 Using shared libraries in your application ................................................................... 3-19 Chapter 4 Frequently-asked questions and troubleshooting 4.1 Where can I find more information on building Linux applications? .............................. 4-2 4.2 How do I build an EABI-compliant Linux kernel? .......................................................... 4-3 4.3 Can I build the Linux kernel using the ARM Compiler toolchain? ................................. 4-4 4.4 Which kernel version must I use? ................................................................................. 4-5 4.5 Can I use EABI-compliant and non EABI-compliant applications together? ................. 4-6 4.6 GNU tools report EABI version differences between source object and target ............ 4-7 4.7 GNU linker or armlink report conflicts between wchar_t types ..................................... 4-8 4.8 Using hardware VFP instructions ................................................................................. 4-9 4.9 Can I use the ARM libraries in a Linux application? ................................................... 4-10 4.10 How can I see what libraries are being used? ............................................................ 4-11 4.11 How can I have greater control over which libraries are linked into my application? .. 4-12 4.12 Common problems with running an application .......................................................... 4-13 4.13 What to do about segmentation faults ........................................................................ 4-14 4.14 Image sizes and stripping debug data ........................................................................ 4-15 4.15 Undefined symbol errors for pthread symbols ............................................................ 4-16 Appendix A Revisions for Building Linux Applications with the ARM Compiler toolchain and GNU Libraries ARM DUI 0483C Copyright ©2010-2011 ARM. All rights reserved. iv ID080411 Non-Confidential Chapter 1 Conventions and feedback The following describes the typographical conventions and how to give feedback: Typographical conventions The following typographical conventions are used: monospace Denotes text that can be entered at the keyboard, such as commands, file and program names, and source code. monospace Denotes a permitted abbreviation for a command or option. The underlined text can be entered instead of the full command or option name. monospace italic Denotes arguments to commands and functions where the argument is to be replaced by a specific value. monospace bold Denotes language keywords when used outside example code. italic Highlights important notes, introduces special terminology, denotes internal cross-references, and citations. bold Highlights interface elements, such as menu names. Also used for emphasis in descriptive lists, where appropriate, and for ARM® processor signal names. Feedback on this product If you have any comments and suggestions about this product, contact your supplier and give: • your name and company ARM DUI 0483C Copyright ©2010-2011 ARM. All rights reserved. 1-1 ID080411 Non-Confidential Conventions and feedback • the serial number of the product • details of the release you are using • details of the platform you are using, such as the hardware platform, operating system type and version • a small standalone sample of code that reproduces the problem • a clear explanation of what you expected to happen, and what actually happened • the commands you used, including any command-line options • sample output illustrating the problem • the version string of the tools, including the version number and build numbers. Feedback on content If you have comments on content then send an e-mail to [email protected]. Give: • the title • the number, ARM DUI 0483C • if viewing online, the topic names to which your comments apply • if viewing a PDF version of a document, the page numbers to which your comments apply • a concise explanation of your comments. ARM also welcomes general suggestions for additions and improvements. ARM periodically provides updates and corrections to its documentation on the ARM Information Center, together with knowledge articles and Frequently Asked Questions (FAQs). Other information • ARM Information Center, http://infocenter.arm.com/help/index.jsp • ARM Technical Support Knowledge Articles, http://infocenter.arm.com/help/topic/com.arm.doc.faqs/index.html • ARM Support and Maintenance, http://www.arm.com/support/services/support-maintenance.php • ARM Glossary, http://infocenter.arm.com/help/topic/com.arm.doc.aeg0014-/index.html. ARM DUI 0483C Copyright ©2010-2011 ARM. All rights reserved. 1-2 ID080411 Non-Confidential Chapter 2 About building Linux applications with the ARM Compiler toolchain and GNU libraries The following topics give an overview of building a Linux application or library with the ARM Compiler toolchain, and describe limitations and requirements: Concepts • About the ARM Compiler toolchain and GNU libraries on page2-2 • Expected use cases for developing Linux applications on page2-3 • Limitations when building Linux applications on page2-4 • Target processor requirements for building Linux applications on page2-6 • Build requirements for Linux applications on page2-7 • About the ARM Application Binary Interface on page2-8 • Interactions between mixed-ABI components on page2-9. ARM DUI 0483C Copyright ©2010-2011 ARM. All rights reserved. 2-1 ID080411 Non-Confidential About building Linux applications with the ARM Compiler toolchain and GNU libraries 2.1 About the ARM Compiler toolchain and GNU libraries The ARM Compiler toolchain enables you to create dynamic images that can run under Linux using the header files and libraries from the GNU C library (glibc). The instructions assume that you are familiar with ARM Compiler toolchain, GNU toolchain, and Linux. 2.1.1 See also Tasks • Chapter3 Using the ARM Compiler toolchain to build a Linux application or library. Concepts • Expected use cases for developing Linux applications on page2-3 • Limitations when building Linux applications on page2-4 • Target processor requirements for building Linux applications on page2-6 • Build requirements for Linux applications on page2-7 • About the ARM Application Binary Interface on page2-8 • Interactions between mixed-ABI components on page2-9. Other information • GNU ARM toolchain, http://www.gnuarm.com • GCC, the GNU Compiler Collection, http://gcc.gnu.org • GNU Operating System, http://www.gnu.org. ARM DUI 0483C Copyright ©2010-2011 ARM. All rights reserved. 2-2 ID080411 Non-Confidential About building Linux applications with the ARM Compiler toolchain and GNU libraries 2.2 Expected use cases for developing Linux applications The following are the expected use cases for developing Linux applications and libraries with the ARM Compiler toolchain and GNU libraries: • building a standalone Linux application with the ARM Compiler toolchain • building static and shared libraries with the ARM Compiler toolchain, and linking these to an application built with the ARM Compiler toolchain • building a static or shared library with the ARM Compiler toolchain, and linking this to an application built with the GNU toolchain • migrating an existing Linux application build using the ARM Compiler toolchain, retaining explicit search paths on the command line • migrating an existing Linux application build using the ARM Compiler toolchain, using a standard configuration of system search paths and libraries • using armcc and armlink as drop-in replacements for GCC and GNU ld using command-line translation. 2.2.1 See also Reference Compiler Reference: • --arm_linux on page3-16 • --arm_linux_paths on page3-21 • Chapter3 Compiler Command-line Options. Linker Reference: • --arm_linux on page2-13 • Chapter2 Linker command-line options. ARM DUI 0483C Copyright ©2010-2011 ARM. All rights reserved. 2-3 ID080411 Non-Confidential About building Linux applications with the ARM Compiler toolchain and GNU libraries 2.3 Limitations when building Linux applications There are several limitations on interoperation between the GNU tools and libraries and the ARM Compiler toolchain: GNU tool and library compatibility with the ARM Compiler toolchain Be aware of the following compatibility requirements: • CodeSourcery 2008q1 is the earliest recommended release. • CodeSourcery 2005q3 is the earliest release that provides basic interoperation with the ARM Compiler toolchain, however, releases earlier than 2008 have known interoperability issues and you might encounter problems using them. • If libraries from a distribution or mainline GNU toolchain build are used, their sources tend to be behind CodeSourcery releases in terms of bug fixes, so a more recent version might be required to avoid interoperation problems. • You must use the 2005-q3-2 release of the CodeSourcery tools (or a later release). Because of updates in the ARM Application Binary Interface (ABI) ELF specification, the binary utilities (binutils) from this CodeSourcery release cannot consume object files built with the ARM Compiler toolchain. Support for the new ELF ABI revision is in the 2006-q1 and later releases. • There are slight implementation differences in the way C++ exceptions are handled between the ARM Compiler toolchain and GCC. Because of these differences, the GNU C/C++ library prior to the CodeSourcery 2007-q1-10 release did not support code generated by the ARM Compiler toolchain that used C++ exceptions. Therefore, to use C++ exceptions you must use the CodeSourcery 2007-q1-10 release or later. This includes using these libraries on the filesystem of your target. The ARM Compiler toolchain cannot be used for building the Linux kernel or kernel-based code, such as device drivers or other kernel modules This is because a significant portion of the kernel code is written in assembly language using the GNU assembler (GAS) syntax. This is incompatible with armasm, and there is no performance gain to be made from rebuilding such code with a different assembler. Also, the function interfaces for the kernel code prior to version 2.6.16 have not been written to comply with the ABI. This means that drivers and other kernel modules cannot be compiled using the ARM Compiler toolchain because there are no guarantees that calls would be made correctly between the kernel and the driver code. You must use the GNU toolchain when building the kernel and kernel modules. ARM architecture v4T is not fully supported See Target processor requirements for building Linux applications on page2-6. 2.3.1 Unsupported GCC features The following GCC features are not supported: • assembly source, both inline assembly and separate GNU assembler (GAS) source files • nested functions • frame pointers. ARM DUI 0483C Copyright ©2010-2011 ARM. All rights reserved. 2-4 ID080411 Non-Confidential

Description:
Title: ARM Compiler toolchain Building Linux Applications with the ARM Compiler toolchain and GNU Libraries Author: ARM Limited Subject: ARM Compiler Building Linux
See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.