[PATCH] D20559: [ThinLTO/gold] Handle bitcode archives

Teresa Johnson via llvm-commits llvm-commits at lists.llvm.org
Wed May 25 07:54:51 PDT 2016

tejohnson added a comment.

In http://reviews.llvm.org/D20559#438033, @pcc wrote:

> Thanks for discovering that issue with the gold plugin API, that's nasty. It reminds me that I'll probably have to be more careful with memory ownership in http://reviews.llvm.org/D20268.
> Can you please also see if this works if you pass `--no-map-whole-files` to gold?

Will do. I am first tracking down a runtime error in the llvm-tblgen binary built using this patch with latest clang+llvm sources (it seems related to ThinLTO since it goes away when I disable some amount of importing, but I wasn't getting this with my fixes on a slightly older revision, so I don't think it is caused by this patch directly)

> And can you add a test case please?

Will do.

Comment at: tools/gold/gold-plugin.cpp:522
@@ -506,1 +521,3 @@
+  if (file->offset)
+    cf.name += "." + std::to_string(file->offset);
pcc wrote:
> Nit: maybe `"/" + std::to_string(file->offset)` to avoid possibility of collisions with real files?
The same name is used to generate save temps files (so they don't all just use the archive name), so I wanted it to be a legal file name. What if I put in something like ".llvm." in between? This is similar to the naming scheme for symbols used during promotion.

That being said, in working to track down the tblgen failure, I am finding the name generated just from the offset not very useful, so I am planning to grab the SourceFileName out of the Module and include its basename as well.


More information about the llvm-commits mailing list