Most RISC-V toolchains can generate code for all RISC-V targets, but are currently named "riscv32-*" and "riscv64-*". Users have suggested that these names are unintuiative and would like tuples to be "riscv-*".
This patch enables "riscv-*" tuples by adding a config.sub rule that replaces "riscv-*" with "riscv32-*". The first ISA described by the RISC-V specification is RV32I, a 32-bit ISA, so making "riscv-*" mean 32-bit seems like the sane way to go. There are also handful of tests added, which all pass for me. This has been discussed on various mailing lists a half dozen times, but I never got around to submitting a patch. 2018-06-11 Palmer Dabbelt <pal...@sifive.com> * config.sub: Add "riscv-*" as an alias for "riscv32-*". * testsuite/config-sub.data: Add tests for the "riscv-*" alias. CC: Sebastian Huber <sebastian.hu...@embedded-brains.de> Signed-off-by: Palmer Dabbelt <pal...@sifive.com> --- config.sub | 6 ++++++ testsuite/config-sub.data | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/config.sub b/config.sub index d1f5b5490349..32be6f6a56db 100755 --- a/config.sub +++ b/config.sub @@ -1125,6 +1125,12 @@ case $basic_machine in ps2) basic_machine=i386-ibm ;; + riscv) + basic_machine=riscv32-unknown + ;; + riscv-*) + basic_machine=`echo "$basic_machine" | sed 's/^riscv/riscv32/'` + ;; rm[46]00) basic_machine=mips-siemens ;; diff --git a/testsuite/config-sub.data b/testsuite/config-sub.data index 8013ead85eb0..79241bdffec4 100644 --- a/testsuite/config-sub.data +++ b/testsuite/config-sub.data @@ -412,6 +412,11 @@ pyramid pyramid-unknown-none rdos32 i386-pc-rdos rdos64 x86_64-pc-rdos rdos x86_64-pc-rdos +riscv-company-elf riscv32-company-elf +riscv-company-hcos riscv32-company-hcos +riscv-elf riscv32-unknown-elf +riscv-linux riscv32-unknown-linux-gnu +riscv riscv32-unknown-none riscv32-company-elf riscv32-company-elf riscv32-company-hcos riscv32-company-hcos riscv32-elf riscv32-unknown-elf -- 2.16.4 _______________________________________________ config-patches mailing list config-patches@gnu.org https://lists.gnu.org/mailman/listinfo/config-patches