mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-12-11 08:48:12 +00:00
[LLD][COFF] Convert file name to lowercase when inserting it into visitedLibs
It seems to be a bug in `LinkerDriver::findFile`, the file name is not converted to lowercase when being inserted into `visitedLibs`. This is the only exception in the file and all other places always convert file names to lowercase when inserting them into `visitedLibs` (or `visitedFiles`). Reviewed By: thieta, hans Differential Revision: https://reviews.llvm.org/D127709
This commit is contained in:
parent
ac2ad3b7bb
commit
9db61c3fe1
@ -473,7 +473,7 @@ Optional<StringRef> LinkerDriver::findFile(StringRef filename) {
|
||||
}
|
||||
|
||||
if (path.endswith_insensitive(".lib"))
|
||||
visitedLibs.insert(std::string(sys::path::filename(path)));
|
||||
visitedLibs.insert(std::string(sys::path::filename(path).lower()));
|
||||
return path;
|
||||
}
|
||||
|
||||
|
10
lld/test/COFF/visitedlibs.test
Normal file
10
lld/test/COFF/visitedlibs.test
Normal file
@ -0,0 +1,10 @@
|
||||
# RUN: rm -rf %t && mkdir -p %t
|
||||
# RUN: cp %S/Inputs/hello64.obj %t
|
||||
# RUN: cp %S/Inputs/std64.lib %t/STD64.lib
|
||||
|
||||
# RUN: lld-link %t/STD64.lib /out:%t.exe /entry:main \
|
||||
# RUN: /subsystem:console %t/hello64.obj /defaultlib:STD64.lib \
|
||||
# RUN: /verbose 2>&1 | FileCheck %s
|
||||
|
||||
CHECK: Reading {{.*}}/STD64.lib
|
||||
CHECK-NOT: could not open 'STD64.lib'
|
Loading…
Reference in New Issue
Block a user