Keil™, An ARM® Company

RealView Libraries and Floating Point Support Guide

Building an application with microlib

3.2. Building an application with microlib

This section covers creating an application that links with microlib. Functions in microlib are responsible for:

  • Creating an environment in which a C program can execute. This includes:

    • creating a stack

    • creating a heap, if required

    • initializing the parts of the library the program uses.

  • Starting execution by calling main().

To build a program using microlib, you must use the command-line option ‑‑library_type=microlib. This option can be used by the compiler, assembler or linker on different files as required. Use this option with the linker to override all other options.

Example 3.1 shows this option being used by the compiler. microlib is selected for the main.c file only.

Example 3.1.  Compiler option

armcc ‑‑library_type=microlib ‑c main.c
armcc ‑c extra.c
armlink ‑o image.axf main.o extra.o

Example 3.2 shows this option being used by the assembler. microlib is selected for the more.s file only.

Example 3.2.  Assembler option

armcc ‑c main.c
armcc ‑c extra.c
armasm ‑‑library_type=microlib more.s
armlink ‑o image.axf main.o extra.o more.o

Example 3.3 shows this option being used by the linker. microlib is selected for both the main.c and extra.c files.

Example 3.3.  Linker option

armcc ‑c main.c
armcc ‑c extra.c
armlink ‑‑library_type=microlib ‑o image.axf main.o extra.o

For more information see:

Copyright © 2007 ARM Limited. All rights reserved.ARM DUI 0378A