<div dir="ltr"><div>This line seems critical:</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>
<span lang="EN-GB">clang-cl: error: clang frontend command failed due to signal (use -v to see invocation)</span></div></blockquote><div> </div><div>Have you tried rerunning with -v? The full invocation might be informative.</div><div><br></div><div>Best,<br></div><div>- Eric<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Nov 10, 2020 at 4:13 AM Gaier, Bjoern via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</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 lang="DE">
<div class="gmail-m_482812900331474989WordSection1">
<p class="MsoNormal"><span lang="EN-GB">Hello everyone,<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">I build and run the LLVM (and clang) under Windows. I wanted to dive into the LLVM passes because I see a huge benefit in them for our project. So I made sure to configurate CMAKE with “CLANG_PLUGIN_SUPPORT”, “LLVM_ENABLE_PLUGINS”
and “LLVM_EXPORT_SYMBOLS_FOR_PLUGINS”.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">Except one project, everything build fine and I was able to execute “opt.exe” with the LLVMHello.dll – everything worked as expected!<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">However, then I tried using the DLL with Clang-Cl because this would be the way how to integrate it to our system. So I used:<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">clang-cl.exe -Xclang -load -Xclang LLVMHello.dll Test.cpp<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">However, this failed with:<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">clang-cl: error: clang frontend command failed due to signal (use -v to see invocation)<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">clang version 12.0.0<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">Target: x86_64-pc-windows-msvc<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">Thread model: posix<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">InstalledDir: D:\Program Files\LLVM_orc_removal\bin<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">clang-cl: note: diagnostic msg: Error generating preprocessed source(s).<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">If I remove the loading of LLVMHello.dll it works correctly again. I feel like, that LLVMHello.dll is not finding all the symbols needed. So I linked LLVMHello.dll with “clang.lib” instead of “opt.lib” - but with no success.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">I also read that there are ways to include those passes directly into the source code of Clang, but I hoped to use this dynamic approach instead.
<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">Any comments, ideas or something about this?<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">Kind greetings<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">Björn<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
</div>
Als GmbH eingetragen im Handelsregister Bad Homburg v.d.H. HRB 9816, USt.ID-Nr. DE 114 165 789 Geschäftsführer: Dr. Hiroshi Nakamura, Dr. Robert Plank, Markus Bode, Takashi Nagano, Junichi Tajika, Ergin Cansiz.
</div>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
</blockquote></div>