<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0cm;
        margin-right:0cm;
        margin-bottom:0cm;
        margin-left:36.0pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:63652913;
        mso-list-type:hybrid;
        mso-list-template-ids:1611319004 1424683352 67567619 67567621 67567617 67567619 67567621 67567617 67567619 67567621;}
@list l0:level1
        {mso-level-number-format:bullet;
        mso-level-text:-;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:53.4pt;
        text-indent:-18.0pt;
        font-family:"Calibri",sans-serif;
        mso-fareast-font-family:Calibri;}
@list l0:level2
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:89.4pt;
        text-indent:-18.0pt;
        font-family:"Courier New";}
@list l0:level3
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:125.4pt;
        text-indent:-18.0pt;
        font-family:Wingdings;}
@list l0:level4
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:161.4pt;
        text-indent:-18.0pt;
        font-family:Symbol;}
@list l0:level5
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:197.4pt;
        text-indent:-18.0pt;
        font-family:"Courier New";}
@list l0:level6
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:233.4pt;
        text-indent:-18.0pt;
        font-family:Wingdings;}
@list l0:level7
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:269.4pt;
        text-indent:-18.0pt;
        font-family:Symbol;}
@list l0:level8
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:305.4pt;
        text-indent:-18.0pt;
        font-family:"Courier New";}
@list l0:level9
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:341.4pt;
        text-indent:-18.0pt;
        font-family:Wingdings;}
@list l1
        {mso-list-id:284193560;
        mso-list-type:hybrid;
        mso-list-template-ids:-1063382206 1738056694 67567641 67567643 67567631 67567641 67567643 67567631 67567641 67567643;}
@list l1:level1
        {mso-level-text:"%1\.\)";
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l1:level2
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l1:level3
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l1:level4
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l1:level5
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l1:level6
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l1:level7
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l1:level8
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l1:level9
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l2
        {mso-list-id:1139149619;
        mso-list-type:hybrid;
        mso-list-template-ids:-2138535260 -1398876250 67567641 67567643 67567631 67567641 67567643 67567631 67567641 67567643;}
@list l2:level1
        {mso-level-text:"%1\.\)";
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l2:level2
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l2:level3
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l2:level4
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l2:level5
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l2:level6
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l2:level7
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l2:level8
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l2:level9
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l3
        {mso-list-id:1349330177;
        mso-list-type:hybrid;
        mso-list-template-ids:140796884 -948436234 67567641 67567643 67567631 67567641 67567643 67567631 67567641 67567643;}
@list l3:level1
        {mso-level-text:"%1\.\)";
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l3:level2
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l3:level3
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l3:level4
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l3:level5
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l3:level6
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l3:level7
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l3:level8
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l3:level9
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
ol
        {margin-bottom:0cm;}
ul
        {margin-bottom:0cm;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="DE" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-GB" style="mso-fareast-language:EN-US">Hey guys,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="mso-fareast-language:EN-US">Thank you all for your answers – I try to answer you all in this mail. Big sorry if this causes spam…<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="mso-fareast-language:EN-US">@Eric:
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="mso-fareast-language:EN-US">Luckily there is no code from me involved to reproduce it, because I was starting to learn it. So to reproduce:<o:p></o:p></span></p>
<ol style="margin-top:0cm" start="1" type="1">
<li class="MsoListParagraph" style="margin-left:0cm;mso-list:l3 level1 lfo4"><span lang="EN-GB" style="mso-fareast-language:EN-US">Configurate CMAKE with:<o:p></o:p></span></li></ol>
<ul style="margin-top:0cm" type="disc">
<li class="MsoListParagraph" style="margin-left:17.4pt;mso-list:l0 level1 lfo2"><span lang="EN-GB">“CLANG_PLUGIN_SUPPORT”</span><span lang="EN-GB" style="mso-fareast-language:EN-US"><o:p></o:p></span></li><li class="MsoListParagraph" style="margin-left:17.4pt;mso-list:l0 level1 lfo2"><span lang="EN-GB">“LLVM_ENABLE_PLUGINS”
</span><span lang="EN-GB" style="mso-fareast-language:EN-US"><o:p></o:p></span></li><li class="MsoListParagraph" style="margin-left:17.4pt;mso-list:l0 level1 lfo2"><span lang="EN-GB"> “LLVM_EXPORT_SYMBOLS_FOR_PLUGINS”</span><span lang="EN-GB" style="mso-fareast-language:EN-US"><o:p></o:p></span></li><li class="MsoListParagraph" style="margin-left:17.4pt;mso-list:l0 level1 lfo2"><span lang="EN-GB" style="mso-fareast-language:EN-US">Targeting Windows x64 (VS2019 with the latest Win10 SDK)<o:p></o:p></span></li></ul>
<p class="MsoListParagraph" style="margin-left:53.4pt"><span lang="EN-GB" style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<ol style="margin-top:0cm" start="2" type="1">
<li class="MsoListParagraph" style="margin-left:0cm;mso-list:l3 level1 lfo4"><span lang="EN-GB" style="mso-fareast-language:EN-US">Build it<o:p></o:p></span></li><li class="MsoListParagraph" style="margin-left:0cm;mso-list:l3 level1 lfo4"><span lang="EN-GB" style="mso-fareast-language:EN-US">Copy the LLVMHello.dll from where it was build to the ‘bin’ directory of the llvm installation. Create a file called “Test.cpp”
 there and add a simple, empty main there.<o:p></o:p></span></li><li class="MsoListParagraph" style="margin-left:0cm;mso-list:l3 level1 lfo4"><span lang="EN-GB" style="mso-fareast-language:EN-US">Now execute “clang-cl.exe -Xclang -load -Xclang LLVMHello.dll Test.cpp”<o:p></o:p></span></li></ol>
<p class="MsoNormal"><span lang="EN-GB" style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="mso-fareast-language:EN-US">@Alexandre<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="mso-fareast-language:EN-US">Adding -fno-integrated-cc1 Didn’t changed output – when using “-Xclang” it was even unknown<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="mso-fareast-language:EN-US">@Andrzej 
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="mso-fareast-language:EN-US">No worries about my name :’D<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="mso-fareast-language:EN-US">Thank you for the explanation! I was so happy having it run with opt that I thought everything would be good now :c<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="mso-fareast-language:EN-US">Thank you all again ^o^<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="mso-fareast-language:EN-US">Björn<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US">From:</span></b><span lang="EN-US"> Eric Astor <eric.astor@gmail.com>
<br>
<b>Sent:</b> 11 November 2020 14:39<br>
<b>To:</b> Gaier, Bjoern <Bjoern.Gaier@horiba.com><br>
<b>Cc:</b> Andrzej Warzynski <andrzej.warzynski@arm.com>; Clang Dev <cfe-dev@lists.llvm.org><br>
<b>Subject:</b> Re: [cfe-dev] Running LLVMHello Pass from Clang(-cl)<o:p></o:p></span></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal">The "Error generating preprocessed source(s)" message here is from a generic error trap:<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><a href="https://hes32-ctp.trendmicro.com:443/wis/clicktime/v1/query?url=https%3a%2f%2fgithub.com%2fllvm%2fllvm%2dproject%2fblob%2fba71a0746f31a2f5f9af992f569a9418133a9a38%2fclang%2flib%2fDriver%2fDriver.cpp%23L1385&umid=eaeb62a5-5734-4dd9-972f-1036a26b43bd&auth=b6f66d00f8195cc5198eee21f0dbabe6af0a3180-a91537a9eaa5d0e4e92ad39839789acf5f61bd62">https://github.com/llvm/llvm-project/blob/ba71a0746f31a2f5f9af992f569a9418133a9a38/clang/lib/Driver/Driver.cpp#L1385</a><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">I've found instances of this online that were resolved by increasing the heap size, so it can be caused by just about anything. The underlying command line doesn't include a smoking gun for me either.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">As Andrzej mentioned, I don't know that dynamic plugins are actually well-supported on Windows, so this might be hard to track down without the ability to run a debugger. If you can't build with debug symbols, can you write a step-by-step
 reproduction procedure so someone else can try, including all the code necessary?<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">- Eric<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal">On Wed, Nov 11, 2020 at 8:16 AM Gaier, Bjoern via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a>> wrote:<o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<p class="MsoNormal">Hey Andrzej,<br>
<br>
Sadly I can not run it under Linux and also don't have debug symbols enabled (because of disk space issues...)<br>
<br>
I'm really confused by this, because the plugin works with opt causing no issues. So.... what is opt doing differently then Clang? >o<<br>
<br>
- Björn<br>
<br>
-----Original Message-----<br>
From: cfe-dev <<a href="mailto:cfe-dev-bounces@lists.llvm.org" target="_blank">cfe-dev-bounces@lists.llvm.org</a>> On Behalf Of Andrzej Warzynski via cfe-dev<br>
Sent: 11 November 2020 12:56<br>
To: <a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><br>
Subject: Re: [cfe-dev] Running LLVMHello Pass from Clang(-cl)<br>
<br>
Hello Gaier,<br>
<br>
This might indicate the root cause:<br>
<br>
```<br>
clang-cl: note: diagnostic msg: Error generating preprocessed source(s).<br>
```<br>
<br>
However, I have no better suggestion other than investigating with a debugger :/<br>
<br>
Btw, have you tried on Linux? Dynamically loaded plugins are not really supported on Windows. Yes, sometimes stuff works, but your mileage will vary. If you test this on Linux and it still fails then at least you will be confident that it's not related to Windows-specific
 limitations.<br>
<br>
-Andrzej<br>
<br>
On 11/11/2020 08:16, Gaier, Bjoern via cfe-dev wrote:<br>
> Hello Eric,<br>
><br>
> I got this now:<br>
><br>
> D:\Program Files\LLVM_orc_removal\bin>clang-cl.exe -v -Xclang -load<br>
> -Xclang LLVMHello.dll Test.cpp<br>
><br>
> clang version 12.0.0<br>
><br>
> Target: x86_64-pc-windows-msvc<br>
><br>
> Thread model: posix<br>
><br>
> InstalledDir: D:\Program Files\LLVM_orc_removal\bin<br>
><br>
> "D:\\Program Files\\LLVM_orc_removal\\bin\\clang-cl.exe" -cc1 -triple<br>
> x86_64-pc-windows-msvc19.27.29111 -emit-obj -mrelax-all<br>
> -mincremental-linker-compatible --mrelax-relocations -disable-free<br>
> -main-file-name Test.cpp -mrelocation-model pic -pic-level 2<br>
> -mframe-pointer=none -relaxed-aliasing -fmath-errno -fno-rounding-math<br>
> -mconstructor-aliases -munwind-tables -target-cpu x86-64 -mllvm<br>
> -x86-asm-syntax=intel -tune-cpu generic -D_MT<br>
> -flto-visibility-public-std --dependent-lib=libcmt<br>
> --dependent-lib=oldnames -stack-protector 2 -fms-volatile<br>
> -fdiagnostics-format msvc -v -resource-dir "D:\\Program<br>
>   Files\\LLVM_orc_removal\\lib\\clang\\12.0.0" -internal-isystem<br>
> "D:\\Program Files\\LLVM_orc_removal\\lib\\clang\\12.0.0\\include"<br>
> -internal-isystem "D:\\Program Files (x86)<a href="file://Microsoft">\\Microsoft</a> Visual<br>
> Studio\\2019\\Professional\\VC\\Tools\\MSVC\\14.27.29110\\include"<br>
> -internal-isystem "D:\\Program Files (x86)<a href="file://Microsoft">\\Microsoft</a> Visual<br>
> Studio\\2019\\Professional\\VC\\Tools\\MSVC\\14.27.29110\\atlmfc\\include"<br>
> -internal-isystem "C:\\Program Files (x86)<a href="file://Windows">\\Windows</a><br>
> Kits\\10\\Include\\10.0.18362.0\\ucrt" -internal-isystem "C:\\Program<br>
> Files (x86)<a href="file://Windows">\\Windows</a> Kits\\10\\include\\10.0.18362.0\\shared"<br>
> -internal-isystem "C:<br>
><br>
> <a href="file://Program">\\Program</a> Files (x86)<a href="file://Windows">\\Windows</a> Kits\\10\\include\\10.0.18362.0\\um"<br>
> -internal-isystem "C:\\Program Files<br>
> (x86)<a href="file://WindowsKits/10/include/10.0.18362.0/winrt">\\WindowsKits\\10\\include\\10.0.18362.0\\winrt</a>"<br>
> -fdeprecated-macro -fdebug-compilation-dir "D:\\Program Files\\LLVM_orc_removal\\bin"<br>
> -ferror-limit 19 -fmessage-length=120 -fno-use-cxa-atexit<br>
> -fms-extensions -fms-compatibility<br>
> -fms-compatibility-version=19.27.29111 -std=c++14<br>
> -fdelayed-template-parsing -fcolor-diagnostics -load LLVMHello.dll<br>
> -faddrsig -o "C:\\Users\\h16020\\AppData\\Local\\Temp\\Test-f1a523.obj"<br>
> -x c++ Test.cpp<br>
><br>
> clang-cl: error: clang frontend command failed due to signal (use -v<br>
> to see invocation)<br>
><br>
> clang version 12.0.0<br>
><br>
> Target: x86_64-pc-windows-msvc<br>
><br>
> Thread model: posix<br>
><br>
> InstalledDir: D:\Program Files\LLVM_orc_removal\bin<br>
><br>
> clang-cl: note: diagnostic msg: Error generating preprocessed source(s).<br>
><br>
> And here with -Xclang<br>
><br>
> D:\Program Files\LLVM_orc_removal\bin>clang-cl.exe -Xclang -v -Xclang<br>
> -load -Xclang LLVMHello.dll Test.cpp<br>
><br>
> clang-cl: error: clang frontend command failed due to signal (use -v<br>
> to see invocation)<br>
><br>
> clang version 12.0.0<br>
><br>
> Target: x86_64-pc-windows-msvc<br>
><br>
> Thread model: posix<br>
><br>
> InstalledDir: D:\Program Files\LLVM_orc_removal\bin<br>
><br>
> clang-cl: note: diagnostic msg: Error generating preprocessed source(s).<br>
><br>
> Didn’t told me much óò<br>
><br>
> Kind greetings<br>
><br>
> Björn<br>
><br>
> *From:*Eric Astor <<a href="mailto:eric.astor@gmail.com" target="_blank">eric.astor@gmail.com</a>><br>
> *Sent:* 10 November 2020 14:50<br>
> *To:* Gaier, Bjoern <<a href="mailto:Bjoern.Gaier@horiba.com" target="_blank">Bjoern.Gaier@horiba.com</a>><br>
> *Cc:* Clang Dev <<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>><br>
> *Subject:* Re: [cfe-dev] Running LLVMHello Pass from Clang(-cl)<br>
><br>
> This line seems critical:<br>
><br>
>     clang-cl: error: clang frontend command failed due to signal (use -v<br>
>     to see invocation)<br>
><br>
> Have you tried rerunning with -v? The full invocation might be informative.<br>
><br>
> Best,<br>
><br>
> - Eric<br>
><br>
> On Tue, Nov 10, 2020 at 4:13 AM Gaier, Bjoern via cfe-dev<br>
> <<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a> <mailto:<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>>> wrote:<br>
><br>
>     Hello everyone,<br>
><br>
>     I build and run the LLVM (and clang) under Windows. I wanted to dive<br>
>     into the LLVM passes because I see a huge benefit in them for our<br>
>     project. So I made sure to configurate CMAKE with<br>
>     “CLANG_PLUGIN_SUPPORT”, “LLVM_ENABLE_PLUGINS” and<br>
>     “LLVM_EXPORT_SYMBOLS_FOR_PLUGINS”.<br>
><br>
>     Except one project, everything build fine and I was able to execute<br>
>     “opt.exe” with the LLVMHello.dll – everything worked as expected!<br>
><br>
>     However, then I tried using the DLL with Clang-Cl because this would<br>
>     be the way how to integrate it to our system. So I used:<br>
><br>
>     clang-cl.exe -Xclang -load -Xclang LLVMHello.dll Test.cpp<br>
><br>
>     However, this failed with:<br>
><br>
>     clang-cl: error: clang frontend command failed due to signal (use -v<br>
>     to see invocation)<br>
><br>
>     clang version 12.0.0<br>
><br>
>     Target: x86_64-pc-windows-msvc<br>
><br>
>     Thread model: posix<br>
><br>
>     InstalledDir: D:\Program Files\LLVM_orc_removal\bin<br>
><br>
>     clang-cl: note: diagnostic msg: Error generating preprocessed source(s).<br>
><br>
>     If I remove the loading of LLVMHello.dll it works correctly again. I<br>
>     feel like, that LLVMHello.dll is not finding all the symbols needed.<br>
>     So I linked LLVMHello.dll with “clang.lib” instead of “opt.lib” -<br>
>     but with no success.<br>
><br>
>     I also read that there are ways to include those passes directly<br>
>     into the source code of Clang, but I hoped to use this dynamic<br>
>     approach instead.<br>
><br>
>     Any comments, ideas or something about this?<br>
><br>
>     Kind greetings<br>
><br>
>     Björn<br>
><br>
>     Als GmbH eingetragen im Handelsregister Bad Homburg v.d.H. HRB 9816,<br>
>     USt.ID-Nr. DE 114 165 789 Geschäftsführer: Dr. Hiroshi Nakamura, Dr.<br>
>     Robert Plank, Markus Bode, Takashi Nagano, Junichi Tajika, Ergin<br>
>     Cansiz.<br>
><br>
>     _______________________________________________<br>
>     cfe-dev mailing list<br>
>     <a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a> <mailto:<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" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
>     <<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a>><br>
><br>
> Als GmbH eingetragen im Handelsregister Bad Homburg v.d.H. HRB 9816,<br>
> USt.ID-Nr. DE 114 165 789 Geschäftsführer: Dr. Hiroshi Nakamura, Dr.<br>
> Robert Plank, Markus Bode, Takashi Nagano, Junichi Tajika, Ergin Cansiz.<br>
><br>
> _______________________________________________<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" target="_blank">
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
><br>
_______________________________________________<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" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
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.<br>
_______________________________________________<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" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><o:p></o:p></p>
</blockquote>
</div>
</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.
</body>
</html>