diff --git a/clang/lib/Driver/ToolChains/Arch/RISCV.cpp b/clang/lib/Driver/ToolChains/Arch/RISCV.cpp --- a/clang/lib/Driver/ToolChains/Arch/RISCV.cpp +++ b/clang/lib/Driver/ToolChains/Arch/RISCV.cpp @@ -294,7 +294,7 @@ return "rv32imafdc"; else if (MABI.starts_with_insensitive("lp64")) { if (Triple.isAndroid()) - return "rv64imafdc_zbb"; + return "rv64imafdc_zba_zbb_zbs"; return "rv64imafdc"; } @@ -314,7 +314,7 @@ if (Triple.getOS() == llvm::Triple::UnknownOS) return "rv64imac"; else if (Triple.isAndroid()) - return "rv64imafdc_zbb"; + return "rv64imafdc_zba_zbb_zbs"; else return "rv64imafdc"; } diff --git a/clang/test/Driver/riscv-features.c b/clang/test/Driver/riscv-features.c --- a/clang/test/Driver/riscv-features.c +++ b/clang/test/Driver/riscv-features.c @@ -10,7 +10,9 @@ // RUN: %clang --target=riscv32-unknown-elf -### %s -mrelax 2>&1 | FileCheck %s -check-prefix=RELAX // RUN: %clang --target=riscv32-unknown-elf -### %s -mno-relax 2>&1 | FileCheck %s -check-prefix=NO-RELAX +// ANDROID: "-target-feature" "+zba" // ANDROID: "-target-feature" "+zbb" +// ANDROID: "-target-feature" "+zbs" // RELAX: "-target-feature" "+relax" // NO-RELAX: "-target-feature" "-relax" // DEFAULT: "-target-feature" "+relax"