COFF: /libpath should not take precedence over the current directory.

llvm-svn: 238683
This commit is contained in:
Rui Ueyama 2015-05-31 20:20:37 +00:00
parent 0613747e1a
commit f4784cce54

View File

@ -209,9 +209,11 @@ bool LinkerDriver::link(int Argc, const char *Argv[]) {
Config->MachineType = MTOrErr.get(); Config->MachineType = MTOrErr.get();
// Handle /libpath // Handle /libpath
// (Inserting at front of a vector is okay because it's short.) for (auto *Arg : Args->filtered(OPT_libpath)) {
for (auto *Arg : Args->filtered(OPT_libpath)) // Inserting at front of a vector is okay because it's short.
SearchPaths.insert(SearchPaths.begin(), Arg->getValue()); // +1 because the first entry is always "." (current directory).
SearchPaths.insert(SearchPaths.begin() + 1, Arg->getValue());
}
// Handle /nodefaultlib:<filename> // Handle /nodefaultlib:<filename>
for (auto *Arg : Args->filtered(OPT_nodefaultlib)) for (auto *Arg : Args->filtered(OPT_nodefaultlib))