[PATCH] D135724: [HIP] Fix unbundling archive
Artem Belevich via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Oct 12 11:02:56 PDT 2022
tra accepted this revision.
tra added a comment.
LGTM
================
Comment at: clang/lib/Driver/ToolChains/CommonArgs.cpp:1839
auto Ext = IsMSVC ? ".lib" : ".a";
- if (!Lib.startswith(":") && llvm::sys::fs::exists(Lib)) {
- ArchiveOfBundles = Lib;
- FoundAOB = true;
+ if (!Lib.startswith(":") && !Lib.startswith("-l")) {
+ if (llvm::sys::fs::exists(Lib)) {
----------------
yaxunl wrote:
> tra wrote:
> > I'm puzzled a bit. What is expected to be in 'Lib' ?
> > If it contains the the whole `-llibrary` option passed by the user, then why do we check for `:` prefix?
> > If it contains whatever was passed via `-l<something>`, but without `-l` itself, then why do we check for `-l` prefix?
> >
> This function is also used for unbundling archive files specified as input files in the clang command line. There are three cases:
>
> For option `-l:xxx`, Lib contains `:xxx`.
>
> For option `-lxxx`, Lib contains `-lxxx`.
>
> For `xxx.a` passed as input file, Lib contains `xxx.a`.
Interesting. It may be worth adding a comment, because this convention is not at all obvious.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D135724/new/
https://reviews.llvm.org/D135724
More information about the cfe-commits
mailing list