[PATCH] D133705: [HIP] Fix unbundling archive

Artem Belevich via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 15 16:24:55 PDT 2022


tra added a comment.

In D133705#3785470 <https://reviews.llvm.org/D133705#3785470>, @yaxunl wrote:

>> Also, using `lib*.a` as pattern to tell device libraries from the host-ony one will be insufficient. There will be libraries with other extensions (e.g. `.lo` is fairly common) and there will be libraries that do not have `lib` prefix. I.e. nothing stops me from building `mylib.a` and linking with it as in the example above.
>
> For archives passed as input files, we use the extension ('.a' on Linux and '.lib' on MSVC) to identify them. We do not restrict the file names to 'lib*.a', but they need to be '*.a' or '*.lib' to be identified as archives.

As I've pointed above that will create issues.

> For arbitrary file names to be identified as archives, users can pass them by '-l:', e.g. '-l:file.bin', then clang will treat 'file.bin' as an archive.

It's not always possible. Linking with dependencies is often handled by the build tools that the end user may not control. E.g. TF is built w/ `bazel` which handles virtually all linking under the hood with almost no user controls over the names/extensions it assigns to files or how they are passed to the linker.

@MaskRay - WDYT?


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

https://reviews.llvm.org/D133705



More information about the cfe-commits mailing list