RISC-V: Specify -mcpu When --with-cpu Is Used
The compiler now consistently uses `-mcpu` instead of `-march` when the `--with-cpu` option is used for RISC-V, aligning its behavior with explicit `-mcpu` usa…
This commit addresses an inconsistency in how the --with-cpu option is handled for RISC-V architectures. Previously, it specified only the -march option, which defines the instruction set architecture. This commit changes the behavior to specify -mcpu instead, which encompasses both -march (architecture) and -mtune (tuning for a specific processor), ensuring that --with-cpu acts consistently with an explicit -mcpu option. This change provides a more complete and expected configuration for users.
In Details
Commit 5be645a introduced support for --with-cpu, which specified an -march option. This commit changes this behavior to specify -mcpu instead of -march when --with-cpu is used, aligning its behavior with explicit -mcpu usage which involves both -march and -mtune.
For Context
When compiling code for RISC-V processors, the -mcpu option allows developers to specify the target processor. This setting influences both the instruction set used (-march) and how the compiler optimizes the code for that specific processor (-mtune). This commit ensures that using the --with-cpu configuration option behaves the same way as using the -mcpu option directly, offering a more consistent and complete way to configure the compiler.