Interoperability with other build tools
For various reasons, one of which is to be able to generate better code, the IAR compiler and linker are not compliant with the RISC-V ABI specification, and linking with libraries compiled with GCC does not work correctly. Note that the current RISC-V ABI specification is incomplete—it does not define all the support functions that other tools use, only a calling convention.
Some important areas where the IAR Compiler for RISC-V is not compatible with the GCC calling convention for RISC-V are:
vararg's (that is,printf-like functions)Functions that take or return small structs. The IAR Compiler passes these on the stack, not in registers.
Functions that take arguments that require a register pair (for example,
uint64_ton RV32) are in the IAR Compiler passed in aligned register pairs, instead of in unaligned register pairs, which the RISC-V ABI prescribes.
The set of support functions that the IAR Compiler for RISC-V uses is different from what GCC and other tools use.
For more information about the compiler's calling convention, see Calling convention.
Note
If you try to link with a file that was not generated by an IAR tool, you will get an error. To suppress or reclassify this message, see ‑‑diag_suppress or ‑‑diag_warning.