Keil Logo

Building an application with microlib

2.5 Building an application with microlib

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.

Use --library_type=microlib with the linker to override all other options.

Compiler option

armcc --library_type=microlib -c main.c
armcc -c extra.c
armlink -o image.axf main.o extra.o
Specifying --library_type=microlib when compiling main.c results in an object file containing an attribute that asks the linker to use microlib. Compiling extra.c with --library_type=microlib is unnecessary, because the request to link against microlib exists in the object file generated by compiling main.c.

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
The request to the linker to use microlib is made as a result of assembling more.s with --library_type=microlib.

Linker option

armcc -c main.c
armcc -c extra.c
armlink --library_type=microlib -o image.axf main.o extra.o
Neither object file contains the attribute requesting that the linker link against microlib, so the linker selects microlib as a result of being explicitly asked to do so on the command line.
Non-ConfidentialPDF file icon PDF versionARM DUI0378H
Copyright © 2007, 2008, 2011, 2012, 2014-2016 ARM. All rights reserved. 
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.