forked from OSchip/llvm-project
COFF: Add search paths in the correct order.
Previously, we added search paths in reverse order. llvm-svn: 240180
This commit is contained in:
parent
7f2a0d2c04
commit
165b254e06
|
@ -288,11 +288,8 @@ bool LinkerDriver::link(int Argc, const char *Argv[]) {
|
||||||
Config->MachineType = MTOrErr.get();
|
Config->MachineType = MTOrErr.get();
|
||||||
|
|
||||||
// Handle /libpath
|
// Handle /libpath
|
||||||
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.push_back(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))
|
||||||
|
|
|
@ -0,0 +1,26 @@
|
||||||
|
# RUN: mkdir -p %t/a %t/b
|
||||||
|
# RUN: cp %p/Inputs/std64.lib %t/a/
|
||||||
|
# RUN: cp %p/Inputs/std64.lib %t/b/
|
||||||
|
|
||||||
|
# RUN: env LIB=%t/a lld -flavor link2 /out:%t.exe /entry:main /verbose \
|
||||||
|
# RUN: std64.lib /subsystem:console \
|
||||||
|
# RUN: %p/Inputs/hello64.obj /libpath:%t/b >& %t.log
|
||||||
|
# RUN: FileCheck -check-prefix=CHECK1 %s < %t.log
|
||||||
|
|
||||||
|
# RUN: lld -flavor link2 /out:%t.exe /entry:main /verbose std64.lib \
|
||||||
|
# RUN: /subsystem:console %p/Inputs/hello64.obj \
|
||||||
|
# RUN: /libpath:%t/a /libpath:%t/b >& %t.log
|
||||||
|
# RUN: FileCheck -check-prefix=CHECK1 %s < %t.log
|
||||||
|
|
||||||
|
CHECK1: Reading {{.*}}/a/std64.lib
|
||||||
|
|
||||||
|
# RUN: env LIB=%t/b lld -flavor link2 /out:%t.exe /entry:main /verbose \
|
||||||
|
# RUN: /subsystem:console std64.lib %p/Inputs/hello64.obj \
|
||||||
|
# RUN: /libpath:%t/a >& %t.log
|
||||||
|
# RUN: FileCheck -check-prefix=CHECK2 %s < %t.log
|
||||||
|
|
||||||
|
# RUN: lld -flavor link2 /out:%t.exe /entry:main /verbose /subsystem:console \
|
||||||
|
# RUN: std64.lib %p/Inputs/hello64.obj /libpath:%t/b /libpath:%t/a >& %t.log
|
||||||
|
# RUN: FileCheck -check-prefix=CHECK2 %s < %t.log
|
||||||
|
|
||||||
|
CHECK2: Reading {{.*}}/b/std64.lib
|
Loading…
Reference in New Issue