13.07.2015 Views

TASKING VX-toolset for ARM User Guide

TASKING VX-toolset for ARM User Guide

TASKING VX-toolset for ARM User Guide

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 4. Using the C CompilerThis chapter describes the compilation process and explains how to call the C compiler.The <strong>TASKING</strong> <strong>VX</strong>-<strong>toolset</strong> <strong>for</strong> <strong>ARM</strong> under Eclipse can use the internal builder (default) or the <strong>TASKING</strong>makefile generator (external builder) to build your entire embedded project, from C source till the finalELF/DWARF object file which serves as input <strong>for</strong> the debugger.Although in Eclipse you cannot run the C compiler separately from the other tools, this section discussesthe options that you can specify <strong>for</strong> the C compiler.On the command line it is possible to call the C compiler separately from the other tools. However, it isrecommended to use the control program <strong>for</strong> command line invocations of the <strong>toolset</strong> (see Section 10.1,Control Program). With the control program it is possible to call the entire <strong>toolset</strong> with only one commandline.The C compiler takes the following files <strong>for</strong> input and output:This chapter first describes the compilation process which consists of a frontend and a backend part.Next it is described how to call the C compiler and how to use its options. An extensive list of all optionsand their descriptions is included in Section 12.2, C Compiler Options. Finally, a few important basic tasksare described, such as including the C startup code and per<strong>for</strong>ming various optimizations.4.1. Compilation ProcessDuring the compilation of a C program, the C compiler runs through a number of phases that are dividedinto two parts: frontend and backend.The backend part is not called <strong>for</strong> each C statement, but starts after a complete C module or set of moduleshas been processed by the frontend (in memory). This allows better optimization.The C compiler requires only one pass over the input file which results in relative fast compilation.Frontend phases1. The preprocessor phase:The preprocessor includes files and substitutes macros by C source. It uses only string manipulationson the C source. The syntax <strong>for</strong> the preprocessor is independent of the C syntax but is also describedin the ISO/IEC 9899:1999(E) standard.147

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!