@@ -142,6 +142,14 @@ static void addLTOArgs(const OutputInfo &OI, ArgStringList &arguments) {
142
142
}
143
143
}
144
144
145
+ static void addLinkedLibArgs (const ArgList &Args, ArgStringList &FrontendArgs) {
146
+ for (auto Arg:Args.getAllArgValues (options::OPT_l))
147
+ {
148
+ std::string* lArg = new std::string (" -l" + Arg);
149
+ FrontendArgs.push_back (lArg->c_str ());
150
+ }
151
+ }
152
+
145
153
void ToolChain::addCommonFrontendArgs (const OutputInfo &OI,
146
154
const CommandOutput &output,
147
155
const ArgList &inputArgs,
@@ -842,7 +850,8 @@ ToolChain::constructInvocation(const InterpretJobAction &job,
842
850
Arguments.push_back (" -module-name" );
843
851
Arguments.push_back (context.Args .MakeArgString (context.OI .ModuleName ));
844
852
845
- context.Args .AddAllArgs (Arguments, options::OPT_l, options::OPT_framework);
853
+ context.Args .AddAllArgs (Arguments, options::OPT_framework);
854
+ addLinkedLibArgs (context.Args , Arguments);
846
855
847
856
// The immediate arguments must be last.
848
857
context.Args .AddLastArg (Arguments, options::OPT__DASH_DASH);
@@ -1190,8 +1199,8 @@ ToolChain::constructInvocation(const REPLJobAction &job,
1190
1199
addRuntimeLibraryFlags (context.OI , FrontendArgs);
1191
1200
1192
1201
context.Args .AddLastArg (FrontendArgs, options::OPT_import_objc_header);
1193
- context.Args .AddAllArgs (FrontendArgs, options::OPT_l , options::OPT_framework,
1194
- options::OPT_L );
1202
+ context.Args .AddAllArgs (FrontendArgs, options::OPT_framework , options::OPT_L);
1203
+ addLinkedLibArgs (context. Args , FrontendArgs );
1195
1204
1196
1205
if (!useLLDB) {
1197
1206
FrontendArgs.insert (FrontendArgs.begin (), {" -frontend" , " -repl" });
0 commit comments