[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
Mon Jun 13 19:47:21 PDT 2022


pzheng created this revision.
pzheng added reviewers: ruiu, rnk, thieta, thakis, hans, mstorsjo.
Herald added a project: All.
pzheng requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

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`).


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D127709

Files:
  lld/COFF/Driver.cpp


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.436628.patch
Type: text/x-patch
Size: 371 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220614/fd29525c/attachment.bin>


More information about the llvm-commits mailing list