[PATCH] D117933: [ELF] Don't consider directories of the same name as libraries

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 28 09:22:23 PST 2022


MaskRay added a comment.

In D117933#3278789 <https://reviews.llvm.org/D117933#3278789>, @phosek wrote:

> In D117933#3277690 <https://reviews.llvm.org/D117933#3277690>, @MaskRay wrote:
>
>> In D117933#3277661 <https://reviews.llvm.org/D117933#3277661>, @phosek wrote:
>>
>>> Have we reached a decision on this? I'd like to land this change since it's currently blocking a Clang roll for us.
>>
>> Just swap searchLibraryBaseName and findFromSearchPaths branches. It's the simplest/least intrusive fix.
>
> That alone is not sufficient if the directory with the same name exists in the current directory as is the case in the attached test case, since we'll take this branch https://github.com/llvm/llvm-project/blob/249a21ab188419b019adea21716f5c779c063de3/lld/ELF/InputFiles.cpp#L493 and fail.

OK. Then move `searchLibraryBaseName` to the top. I think the comment https://reviews.llvm.org/D117933#3267443 is also relevant to decrease the number of filesystem probing.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D117933



More information about the llvm-commits mailing list