summaryrefslogtreecommitdiffstats
path: root/clang/lib/Driver/ToolChains/Arch/RISCV.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Driver/ToolChains/Arch/RISCV.cpp')
-rw-r--r--clang/lib/Driver/ToolChains/Arch/RISCV.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/clang/lib/Driver/ToolChains/Arch/RISCV.cpp b/clang/lib/Driver/ToolChains/Arch/RISCV.cpp
index fc2f9ed5a28..0ba708ef746 100644
--- a/clang/lib/Driver/ToolChains/Arch/RISCV.cpp
+++ b/clang/lib/Driver/ToolChains/Arch/RISCV.cpp
@@ -389,7 +389,9 @@ StringRef riscv::getRISCVABI(const ArgList &Args, const llvm::Triple &Triple) {
if (const Arg *A = Args.getLastArg(options::OPT_mabi_EQ))
return A->getValue();
- // FIXME: currently defaults to the soft-float ABIs. Will need to be
- // expanded to select ilp32f, ilp32d, lp64f, lp64d when appropriate.
- return Triple.getArch() == llvm::Triple::riscv32 ? "ilp32" : "lp64";
+ // RISC-V Linux defaults to ilp32d/lp64d
+ if (Triple.getOS() == llvm::Triple::Linux)
+ return Triple.getArch() == llvm::Triple::riscv32 ? "ilp32d" : "lp64d";
+ else
+ return Triple.getArch() == llvm::Triple::riscv32 ? "ilp32" : "lp64";
}
OpenPOWER on IntegriCloud