[PATCH] D127709: [LLD][COFF] Convert file name to lowercase when inserting it into visitedLibs

Pengxuan Zheng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 15 09:39:50 PDT 2022


This revision was automatically updated to reflect the committed changes.
Closed by commit rG9db61c3fe18a: [LLD][COFF] Convert file name to lowercase when inserting it into visitedLibs (authored by pzheng).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D127709/new/

https://reviews.llvm.org/D127709

Files:
  lld/COFF/Driver.cpp
  lld/test/COFF/visitedlibs.test


Index: lld/test/COFF/visitedlibs.test
===================================================================
--- /dev/null
+++ lld/test/COFF/visitedlibs.test
@@ -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'
Index: lld/COFF/Driver.cpp
===================================================================
--- lld/COFF/Driver.cpp
+++ lld/COFF/Driver.cpp
@@ -473,7 +473,7 @@
   }
 
   if (path.endswith_insensitive(".lib"))
-    visitedLibs.insert(std::string(sys::path::filename(path)));
+    visitedLibs.insert(std::string(sys::path::filename(path).lower()));
   return path;
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D127709.437218.patch
Type: text/x-patch
Size: 895 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220615/af70a787/attachment.bin>


More information about the llvm-commits mailing list