summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lld/COFF/Driver.cpp2
-rw-r--r--lld/test/COFF/libpath.test8
2 files changed, 10 insertions, 0 deletions
diff --git a/lld/COFF/Driver.cpp b/lld/COFF/Driver.cpp
index 0855d627af4..835c4b396ef 100644
--- a/lld/COFF/Driver.cpp
+++ b/lld/COFF/Driver.cpp
@@ -315,6 +315,8 @@ Optional<StringRef> LinkerDriver::findFile(StringRef Filename) {
bool Seen = !VisitedFiles.insert(Path.lower()).second;
if (Seen)
return None;
+ if (Path.endswith_lower(".lib"))
+ VisitedLibs.insert(sys::path::filename(Path));
return Path;
}
diff --git a/lld/test/COFF/libpath.test b/lld/test/COFF/libpath.test
index 1e1ce0908e8..77b4c546c99 100644
--- a/lld/test/COFF/libpath.test
+++ b/lld/test/COFF/libpath.test
@@ -16,3 +16,11 @@ CHECK1: b{{[/\\]}}std64.lib
# RUN: FileCheck -check-prefix=CHECK2 %s < %t.log
CHECK2: a{{[/\\]}}std64.lib
+
+# RUN: lld-link /out:%t.exe /entry:main /verbose \
+# RUN: %t/a/std64.lib /subsystem:console %p/Inputs/hello64.obj \
+# RUN: /libpath:%t/b /verbose > %t.log 2>&1
+# RUN: FileCheck -check-prefix=CHECK3 %s < %t.log
+
+CHECK3: Reading {{.*}}a/std64.lib
+CHECK3-NOT: Reading {{.*}}b/std64.lib
OpenPOWER on IntegriCloud