Skip to content

IAR ILINK linker options in a CMake Project

Felipe Torrezan edited this page Oct 3, 2025 · 10 revisions

The IAR ILINK Linker comes with a vast amount of options that are described in detail in its accompanying Development Guide. Below you will find a non-exhaustive compendium of frequently used options, alongside their respective meanings, where and how you can use them in your CMake projects.

Architecture-agnostic options

Some linker options are available regardless of the chosen target architecture. Below you will find relevant information. In CMake, all linker options can be specified in In CMake, this option can be specified in target_link_options().

  • --config <file>.icf reads the linker configuration from <file>.icf.

  • --map <file>|<dir> produces a linker map file in the chosen location. Example:

target_link_options(tgt PRIVATE
  --map . # will generate a map file inside ${CMAKE_CURRENT_BUILD_DIR}
  # other linker options... )
  • --no_wrap_diagnostics prevents line breaks for linker-related diagnostic messages. In CMake, it is a recommended option for environments where these messages will be logged.

  • --redirect=<foo>=<alt_foo> redirects all symbolic reference pointing to <foo> towards <alt_foo>. This option can be specified multiple times although CMake requires the SHELL: prefix for repeated parameters. Example:

target_link_options(tgt PRIVATE
  SHELL:--redirect=__write=__write_buffered
  SHELL:--redirect=_Printf=_PrintfFullNoMb
  # other options... )
  • --search <path> or -L <path> specifies a path in which the linker should search for objects and libraries. This option can be specified multiple times although CMake requires the SHELL: prefix for repeated parameters. Example:
target_link_options(tgt PRIVATE
  SHELL:--search=/path/to/libs
  SHELL:--search=/path/to/more-libs
  # other options... )

Architecture-specific options

IAR C/C++ Linker for Arm (ilinkarm)

Below you will find details about ilinkarm's options available specifically for Arm targets.

  • --semihosting[=iarbreakpoint] links the target with Arm's semihosting debugging interface. Example:
target_link_options(tgt PRIVATE 
  --semihosting
  # other options... )

Related resources

Clone this wiki locally