[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
Mon Jan 24 16:08:31 PST 2022


MaskRay added a comment.

In D117933#3267868 <https://reviews.llvm.org/D117933#3267868>, @bd1976llvm wrote:

> I would rather keep the search scheme as simple and general as possible. The ".a" and ".so" suffixes are just conventions (not part of the ELF standard). My hope was to make the autolinking scheme implementable by any ELF linker.
>
> LGTM to the proposed fix from me. If memory serves, I experimented with the same approach (as proposed here) when autolinking was first implemented; however, I decided to make the code as minimal as possible and see what fell out from real world usage as It wasn't clear to me what problems build systems would be able to workaround vs which would be blockers.

If we want to keep minimum code, we can just swap searchLibraryBaseName and findFromSearchPaths branches.

I'd really liked that the feature started with `-lpthread` in the first place if it were augmented with the ability to link an arbitrary absolute/relative path, since that is unambiguous.
Perhaps the ship has sailed now.


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