ARM Developer Suite Compilers and Libraries Guide
Total Page:16
File Type:pdf, Size:1020Kb
ARM® Developer Suite Version 1.2 Compilers and Libraries Guide Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067D ARM Developer Suite Compilers and Libraries Guide Copyright © 1999-2001 ARM Limited. All rights reserved. Release Information The following changes have been made to this book. Change History Date Issue Change October 1999 A Release 1.0 March 2000 B Release 1.0.1 November 2000 C Release 1.1 November 2001 D Release 1.2 Proprietary Notice Words and logos marked with ® or ™ are registered trademarks or trademarks owned by ARM Limited. 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 Limited 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. ii Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067D Contents ARM Developer Suite Compilers and Libraries Guide Preface About this book ............................................................................................ viii Feedback ...................................................................................................... xii Chapter 1 Introduction 1.1 About the compilers and libraries ................................................................ 1-2 1.2 The ARM compilers and libraries ................................................................ 1-3 1.3 Linking compiled objects ............................................................................. 1-5 1.4 Related utilities ............................................................................................ 1-6 Chapter 2 C and C++ Compilers 2.1 About the C and C++ compilers .................................................................. 2-2 2.2 File usage ................................................................................................... 2-4 2.3 Command syntax ........................................................................................ 2-9 Chapter 3 ARM Compiler Reference 3.1 Compiler-specific features ........................................................................... 3-2 3.2 Language extensions ................................................................................ 3-16 3.3 C and C++ implementation details ........................................................... 3-21 3.4 Predefined macros .................................................................................... 3-31 ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. iii Contents Chapter 4 The C and C++ Libraries 4.1 About the runtime libraries ......................................................................... 4-2 4.2 Building an application with the C library .................................................... 4-6 4.3 Building an application without the C library ............................................. 4-13 4.4 Tailoring the C library to a new execution environment ............................ 4-20 4.5 Tailoring static data access ...................................................................... 4-25 4.6 Tailoring locale and CTYPE ..................................................................... 4-26 4.7 Tailoring error signaling, error handling, and program exit ....................... 4-51 4.8 Tailoring storage management ................................................................. 4-57 4.9 Tailoring the runtime memory model ........................................................ 4-67 4.10 Tailoring the input/output functions ........................................................... 4-75 4.11 Tailoring other C library functions ............................................................. 4-85 4.12 Selecting real-time division ....................................................................... 4-90 4.13 ISO implementation definition ................................................................... 4-91 4.14 C library extensions .................................................................................. 4-99 4.15 Library naming conventions .................................................................... 4-105 Chapter 5 Floating-point Support 5.1 About floating-point support ........................................................................ 5-2 5.2 The software floating-point library, fplib ...................................................... 5-3 5.3 Controlling the floating-point environment .................................................. 5-8 5.4 The math library, mathlib .......................................................................... 5-24 5.5 IEEE 754 arithmetic .................................................................................. 5-30 Appendix A Via File Syntax A.1 Overview of via files .................................................................................... A-2 A.2 Syntax ......................................................................................................... A-3 Appendix B Standard C Implementation Definition B.1 Implementation definition ............................................................................ B-2 Appendix C Standard C++ Implementation Definition C.1 EC++ support ............................................................................................. C-2 C.2 Integral conversion ..................................................................................... C-3 C.3 Calling a pure virtual function ..................................................................... C-4 C.4 Minor features of language support ............................................................ C-5 C.5 Major features of language support ............................................................ C-7 C.6 Standard C++ library implementation definition .......................................... C-8 Appendix D C and C++ Compiler Implementation Limits D.1 C++ ISO/IEC standard limits ...................................................................... D-2 D.2 Internal limits .............................................................................................. D-4 D.3 Limits for integral numbers ......................................................................... D-5 D.4 Limits for floating-point numbers ................................................................ D-6 iv Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067D Contents Glossary ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. v Contents vi Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067D Preface This preface introduces the ARM Developer Suite (ADS) tools and reference documentation. It contains the following sections: • About this book on page viii • Feedback on page xii. ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. vii Preface About this book This book provides reference information for ADS. It describes the command-line options to the compilers. The book also gives reference material on the ARM implementation of the C and C++ compilers and the C libraries. Intended audience This book is written for all developers who are producing applications using ADS. It assumes that you are an experienced software developer and that you are familiar with the ARM development tools as described in ADS Getting Started. Using this book This book is organized into the following chapters and appendixes: Chapter 1 Introduction Read this chapter for an introduction to ADS version 1.2 compilers and libraries. Chapter 2 C and C++ Compilers Read this chapter for an explanation of all command-line options accepted by the ARM C and C++ compilers. Chapter 3 ARM Compiler Reference Read this chapter for a description of the language features provided by the ARM C and C++ compilers, and for information on standards conformance and implementation details. Chapter 4 The C and C++ Libraries Read this chapter for a description of the ARM C and C++ libraries and instructions on re-implementing individual library functions. Chapter 5 Floating-point Support Read this chapter for a description of floating-point support in ADS. Appendix A Via File Syntax Read this appendix for a description of the syntax for via files. You can use via files to specify command-line arguments to many ARM tools. Appendix B Standard C Implementation Definition Read this appendix for information on the ARM C implementation that relates directly to the ISO/IEC C standards requirements. viii Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067D Preface Appendix C Standard C++ Implementation Definition Read this appendix for information on the ARM C++ implementation. Appendix D C and C++ Compiler Implementation Limits Read this appendix for implementation limits of the ARM C and C++ compilers. Typographical conventions The following typographical conventions are used