[PATCH] D58057: Allow bundle size to be 0 in clang-offload-bundler

Yaxun Liu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 11 08:52:54 PST 2019


yaxunl created this revision.
yaxunl added a reviewer: rjmccall.

HIP uses clang-offload-bundler to create fat binary. The bundle for host is empty.
Currently clang-offload-bundler checks if the bundle size is 0 when unbundling.
If so it will exit without unbundling the remaining bundles. This causes
clang-offload-bundler not being able to unbundle fat binaries generated for HIP.

This patch allows bundles size to be 0 when clang-offload-bundler unbundles
input files.


https://reviews.llvm.org/D58057

Files:
  tools/clang-offload-bundler/ClangOffloadBundler.cpp


Index: tools/clang-offload-bundler/ClangOffloadBundler.cpp
===================================================================
--- tools/clang-offload-bundler/ClangOffloadBundler.cpp
+++ tools/clang-offload-bundler/ClangOffloadBundler.cpp
@@ -292,7 +292,7 @@
       ReadChars += TripleSize;
 
       // Check if the offset and size make sense.
-      if (!Size || !Offset || Offset + Size > FC.size())
+      if (!Offset || Offset + Size > FC.size())
         return;
 
       assert(BundlesInfo.find(Triple) == BundlesInfo.end() &&


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D58057.186268.patch
Type: text/x-patch
Size: 533 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190211/f4be2f46/attachment.bin>


More information about the cfe-commits mailing list