================ @@ -127,9 +127,18 @@ 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"); ---------------- daltenty wrote:
I think this is a bit misplaced, IIUC these options are needed to link `libc` statically, not `flang_rt` itself (`-static` just happens to mean we link both). Thus, I think this belongs where we push_back `-lc` for the AIX toolchain, not here: https://github.com/llvm/llvm-project/blob/28907a624a8d9561badc20d77254791918ba6210/clang/lib/Driver/ToolChains/AIX.cpp#L357 Also, I don't think this really belongs under the `-static` option, that is really an `ld` option which says, only link to static libs. Typically there are separate options to link particular runtimes statically. Since this is really for `libc`, I'd suggest `-static-libc`. 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