Skip to main content

IAR Embedded Workbench for Arm 9.70.x

Customizing and building your own runtime library

In this section:

If the prebuilt library configurations do not meet your requirements, you can customize your own library configuration, but that requires that you rebuild relevant parts of the library.

Note

Customizing and building your own runtime library requires access to the library source code, which is not available for all types of IAR Embedded Workbench licenses.

Building a customized library is a complex process. Therefore, consider carefully whether it is really necessary. You must build your own runtime library when:

  • You want to define your own library configuration with support for locale, file descriptors, multibyte characters, etc. This will include or exclude certain parts of the DLIB runtime environment.

In those cases, you must:

  • Make sure that you have installed the library source code (src\lib). If not already installed, you can install it using the IAR License Manager, see the Licensing Guide.

  • Set up a library project

  • Make the required library customizations

  • Build your customized runtime library

  • Finally, make sure your application project will use the customized runtime library.

    Note that the customized library only replaces the part of the DLIB runtime environment implemented in the libraries for C and C++ library functions. Rebuilding libraries for the following is not supported:

    • math functions

    • runtime support functions

    • thread support functions

    • timezone and daylight saving time functions

    • debug support functions

To set up a library project:
  • In the IDE, choose Project>Create New Project and use the library project template which can be used for customizing the runtime environment configuration. There is a library template for the Full library configuration, see Runtime library configurations

    Note

    When you create a new library project from a template, the majority of the files included in the new project are the original installation files. If you are going to modify these files, make copies of them first and replace the original files in the project with these copies.

To customize the library functionality:
  1. The library functionality is determined by a set of configuration symbols. The default values of these symbols are defined in the file DLib_Defaults.h which you can find in arm\inc\c. This read-only file describes the configuration possibilities. Note that you should not modify this file.

    In addition, you can create your own library configuration file by making a copy of the file DLib_Config_configuration.h—which you can find in the arm\inc\c directory—and customize it by setting the values of the configuration symbols according to the application requirements.

    For information about configuration symbols that you might want to customize, see:

  2. When you are finished, build your library project with the appropriate project options.

    After you build your library, you must make sure to use it in your application project.

    Danger

    To build IAR Embedded Workbench projects from the command line, use the IAR Command Line Build Utility (iarbuild.exe). However, no make or batch files for building the library from the command line are provided.For information about the build process and the IAR Command Line Build Utility, see Building projects.

To use the customized runtime library in your application project:
  1. In the IDE, choose Project>Options>General Options and click the Library Configuration tab.

  2. From the Library drop-down menu, choose Custom.

  3. In the Configuration file text box, locate your library configuration file.

  4. Click the Library tab, also in the Linker category. Use the Additional libraries text box to locate your library file.