<div dir="ltr"><div>Greetings, LLVM wizards.</div><div><br></div><div>We are using Clang and Orc JIT (v1) to compile and execute C++ code on the fly. If a C++ module calls functions from external libraries, we add them via DynamicLibrary::LoadLibraryPermanently().</div><div><br></div><div>The problem we have run into recently is when a module calls a function from the STL -- in particular this swap() function for input streams:<br></div><div><br></div><div style="margin-left:40px">#include <fstream><br></div><div style="margin-left:40px">std::ifstream stream1, stream2;</div><div style="margin-left:40px">stream1.swap(stream2);</div><div><br></div><div>When we run the constructors for the module, we get two undefined symbols. And explicitly adding libstdc++ doesn't help. It turns out that the missing symbols are defined not in the runtime DSO but in an archive file:</div><div><br></div><div style="margin-left:40px">/opt/rh/devtoolset-6/root/usr/lib/gcc/x86_64-redhat-linux/6.3.1/libstdc++.a</div><div><br></div><div>So my questions are:</div><div><br></div><div>1. Is there a simple way to get access to all symbols defined in the STL? Intuitively, it seems like we should not need to know about such compiler magic.</div><div><br></div><div>2. If there is no magical solution, is there a way to explicitly add symbols from an archive?</div><div><br></div><div>Thanks,<br></div><div>Geoff</div><div><br></div></div>