When -lxxx is specified, if there happens to have a directory or
file with name xxx, clang will not look up libxxx.a, but will
try to unbundle xxx instead.
Details
- Reviewers
tra saiislam - Commits
- rG12c6a41f5249: [HIP] Fix unbundling archive
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
clang/lib/Driver/ToolChains/CommonArgs.cpp | ||
---|---|---|
1866–1870 | I'm puzzled a bit. What is expected to be in 'Lib' ? |
clang/lib/Driver/ToolChains/CommonArgs.cpp | ||
---|---|---|
1866–1870 | 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. |
LGTM
clang/lib/Driver/ToolChains/CommonArgs.cpp | ||
---|---|---|
1866–1870 | Interesting. It may be worth adding a comment, because this convention is not at all obvious. |
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?