[clang] [llvm] [flang-rt] Pass the whole path of libflang_rt.runtime.a to linker on AIX (PR #131041)

via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 17 17:50:57 PDT 2025


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff 6616acd80cd91a0075e3cd481bb9a6d82fd4ea9e 7ab3382e11226d8a519402224f81a15f2ac40180 --extensions h,cpp -- clang/include/clang/Driver/ToolChain.h clang/lib/Driver/ToolChain.cpp clang/lib/Driver/ToolChains/AIX.cpp clang/lib/Driver/ToolChains/AIX.h clang/lib/Driver/ToolChains/AVR.cpp clang/lib/Driver/ToolChains/AVR.h clang/lib/Driver/ToolChains/CommonArgs.cpp clang/lib/Driver/ToolChains/CommonArgs.h clang/lib/Driver/ToolChains/Darwin.cpp clang/lib/Driver/ToolChains/Darwin.h clang/lib/Driver/ToolChains/DragonFly.cpp clang/lib/Driver/ToolChains/FreeBSD.cpp clang/lib/Driver/ToolChains/Gnu.cpp clang/lib/Driver/ToolChains/Haiku.cpp clang/lib/Driver/ToolChains/MSVC.cpp clang/lib/Driver/ToolChains/MinGW.cpp clang/lib/Driver/ToolChains/MipsLinux.cpp clang/lib/Driver/ToolChains/MipsLinux.h clang/lib/Driver/ToolChains/NetBSD.cpp clang/lib/Driver/ToolChains/OHOS.cpp clang/lib/Driver/ToolChains/OHOS.h clang/lib/Driver/ToolChains/OpenBSD.cpp clang/lib/Driver/ToolChains/OpenBSD.h clang/lib/Driver/ToolChains/PPCLinux.cpp clang/lib/Driver/ToolChains/PPCLinux.h clang/lib/Driver/ToolChains/Solaris.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/clang/lib/Driver/ToolChains/AIX.cpp b/clang/lib/Driver/ToolChains/AIX.cpp
index 055385bd56..b37563bd85 100644
--- a/clang/lib/Driver/ToolChains/AIX.cpp
+++ b/clang/lib/Driver/ToolChains/AIX.cpp
@@ -625,8 +625,8 @@ void AIX::addFortranRuntimeLibs(const ArgList &Args,
                                 llvm::opt::ArgStringList &CmdArgs) const {
   // Link flang_rt.runtime.a. On AIX, the static and shared library are all
   // named .a
-  CmdArgs.push_back(getCompilerRTArgString(
-      Args, "runtime", ToolChain::FT_Static, true));
+  CmdArgs.push_back(
+      getCompilerRTArgString(Args, "runtime", ToolChain::FT_Static, true));
 }
 
 ToolChain::CXXStdlibType AIX::GetDefaultCXXStdlibType() const {
diff --git a/clang/lib/Driver/ToolChains/PPCLinux.cpp b/clang/lib/Driver/ToolChains/PPCLinux.cpp
index 62ac6509c3..007099c69d 100644
--- a/clang/lib/Driver/ToolChains/PPCLinux.cpp
+++ b/clang/lib/Driver/ToolChains/PPCLinux.cpp
@@ -107,9 +107,8 @@ void PPCLinuxToolChain::addFortranRuntimeLibs(
     const ArgList &Args, llvm::opt::ArgStringList &CmdArgs) const {
   // Link static flang_rt.runtime.a or shared flang_rt.runtime.so
   const char *Path;
-  if (getVFS().exists(Twine(
-          Path = getCompilerRTArgString(Args, "runtime", ToolChain::FT_Static,
-                                        true))))
+  if (getVFS().exists(Twine(Path = getCompilerRTArgString(
+                                Args, "runtime", ToolChain::FT_Static, true))))
     CmdArgs.push_back(Path);
   else if (getVFS().exists(Twine(Path = getCompilerRTArgString(
                                      Args, "runtime", ToolChain::FT_Shared,

``````````

</details>


https://github.com/llvm/llvm-project/pull/131041


More information about the llvm-commits mailing list