<div dir="auto">HI <div dir="auto">Did you run the static constructor and destructor? How did you make your process symbols visible to ORC jit?</div><div dir="auto">Could you please share us the for what symbols you get undefined references :-)</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Aug 27, 2019 8:18 PM, "Geoff Levner via llvm-dev" <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><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::<wbr>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/<wbr>lib/gcc/x86_64-redhat-linux/6.<wbr>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>
<br>______________________________<wbr>_________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-<wbr>bin/mailman/listinfo/llvm-dev</a><br>
<br></blockquote></div></div>