News › linux
By Zayden R., September 3, 2026
GCC 17 now supports -mtune=native and -mcpu=native on RISC-V, allowing code generation and tuning for the detected CPU. This update is crucial for developers optimizing performance on RISC-V systems.
In a significant update for RISC-V developers, GCC 17 has merged patches enabling the use of the -mtune=native and -mcpu=native options. This change, anticipated in the GCC 17.1 release slated for early 2027, addresses a long-standing limitation for those targeting RISC-V systems. Previously, developers had to manually specify the CPU type, such as 'sifive-p550' or 'spacemit-x100', to optimize code for their specific hardware. This patch, contributed by SiFive's Kito Cheng, simplifies the process by automatically detecting and tuning for the native CPU.
This enhancement is particularly beneficial for developers working with RISC-V designs that feature multiple core types, like SpacemiT's A100 and X100. However, it's worth noting that GCC currently selects the CPU type based on the core where the compiler process runs, which could be a limitation in certain configurations. Nevertheless, this update represents a solid improvement for the RISC-V ecosystem, making it easier for developers to harness the full potential of their hardware.
With this update, developers can expect more streamlined performance tuning, reducing the overhead of manually configuring build environments. As RISC-V continues to gain traction, improvements like these are crucial for maintaining competitive performance and developer satisfaction.