summaryrefslogtreecommitdiffstats
path: root/clang/lib/Driver/ToolChains
diff options
context:
space:
mode:
authorRoger Ferrer Ibanez <rofirrim@gmail.com>2019-09-10 07:57:36 +0000
committerRoger Ferrer Ibanez <rofirrim@gmail.com>2019-09-10 07:57:36 +0000
commit8e87396307f0e395e75196707b8b2614035ff57c (patch)
tree22769d6020a58a5564614a4d0b67d537d6462539 /clang/lib/Driver/ToolChains
parente8b432fa0e75430c03552b1d36e4ac468843ce57 (diff)
downloadbcm5719-llvm-8e87396307f0e395e75196707b8b2614035ff57c.tar.gz
bcm5719-llvm-8e87396307f0e395e75196707b8b2614035ff57c.zip
[RISCV] Default to ilp32d/lp64d in RISC-V Linux
When running clang as a native compiler in RISC-V Linux the flag -mabi=ilp32d / -mabi=lp64d is always mandatory. This change makes it the default there. Differential Revision: https://reviews.llvm.org/D65634 llvm-svn: 371494
Diffstat (limited to 'clang/lib/Driver/ToolChains')
-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