diff options
| author | Roger Ferrer Ibanez <rofirrim@gmail.com> | 2019-09-10 07:57:36 +0000 |
|---|---|---|
| committer | Roger Ferrer Ibanez <rofirrim@gmail.com> | 2019-09-10 07:57:36 +0000 |
| commit | 8e87396307f0e395e75196707b8b2614035ff57c (patch) | |
| tree | 22769d6020a58a5564614a4d0b67d537d6462539 /clang/lib/Driver/ToolChains | |
| parent | e8b432fa0e75430c03552b1d36e4ac468843ce57 (diff) | |
| download | bcm5719-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.cpp | 8 |
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"; } |

