Nios® V Processor Software Developer Handbook

ID 743810
Date 4/01/2024
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

6.11.1. Apply Compiler Flags

riscv32-unknown-elf-gcc is the provided RISC-V toolchain in the Ashling* RiscFree* IDE for Intel® FPGAs. Compiler switch may be of use when optimizing code for small RAM footprints. These switches can be set in the BSP Editor GUI settings for small code footprints.

Table 30.  Compiler Switch
Compiler Switch Value Description
hal.make.cflags_optimization -Os Instructs the toolchain to pervasively optimize for space rather than speed.
Note: You must enable CMAKE_BUILD_TYPE=Release when running cmake command.
hal.make.cflags_user_flags -ffunction-sections -fdata-sections Instructs the toolchain to enable dead code optimization and remove idle sections.
hal.make.link_flags -Wl,--gc-sections Instructs the toolchain to enable dead code optimization and remove idle sections.