8.2 XC8 Compiler and Toolchain Options: GUI Toolchain Options

This section illustrates the GUI options available for the XC8 compiler in Microchip Studio.

Figure 8-1. XC8 Toolchain Options

XC8 Common Options

Table 8-1. XC8 Common Options
OptionDescription

General Options

-mrelax

Controls the optimization of the long form of call and jump instruction

Output File Options

.hex

Generate hex file

.eep

Generate eep file

.usersignatures

Generate usersignatures file

.lss

Generate lss file

Miscellaneous Options

Other Common Flags (Form field)

Input other project-specific flags

XC8 C Compiler Options

Table 8-2. XC8 C Compiler Options
OptionDescription

General Options

-mcall-prologues

Use subroutines for function prologues and epilogues

-mno-interrupts

Change stack pointer without disabling interrupts

-funsigned-char

The default char type is unsigned

-funsigned-bitfield

The default bit field is unsigned

-nostdinc

Do not search system directories

-mext=cci

Use CCI

Symbol Options

One can define (-D) or undefine (-U) and several in-source symbols. New symbol declarations can be added, modified or reordered, using the interface buttons below:

  • Add a new symbol. This symbol and all the following icons are reused with the same meaning in other parts of the Microchip Studio interface.

  • Remove a symbol.

  • Edit a symbol.

  • Move the symbol up in the parsing order.

  • Move the symbol down in the parsing order.

Include Directories

Contains all the included header and definition directories, can be modified using the same interface as symbols.

Optimization Options

optimization level(drop-down menu): -O0,-O1, -O2, -O3, -Os, -Og

No optimization, increasing general optimization (levels 1 & 2), optimize for speed (3), optimize for size, optimize for better debugging experience

-ffunction-sections

Prepare functions for garbage collection. If a function is never used, its memory will be scrapped.

-fdata-sections

Prepare data for garbage collection

-fshort-enums

Allocate only as many bytes needed by the enumerated types

Debug Options

Debug level (drop-down menu): none, g1, g2, g3

Specifies the level of tracing and debugging code and headers left or inserted in the source code

Warning Messages Output Options

-Wall

Show all warnings

-Werror

Generation of errors instead of warnings for dubious constructs

-pedantic

Warnings demanded by strict ANSI C. Rejects all programs that use forbidden extensions.

-w

Inhibit all warnings

Miscellaneous Options

Other flags (Form field)

Input other project-specific flags

-v

Verbose

XC8 Linker Options

Table 8-3. XC8 Linker Options
OptionDescription

General Options

-nodefaultlibs

Do not use default libraries

-Wl,-Map

Generate MAP file

-Wl,-u, -vfprintf

Use vfprintf library

Libraries Options

Libraries -l (form field)

You can add, prioritize or edit library names here using these buttons:

,
,
,
,

Library search path -L (form field)

You can add, prioritize or edit a path where the linker will search for dynamically linked libraries. It uses the same interface as above.

Optimization Options

-Wl,--gc-sections

Garbage collect unused sections

Miscellaneous Options

Other Linker Flags (Form field)

Input other project-specific flags

XC8 Assembler Options

Table 8-4. XC8 Assembler Options
OptionDescription

Miscellaneous Option

Other Assembler Flags (Form field)

Input other project-specific flags

XC8 Archiver Options

Table 8-5. XC8 Archiver Options
OptionDescription

General Options

Archiver Flags (Form field)

Input other project-specific flags