aboutsummaryrefslogtreecommitdiff
path: root/flang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@sifive.com>2025-02-13 08:08:09 -0800
committerGitHub <noreply@github.com>2025-02-13 08:08:09 -0800
commit8da8ff8768bc0115f21d7d8fe8d47872190f8de1 (patch)
tree1bba09ad0b5ff23b0679410e2291c244652d5b36 /flang/lib/Frontend/CompilerInvocation.cpp
parent21811818d6c1a50051032fdb2d350ffe89e1421a (diff)
downloadllvm-8da8ff8768bc0115f21d7d8fe8d47872190f8de1.zip
llvm-8da8ff8768bc0115f21d7d8fe8d47872190f8de1.tar.gz
llvm-8da8ff8768bc0115f21d7d8fe8d47872190f8de1.tar.bz2
[flang][RISCV] Add target-abi ModuleFlag. (#126188)
This is needed to generate proper ABI flags in the ELF header for LTO builds. If these flags aren't set correctly, we can't link with objects that were built with the correct flags. For non-LTO builds the mcpu/mattr in the TargetMachine will cause the backend to infer an ABI. For LTO builds the mcpu/mattr aren't set. I've only added lp64, lp64f, and lp64d ABIs. ilp32* requires riscv32 which is not yet supported in flang. lp64e requires a different DataLayout string and would need additional plumbing. Fixes #115679
Diffstat (limited to 'flang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r--flang/lib/Frontend/CompilerInvocation.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/flang/lib/Frontend/CompilerInvocation.cpp b/flang/lib/Frontend/CompilerInvocation.cpp
index d4d3971..f3d9432 100644
--- a/flang/lib/Frontend/CompilerInvocation.cpp
+++ b/flang/lib/Frontend/CompilerInvocation.cpp
@@ -464,6 +464,7 @@ static void parseTargetArgs(TargetOptions &opts, llvm::opt::ArgList &args) {
if (const llvm::opt::Arg *a =
args.getLastArg(clang::driver::options::OPT_mabi_EQ)) {
+ opts.abi = a->getValue();
llvm::StringRef V = a->getValue();
if (V == "vec-extabi") {
opts.EnableAIXExtendedAltivecABI = true;