Skip to content

Commit 54eb891

Browse files
committed
Make the addtional import list for static linking for flang invocation only.
1 parent 21f3ec3 commit 54eb891

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

clang/lib/Driver/ToolChains/AIX.cpp

+9-6
Original file line numberDiff line numberDiff line change
@@ -129,12 +129,15 @@ void aix::Linker::ConstructJob(Compilation &C, const JobAction &JA,
129129
// Force static linking when "-static" is present.
130130
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");
132+
133+
if (D.IsFlangMode()) {
134+
// The folllowing linker options are needed to statically link to the
135+
// shared libflang_rt.runtime.a on AIX
136+
CmdArgs.push_back("-bI:/usr/lib/syscalls.exp");
137+
CmdArgs.push_back("-bI:/usr/lib/aio.exp");
138+
CmdArgs.push_back("-bI:/usr/lib/threads.exp");
139+
CmdArgs.push_back("-lcrypt");
140+
}
138141
}
139142

140143
// Add options for shared libraries.

0 commit comments

Comments
 (0)