Compiler and Linker Options

Compiler Options


More advanced documentation can be found in the compiler’s documentation:

For BLE5-Stack projects, compiler options are generated by SysConfig and stored in the project’s Debug\syscfg folder if using Debug version or it can be found in the project’s Release\syscfg folder if using Release version. The compiler.opt file contains a set of options (typically include options and preprocessor defines) to be passed to the compiler when compiling user source files. In the BLE5-Stack, SysConfig is used to generate compile time options to configure BLE5-Stack. For info on configurable SysConfig see BLE5-Stack SysConfig Features.

The .opt files are generated through SysConfig when the project is built. All Bluetooth LE example projects included in the SimpleLink Low Power F3 SDK come with SysConfig enabled by default.


host_test’s SysConfig file is configured such that it cannot be used to make Bluetooth LE configuration modifications. This is because host_test’s Bluetooth LE configuration has been carefully configured to facilitate the intended use-case of host_test.

The predefined symbols in the .opt files are prefixed with a -D, which is standard commandline prefix notation across all the supported toolchains. Of the predefined symbols in the .opt files, some of them are configurable and some are not. .opt files generated by SysConfig cannot be directly modified but instead must be modified through SysConfig. See Bluetooth Low Energy Application Configuration Parameters and Bluetooth Low Energy Application Configuration Parameters for reference as to which options are configurable.

The convention to disable a symbol in the .opt files is to put an ‘x’ in front of the name. For example, to disable power management, change -DPOWER_SAVING to -DxPOWER_SAVING. It is also possible to disable a symbol by commenting it out via ‘C - style’ syntax (e.g. /* -DPOWER_SAVING */).


Changes in an .opt file may not be detected by the compiler/toolchain. It is best to rebuild the entire project when a define is changed.

Linker Options

Linker symbols may need to be set or adjusted at the project level in order to control the memory layout of the generated image. The following procedure describes how to access and modify linker symbols.


  1. Open Project Properties

  2. Navigate in CCS to Build -> ARM Linker -> Advanced Options -> Command File Preprocessing

  3. Use the buttons highlighted in Figure 31. to add, delete, or edit a linker symbol.


Figure 31. CCS Linker Symbols


  1. Open the Project’s Options and select the Linker Category.

  2. Open the Config tab.

  3. View the Configuration File symbol definitions box (see Figure 33.).

  4. Add or edit the preprocessor symbols.


Figure 33. IAR Defined Symbols Box

Linker Command File

Linker command files (or linker command scripts) allow to put linker options and directives in a file. These are used to control how the sections in the input files should be mapped into the output file, and to control the memory layout of the output file.

Per convention, the linker command files are named depending on the toolchain used:

  • xxx.cmd for TI Clang (for more details, see here)

  • xxx.icf for IAR