Move linker arguments to the end

This commit is contained in:
Keith Smiley
2018-07-27 14:34:00 -07:00
parent 577b18f86d
commit 1f4e643d42
3 changed files with 13 additions and 8 deletions

View File

@@ -210,9 +210,6 @@ toolchains::GenericUnix::constructInvocation(const LinkJobAction &job,
SmallString<128> StaticRuntimeLibPath;
getRuntimeLibraryPath(StaticRuntimeLibPath, context.Args, /*Shared=*/false);
context.Args.AddAllArgs(Arguments, options::OPT_Xlinker);
context.Args.AddAllArgs(Arguments, options::OPT_linker_option_Group);
// Add the runtime library link path, which is platform-specific and found
// relative to the compiler.
if (!(staticExecutable || staticStdlib) && shouldProvideRPathToLinker()) {
@@ -325,6 +322,10 @@ toolchains::GenericUnix::constructInvocation(const LinkJobAction &job,
Arguments.push_back("-v");
}
// These custom arguments should be right before the object file at the end
context.Args.AddAllArgs(Arguments, options::OPT_Xlinker);
context.Args.AddAllArgs(Arguments, options::OPT_linker_option_Group);
// This should be the last option, for convenience in checking output.
Arguments.push_back("-o");
Arguments.push_back(