Compiler and Toolchain Options

Figure 1. Compiler and Toolchain Options

AVR GNU C Compiler Options

Table 1. AVR GNU C compiler Options
Option Description
General options


Use subroutines for functions prologues and epilogues


Change stack pointer without disabling interrupts


Default char type is unsigned


Default bit field is unsigned

Preprocessor options


Do not search system directories


Preprocess only

Symbols options

Symbols in source can be defined (-D) or undefined (-U). New symbol declarations can be added, modified, or reordered, using the interface buttons below:

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

  • Remove a symbol.

  • Edit 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

No optimization, optimize for speed (level 1 - 3), optimize for size

Other optimization flags (manual input form)

Here you should write optimization flags specific for the platform and your requirements


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


Pack structure members together


Allocate only as many bytes as needed by the enumerated types


Use rjmp/rcall limited range instructions on the >8K devices

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

Other debug options (form field)

Architecture specific debug options

Warning messages output options


All warnings


Escalate warnings to errors


Check syntax only


Check conformity to GNU, raise warnings on non-standard programming practice


Same as above, plus escalate warnings to errors

Miscellaneous options

Other flags (form field)

Input other project-specific flags




Support ANSI programs


Do not delete temporary files

Option Description

AVR GCC Linker Options

Table 2. AVR GCC Linker Options
Option Description

-Wl -nostartfiles

Do not use standard files

-Wl -nodefault

Do not use default libraries

-Wl -nostdlib

No start-up or default libraries

-Wl -s

Omit all symbol information

-Wl -static

Link statically

Libraries options

Libraries -Wl, -l (form field)

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

Library search path -Wl,-L (form field)

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

Optimization options

-Wl, -gc-sections

Garbage collect unused sections


Put read-only data in writable spaces


Relax branches

Miscellaneous options

Other linker flags (form field)

Input other project-specific flags

AVR Assembler Options

Table 3. AVR Assembler Options
Option Description

Optimization options

Assembler flags (form field)

Miscellaneous assembler flags

Include path (form field)

You can add, prioritize or edit path to the architecture and platform specific included files here


Announce version in the assembler output

Debugging options

Debugging level (drop down menu) -Wa -g1, -Wa, -g2, -Wa, -g3

Defines a level of debugging symbol and debugging source insertion