================
@@ -525,6 +564,11 @@ Expected<SmallVector<StringRef>> getInput(const ArgList
&Args) {
object::Archive::create(Buffer);
if (!LibFile)
return LibFile.takeError();
+ // Skip extracting archives with fat binaries. Forward them to nvlink.
+ if (hasFatBinary(**LibFile)) {
+ ForwardArchives.emplace_back(Args.MakeArgString(*Filename));
----------------
darkbuck wrote:
I put all my findings on fatbin in https://github.com/darkbuck/fatbin-hack.
It's turned out that entries in that fatbin sections cannot be used directly
and need at least decompression.
In this revision, an alternative approach is taken. Instead of extracting cubin
from that fatbin archive, we uses that fatbin object from that archive. It
follows the same steps to extract individual object from an archive but write
them as `*.o` files instead of `*.cubin` when preparing input files for
`nvlink` so that `nvlink` will treat them as fatbin. The overall changes to
`clang-nvlink-wrapper` seems quite small and straight-forward. @jhuber6, let me
know what's your thoughts?
https://github.com/llvm/llvm-project/pull/165519
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits