Specifying -march=rv32imcb (or any other combination that includes the "b" extension) invariably causes the error message: [hpa@tazenda tmp]$ riscv32-unknown-elf-as -march=rv32imcb -o b-ext.o b-ext.s Assembler messages: Error: cannot find default versions of the ISA extension `b' b-ext.s:2: Error: unrecognized opcode `clz a0,a0' ... many more ... Enumerating sub-extensions work: riscv32-unknown-elf-as -march=rv32imc_zba_zbb_zbc_zbs -o b-ext.o b-ext.s This is using b-ext.s from gas/testsuite/gas/riscv/b-ext.s as test case.
I think this is not a bug. Note that, 'B' will not be a single extension (at least for now) [1] but multiple extensions with 'Zb*' names are be defined and ratified. For instance, upcoming RVA22U64 profile [2] considers following extensions mandatory: - Zba (address computation) - Zbb (basic bit manipulation) - Zbs (single-bit fiddling) and following extensions unsupported optional: - Zbc (carry-less multiply) - Zbkb (crypto-related subextension) - Zbkc (crypto-related subextension) - Zbkx (crypto-related subextension) Try using those extensions instead. [1]: https://github.com/riscv/riscv-isa-manual/commit/c1c77c4902d5e7c58613d725d09d66a2a743da1c [2]: https://github.com/riscv/riscv-profiles/blob/main/profiles.adoc
Consider this, https://github.com/bminor/binutils-gdb/commit/3a3e333f65483b864bf2624392f8aa4a88c7a498. Since the base b extension hasn't been ratified, so marked as RESOLVED and NOTABUG.