================
@@ -127,9 +127,19 @@ void aix::Linker::ConstructJob(Compilation &C, const 
JobAction &JA,
   }
 
   // Force static linking when "-static" is present.
-  if (Args.hasArg(options::OPT_static))
+  if (Args.hasArg(options::OPT_static)) {
     CmdArgs.push_back("-bnso");
 
+    if (D.IsFlangMode()) {
+      // The folllowing linker options are needed to statically link to the
+      // shared libflang_rt.runtime.a on AIX
+      CmdArgs.push_back("-bI:/usr/lib/syscalls.exp");
+      CmdArgs.push_back("-bI:/usr/lib/aio.exp");
+      CmdArgs.push_back("-bI:/usr/lib/threads.exp");
+      CmdArgs.push_back("-lcrypt");
+    }
----------------
hubert-reinterpretcast wrote:

> As the driver code is written in PR #131041, `libflang_rt.runtime.a` is 
> always linked in with the full path name no matter if it is static or shared.

The other PR does not change the lines I referenced in a way that causes 
`libflang_rt.runtime.a` to _always_ be linked in.

https://github.com/llvm/llvm-project/pull/131822
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to