[PATCH 2/8] RISC-V: Don't allow any uppercase letter in the arch string.

Nelson Chu nelson.chu@sifive.com
Fri Nov 27 13:23:01 GMT 2020


Hi Andreas,

On Fri, Nov 27, 2020 at 7:57 PM Andreas Schwab <schwab@linux-m68k.org> wrote:
> What about non-letters?

The non-letters are usually regarded as unknown extensions.  In fact,
you will get different errors depending on which parsing stage has
parsed the non-letters.  For example,

~$ riscv64-unknown-linux-gnu-as -march=rv,64 empty.s
Assembler messages:
Error: -march=rv,64: ISA string must begin with rv32 or rv64

~$ riscv64-unknown-linux-gnu-as -march=rv64? empty.s
Assembler messages:
Error: -march=rv64?: first ISA extension must be `e', `i' or `g'

~$ riscv64-unknown-linux-gnu-as -march=rv64g? empty.s
Assembler messages:
Error: -march=rv64g?: unknown standard ISA extension `?'

~$ riscv64-unknown-linux-gnu-as -march=rv64g_z$ empty.s
Assembler messages:
Error: -march=rv64g_z$: unknown z ISA extension `z$'

~$ riscv64-unknown-linux-gnu-as -misa-spec=20191213 -march=rv64g_zicsr_$ empty.s
Assembler messages:
Error: -march=rv64g_zicsr_$: unexpected ISA string at end: $

Originally, we treated the uppercase letters the same as the
non-letters.  Therefore, you should get various types of errors when
you set the uppercases letters in the arch string by accident.  I had
heard that LLVM will report the exact "string must be lowercase" error
for the arch string, so I also did the similar check in this patch for
GNU binutils.

Thanks
Nelson


More information about the Binutils mailing list