Skip to content

Commit 28634f0

Browse files
committed
[Driver] Add linker options to support statical linking to shared flang-rt on AIX.
1 parent 7dce16a commit 28634f0

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

clang/lib/Driver/ToolChains/AIX.cpp

+8-1
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,15 @@ void aix::Linker::ConstructJob(Compilation &C, const JobAction &JA,
127127
}
128128

129129
// Force static linking when "-static" is present.
130-
if (Args.hasArg(options::OPT_static))
130+
if (Args.hasArg(options::OPT_static)) {
131131
CmdArgs.push_back("-bnso");
132+
// The folllowing linker options are needed to statically link to the
133+
// shared libflang_rt.runtime.a on AIX
134+
CmdArgs.push_back("-bI:/usr/lib/syscalls.exp");
135+
CmdArgs.push_back("-bI:/usr/lib/aio.exp");
136+
CmdArgs.push_back("-bI:/usr/lib/threads.exp");
137+
CmdArgs.push_back("-lcrypt");
138+
}
132139

133140
// Add options for shared libraries.
134141
if (Args.hasArg(options::OPT_shared)) {

0 commit comments

Comments
 (0)