[HIP] Fix unbundling archive
authorYaxun (Sam) Liu <yaxun.liu@amd.com>
Sat, 10 Sep 2022 01:54:49 +0000 (21:54 -0400)
committerYaxun (Sam) Liu <yaxun.liu@amd.com>
Tue, 27 Sep 2022 02:16:17 +0000 (22:16 -0400)
commit1172bdecfab364579d90e6aa5ba7fc64a5b96786
tree5579b8ff0b2c97f7778f499c7502e5108eb8bc2f
parent46fc75ab28b78a730ea21fd7daba6443937bfaac
[HIP] Fix unbundling archive

HIP is able to unbundle archive of bundled bitcode.
However currently there are two bugs:

1. archives passed by -l: are not unbundled.
2. archives passed as input files are not unbundled

The actual file name of an archive passed by -l: should
not be prefixed with lib and appended with '.a',
but the file path is prefixed with paths in '-L' options.

The actual file name of an archive passed as an input file
stays the same, not affected by the '-L' options.
clang/lib/Driver/Driver.cpp
clang/lib/Driver/ToolChains/CommonArgs.cpp
clang/test/Driver/clang-offload-bundler.c
clang/test/Driver/hip-link-bundle-archive.hip