mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[Linux] Reorder the -Xlinker and -l arguments
- Move the -Xlinker and -l options to just before swift_end.o - Add testcase to check linker option ordering.
This commit is contained in:
@@ -1534,8 +1534,6 @@ toolchains::GenericUnix::constructInvocation(const LinkJobAction &job,
|
||||
addPrimaryInputsOfType(Arguments, context.Inputs, types::TY_Object);
|
||||
addInputsOfType(Arguments, context.InputActions, types::TY_Object);
|
||||
|
||||
context.Args.AddAllArgs(Arguments, options::OPT_Xlinker);
|
||||
context.Args.AddAllArgs(Arguments, options::OPT_linker_option_Group);
|
||||
for (const Arg *arg : context.Args.filtered(options::OPT_F,
|
||||
options::OPT_Fsystem)) {
|
||||
if (arg->getOption().matches(options::OPT_Fsystem))
|
||||
@@ -1609,6 +1607,9 @@ toolchains::GenericUnix::constructInvocation(const LinkJobAction &job,
|
||||
Twine("-u", llvm::getInstrProfRuntimeHookVarName())));
|
||||
}
|
||||
|
||||
context.Args.AddAllArgs(Arguments, options::OPT_Xlinker);
|
||||
context.Args.AddAllArgs(Arguments, options::OPT_linker_option_Group);
|
||||
|
||||
// Just before the output option, allow GenericUnix toolchains to add
|
||||
// additional inputs.
|
||||
auto PostInputObjectPath = getPostInputObjectPath(ObjectLibPath);
|
||||
|
||||
Reference in New Issue
Block a user