<div dir="ltr"><div>Well, I have worked around this problem by implementing my own little file format to hold the simple concatenation of any number of bitcode files. It does not seem like this should be necessary, though. If anyone comes up with a better solution in the future, I am interested...</div><div><br></div><div>Geoff<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Feb 2, 2021 at 12:26 PM Geoff Levner <<a href="mailto:glevner@gmail.com">glevner@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Greetings, LLVM developers.</div><div><br></div><div>I am trying to save the bitcode for multiple modules so that I can reload them later and add them to my Orc-based JIT.<br></div><div><br></div><div>If I save each module to its own file, I have no problem. But I would like to save them to a single file. When I do that, I sometimes get duplicate symbol definitions when I reload the modules:</div><div><br></div><div>    Duplicate definition of symbol '$./path/to/my/file.bc.__inits.0'</div><div><br></div><div>It looks to me as though this is a problem with static constructors in the modules, as though each module puts its constructors in a symbol with the same name...?</div><div><br></div><div>Does anybody have a better idea than I am of what is going on, or how to solve this?</div><div><br></div><div>I am using the 11.x release branch on Linux, FWIW. To reload the modules, I use a call to getBitcodeModuleList(), followed by calls to BitcodeModule::parseModule(), and finally calls to orc::LLJIT::addIRModule().<br></div><div><br></div><div>Geoff<br></div></div>
</blockquote></div>