mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-12-14 03:29:57 +00:00
Do not read the same .lib file more than once.
In the following command line, lld-link foo/bar.lib /defaultlib:bar.lib "/defaultlib:bar.lib" should be a nop even if a file with the same name exists in other library search path. Fixes https://bugs.llvm.org/show_bug.cgi?id=35476 Differential Revision: https://reviews.llvm.org/D41094 llvm-svn: 320434
This commit is contained in:
parent
9d8ce23c9c
commit
b59ceb1068
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user