<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=iso-8859-1">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@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;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        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;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;}
@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:1938783023;
        mso-list-type:hybrid;
        mso-list-template-ids:-1039347506 1683789840 1683789840 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
@list l0:level1
        {mso-level-text:"%1\.\)";
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level2
        {mso-level-text:"%2\.\)";
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level3
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l0:level4
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level5
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level6
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l0:level7
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level8
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0: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="EN-US" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal"><span lang="DE">Hello there,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="DE"><o:p> </o:p></span></p>
<p class="MsoNormal">I finished Chapter 1 of the Kaleidoscope tutorial for using the Orc JIT API. I played around with some things and ended with some questions.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<ol style="margin-top:0cm" start="1" type="1">
<li class="MsoListParagraph" style="margin-left:0cm;mso-list:l0 level1 lfo1">What is the use of “<span style="font-family:Consolas">MangleAndInterner</span>”?<br>
I read it is used to mangle the name for the lookup search, but I seem to be not able to use it correctly. In my first attempt I used the mangled name of my function
<span style="font-family:Consolas">“?helloOrc@@YAHXZ</span>” with the lookup method – that worked.<o:p></o:p></li></ol>
<p class="MsoListParagraph">Now I tried “<span style="font-family:Consolas">int helloOrc()</span>” and it failed/did not found the function. Then I tried
<span style="font-family:Consolas">“?helloOrc@@YAHXZ</span>” again but removed the use of the “<span style="font-family:Consolas">MangleAndInterner</span>” instance – that worked again.<br>
<br>
What is that instance used for?<o:p></o:p></p>
<p class="MsoListParagraph"><o:p> </o:p></p>
<ol style="margin-top:0cm" start="2" type="1">
<li class="MsoListParagraph" style="margin-left:0cm;mso-list:l0 level1 lfo1">JIT session error<o:p></o:p></li></ol>
<p class="MsoListParagraph">When I first run the JIT, the message “<span style="font-family:Consolas">JIT session error: Symbols not found: { __security_check_cookie, __security_cookie }</span>” was printed into the console.
<o:p></o:p></p>
<ol style="margin-top:0cm" start="2" type="1">
<ol style="margin-top:0cm" start="1" type="1">
<li class="MsoListParagraph" style="margin-left:0cm;mso-list:l0 level2 lfo1">Origin<br>
Is that message coming from "<span style="font-family:Consolas">DynamicLibrarySearchGenerator</span>”?<o:p></o:p></li></ol>
</ol>
<p class="MsoListParagraph" style="margin-left:72.0pt"><o:p> </o:p></p>
<ol style="margin-top:0cm" start="2" type="1">
<ol style="margin-top:0cm" start="2" type="1">
<li class="MsoListParagraph" style="margin-left:0cm;mso-list:l0 level2 lfo1">Redirect<br>
Can I somehow redirect this message to a string or something, or silence it? I want to keep my console output clean.<o:p></o:p></li></ol>
</ol>
<p class="MsoListParagraph"><o:p> </o:p></p>
<ol style="margin-top:0cm" start="3" type="1">
<li class="MsoListParagraph" style="margin-left:0cm;mso-list:l0 level1 lfo1">Generator function<o:p></o:p></li></ol>
<p class="MsoListParagraph">Why does the generator function looks like this: “<span style="font-family:Consolas">SymbolNameSet(JITDylib &Parent, const SymbolNameSet &Names)”?</span><br>
<br>
I understood, that the “<span style="font-family:Consolas">Parent</span>” will be the value from “<span style="font-family:Consolas">ES.getMainJITDylib()</span>” while “<span style="font-family:Consolas">Names</span>” will have the names that should be resolved.
 I saw an implementation for the Generator function that kinda looked like that:<br>
<span style="font-family:Consolas">{<o:p></o:p></span></p>
<p class="MsoListParagraph"><span style="font-family:Consolas">      orc::SymbolNameSet Added;<o:p></o:p></span></p>
<p class="MsoListParagraph"><span style="font-family:Consolas">      orc::SymbolMap     NewSymbols;<o:p></o:p></span></p>
<p class="MsoListParagraph"><span style="font-family:Consolas"><o:p> </o:p></span></p>
<p class="MsoListParagraph"><span style="font-family:Consolas">      for(auto &Name : Names)
<o:p></o:p></span></p>
<p class="MsoListParagraph"><span style="font-family:Consolas">      {<o:p></o:p></span></p>
<p class="MsoListParagraph"><span style="font-family:Consolas">            Added.insert(Name);<o:p></o:p></span></p>
<p class="MsoListParagraph"><span style="font-family:Consolas">            NewSymbols[Name] = //Something<o:p></o:p></span></p>
<p class="MsoListParagraph"><span style="font-family:Consolas">      }<o:p></o:p></span></p>
<p class="MsoListParagraph"><span style="font-family:Consolas"><o:p> </o:p></span></p>
<p class="MsoListParagraph"><span style="font-family:Consolas">      Parent.define(absoluteSymbols(std::move(NewSymbols)));<o:p></o:p></span></p>
<p class="MsoListParagraph"><span style="font-family:Consolas">      return Added;<o:p></o:p></span></p>
<p class="MsoListParagraph"><span style="font-family:Consolas">}<o:p></o:p></span></p>
<p class="MsoListParagraph"><o:p> </o:p></p>
<p class="MsoListParagraph">I understood that “<span style="font-family:Consolas">SymbolMap NewSymbols</span>” will store a pair of name and the address to resolve – but why do I tell the JITDylib about this?<br>
And why do I also keep a map of the symbols I added and have to return them? (<span style="font-family:Consolas">SymbolNameSet Added</span>)<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I hope my questions are not too stupid and that someone can help me with that!<o:p></o:p></p>
<p class="MsoNormal">Thank you a lot x3<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Kind greetings<o:p></o:p></p>
<p class="MsoNormal">Björn<o:p></o:p></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, Heiko Lampert, Takashi Nagano, Takeshi Fukushima. Junichi Tajika
</body>
</html>