how to change llvm bitcode file version?

(Sorry for sending an incomplete email by mistake)
Hi, I’m currently using llvm3.6.2 tool to get the bc file of a project, at some point, due to incomplete compilation (incomplete compilation doesn’t affect my purpose), I have no way to get the whole bc file, but only the subparts of the bc file as shown below

When I try to link them with the llvm-link tool, I get a symbol multiple definition error. So I thought I should use the --override= option to override the multiple definitions. However llvm3.6.2 does not have this option. I learned that this option exists in higher versions of llvm-link. However, for version 3.6.2 bc files, linking them together results in the following.


A 19M and a 700+M bc link up is 52M, so obviously something is wrong somewhere. By WARNING I think it is probably the version. So is there a way to change the version of bc? Or is there any other way to solve my problem? Thank you very much.

(Attachment 4BE33E3B@0EB8B844.8C61EB61.jpg is missing)

That message:

warning: ignoring debug info with an invalid version (2) in …

is referring specifically to the debug info version, not the general bitcode version. The format of the debug info metadata in the bitcode changed, between the llvm version that generated the bitcode and the llvm version you are using to link.

Throwing away debug info is quite likely to reduce the size of the output bitcode by a large amount. I believe the link succeeded but effectively stripped all the debug info.

If you can proceed without debug info, then you can safely ignore this warning. If you really do need the debug info, I’m not sure there’s any good way to auto-upgrade it. Someone else might know.
–paulr