Skip to main content

IAR Embedded Workbench for RISC-V 3.40

Prebuilt runtime libraries

In this section:

The prebuilt runtime libraries are configured for different combinations of these options:

  • The C/C++ library (DLIB or Libc++)

  • Base integer instruction set—RV32E, RV32I, or RV64I

  • Support for multiplication and division instructions

  • Support for atomic operations

  • FPU support

  • Support for compressed instructions

  • Library configuration—Normal or Full.

The linker will automatically include the correct library files and library configuration file. To explicitly specify a library configuration, use the ‑‑dlib_config compiler option. However, the Full library configuration is the only configuration that exists for Libc++. The ‑‑dlib_config compiler option cannot be used to specify another configuration.

Note

The prebuilt runtime libraries for the RV64I instruction set are built using the Medany code model, but are compatible with both code models.

Tip

To see which runtime library files that the linker includes, use the linker option ‑‑log libraries, see ‑‑log.

Library filename syntax

The names of the prebuilt runtime libraries consist of two main elements, separated by a hyphen (-), for example, canx-rv32ic, dl-rv32imc, and dllibcppmathf-rv32im. The first element—before the hyphen—describes the kind of library and type of feature support, and the second element—after the hyphen—describes which RISC-V core extensions that are supported, where fx and dx correspond to the Zfinx and Zdinx extensions, respectively. Note that some kinds of libraries support more core extensions than are explicitly indicated by the filename.

First element of library name

Kind of library and feature support

ap

A handful of carefully tailored string functions that make use of the AndeStar™ V5 Performance extension for RV32. If the linker’s automatic library selection is not used, this library should be specified before the standard dl library.

atomic

Functions that support atomic operations.

bm

String and memory routines for the Zbb bitmanip extension.

c{a|anx|c|g|n|t}

Functions that initialize the interrupt vector table before the execution reaches the main function. The appropriate library will be used if the linker option ‑‑auto_vector_setup is used and the linker configuration file supports the functionality. The letter(s) after the c identifies the method used.

dbg

Functions for C-SPY emulated I/O.

dbgs

Functions for debug I/O that follow the RISC-V semihosting specification. See also The semihosting mechanism.

di

Libraries with a default interrupt handler.

dl

Functions defined by Standard C, for example functions like printf and scanf. Note that this library does not include mathematical functions.

dl{f|n}

C standard library functions in the Full (f) or Normal (n) DLIB configuration.

dllibcppf

Libc++ functions defined by C++, compiled with support for C++17. This kind of library only exists in the Full DLIB configuration.

dllibcppmathf

Libc++ mathematical functions defined by C++, compiled with support for C++17. This kind of library only exists in the Full DLIB configuration.

dlmath

C standard library mathematical functions.

dlmath{f|n}

The C standard library mathematical functions in the Full (f) or Normal (n) DLIB configuration.

dlpp{f|n}

Functions defined by C++, compiled with support for C++14, in the Full (f) or Normal (n) DLIB configuration.

th{f|n}

Thread support functions in the Full (f) or Normal (n) DLIB configuration.

tz

Timezone and daylight saving time functions.

Table 57. Explanations of the first element of runtime library names 


For example, the library dlmathn-rv32imdc. contains C standard library mathematical functions in the Normal DLIB configuration, for RV32IMDC and RV32IMDAC cores.

You can find the library object files in the directory riscv\lib\ and the library configuration files in the directory riscv\inc\c\.