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
}
if (path.endswith_insensitive(".lib"))
- visitedLibs.insert(std::string(sys::path::filename(path)));
+ visitedLibs.insert(std::string(sys::path::filename(path).lower()));
return path;
}
--- /dev/null
+# 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'