[PATCH] D133705: [HIP] Fix unbundling archive

Yaxun Liu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 15 17:58:40 PDT 2022


yaxunl added a comment.

In D133705#3793931 <https://reviews.llvm.org/D133705#3793931>, @MaskRay wrote:

> I know very little about HIP, but I am concerned with relying on extensions as well. For example, I've seen `libc++.a.1` (we use this for the real archive while `libc++.a` is a linker script) and `.la` (libtool).
> A `.so` file is sometimes a linker script and it may reference an archive file. For example glibc `libc.so` typically does something like `GROUP ( /lib/x86_64-linux-gnu/libc.so.6 /usr/lib/x86_64-linux-gnu/libc_nonshared.a  AS_NEEDED ( /lib64/ld-linux-x86-64.so.2 ) )`
>
> An ELF linker doesn't really care what extensions are used for what kind of input (archive,relocatable file,shared object). `.a` and `.so` are only used for `-lfoo` lookup.

For HIP, we only need to unbundle archive files. We always try to unbundle files passed by `-l` options. If it is not archive files, it is OK, since the unbundled will generate an empty file. For input files, the current patch only tries to unbundle '*.a' or '*.lib' files. If it is a concern that some archive files not with extension '*.a' or '*.lib' are missed, one solution might be to try to unbundle any files classified as 'Nothing' (which is how clang classifies archive files).


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

https://reviews.llvm.org/D133705



More information about the cfe-commits mailing list