2.1. Compiler language and code-generation options

There are a number of options required when compiling source files for Linux applications:

‑‑gnu

As the headers accompanying the GNU C libraries must be used when linking against glibc, you must pass this switch to the ARM compiler to enable support for the GNU extensions. See the section GNU extensions to the ARM compiler in the RVCT 3.0 Compiler and Libraries Guide for a full explanation of the GNU extensions supported by RVCT.

‑‑enum_is_int

This causes all enums to be treated as integer types. This is required by the CodeSourcery document "ARM GNU/Linux Application Binary Interface Supplement" for building Linux applications. For more information on this option, see the section Controlling implementation details of the RVCT 3.0 Compiler and Libraries Guide.

‑‑library_interface=aeabi_glibc

This disables certain optimizations that the ARM compiler uses by default when linking with the RVCT libraries.

‑Dlrintf=_ffix_r, ‑D__align=__alignx

These two options define the names used by GNU for two ARM built-in functions.

‑‑apcs /interwork

This instructs the compiler to build all code for interworking, and to set the build attributes in the output objects accordingly. This ensures that your code is built correctly for ARM/Thumb interworking. It also helps to prevent the linker generating additional warnings, as GCC does not add build attributes to an object file that indicates whether it was compiled for ARM/Thumb interworking or not.

‑‑no_hide_all

This instructs the compiler to use dynamic import and export for the symbols in an image. This sets the attributes of references and definitions in the image so that they can be dynamically linked.

‑‑wchar32

This changes type of wchar_t to unsigned int instead of unsigned short. Please note this is only available in RVCT 3.0 SP1 (build 586 and later).

Optional compiler switches

‑‑signed_bitfields

This option makes bitfields signed by default. If you are building code that has previously been targeted at GCC, you may need to use this switch for compatibility.

Copyright © 2005-2006. All rights reserved.DAI0150B
Non-Confidential