================
@@ -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:

> Makes sense that it's compressed, a bit more difficult to work with then. If 
> it's too much effort then we can just append the library to the end, that 
> should just store them in a separate list and then append the one we already 
> create.
> 
> If you want to try to do this more intelligently, where we extract the 
> appropriate cubin and feed it to `nvlink` (this is what nvlink does 
> internally most likely) you can do that.

In the latest revision, we extract the object (containing fatbin) from that 
archive and use that object as it's. When we generate inputs files for 
`nvlink`, we create `*.o` file instead of `*.cubin` to tell `nvlink` that's a 
fat binary. The solution preserves the order without minimal effort in 
`clang-nvlink-wrapper`. Is that good enough?

https://github.com/llvm/llvm-project/pull/165519
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to