<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Hi Igor, not sure if that will work, but have you tried lli
-jit-kind=orc-lazy ? The default is still MCJIT:<br>
<a class="moz-txt-link-freetext" href="https://github.com/llvm/llvm-project/blob/master/llvm/tools/lli/lli.cpp#L88">https://github.com/llvm/llvm-project/blob/master/llvm/tools/lli/lli.cpp#L88</a><br>
<br>
<div class="moz-cite-prefix">On 13/01/2020 19:07, David Blaikie via
llvm-dev wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAENS6EuYyB_Q4xsBEyMiZ1=sEtGjhvb61KsLxqMwtWovoJ8Q3Q@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div dir="ltr">(+Lang for JIT/interpreter questions)</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Sun, Jan 5, 2020 at 5:00 PM
Igor Gomon via llvm-dev <<a
href="mailto:llvm-dev@lists.llvm.org" moz-do-not-send="true">llvm-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="EN-US">
<div class="gmail-m_-4439422298999852875WordSection1">
<p class="MsoNormal">Hello,</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">I am new to LLVM and what I am trying
to do is to get a very simple “hello-world” C++ program
to compile to LLVM IR and then to run it using lli tool.</p>
<p class="MsoNormal">So here is the program code
(hello.cpp):</p>
<p class="MsoNormal" style="margin-left:0.5in">#include
<iostream></p>
<p class="MsoNormal" style="margin-left:0.5in">int main
(int argc, char *argv[])</p>
<p class="MsoNormal" style="margin-left:0.5in">{</p>
<p class="MsoNormal" style="margin-left:0.5in">
std::cout << "Hello World!\n";</p>
<p class="MsoNormal" style="margin-left:0.5in"> return
0;</p>
<p class="MsoNormal" style="margin-left:0.5in">}</p>
<p class="MsoNormal">Below are the steps I do to achieve
that goal:</p>
<ol style="margin-top:0in" start="1" type="1">
<li class="gmail-m_-4439422298999852875MsoListParagraph"
style="margin-left:0in">clang++.exe hello.cpp -S
-emit-llvm -o hello.ll (produces hello.ll about 307KB
in size)</li>
<li class="gmail-m_-4439422298999852875MsoListParagraph"
style="margin-left:0in">llvm-link.exe hello.ll -o
hello.bc (produces the bit-code file about 79KB in
size).</li>
<li class="gmail-m_-4439422298999852875MsoListParagraph"
style="margin-left:0in">lli.exe hello.bc (terminates
with a segmentation fault). The dump is below.</li>
</ol>
<p class="MsoNormal"> </p>
<p class="MsoNormal">I understand that some symbols are
not loaded (C++ standard library symbols). I am not sure
how I can specify the location of those symbols to lli
tool (I tried –extra-object option but no effect).</p>
<p class="MsoNormal">Could someone please let me know what
am I missing or doing wrong?
</p>
<p class="MsoNormal">Any help is greatly appreciated!!!</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">--</p>
<p class="MsoNormal">Thanks,</p>
<p class="MsoNormal">Igor</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">Stack dump:</p>
<p class="MsoNormal">0. Program arguments:
C:\dev\llvm-project\build\Debug\bin\lli.exe .\hello.bc</p>
<p class="MsoNormal">0x0000000000000000
(0x0000000000000010 0xCCCCCCCCCCCCCCCC
0x000000575B18D640 0x00007FF68DEF6186) <unknown
module></p>
<p class="MsoNormal">0x000001AF8A3004F6
(0xCCCCCCCCCCCCCCCC 0x000000575B18D640
0x00007FF68DEF6186 0x000001AF8A4B0000) <unknown
module></p>
<p class="MsoNormal">0x0000000000000010
(0x000000575B18D640 0x00007FF68DEF6186
0x000001AF8A4B0000 0xFFFFFFFFFFFFFFFE) <unknown
module></p>
<p class="MsoNormal">0xCCCCCCCCCCCCCCCC
(0x00007FF68DEF6186 0x000001AF8A4B0000
0xFFFFFFFFFFFFFFFE 0x000000575B18D6A0) <unknown
module></p>
<p class="MsoNormal">0x000000575B18D640
(0x000001AF8A4B0000 0xFFFFFFFFFFFFFFFE
0x000000575B18D6A0 0x000001AF8A300032) <unknown
module></p>
<p class="MsoNormal">0x00007FF68DEF6186
(0x000001AF8A85B410 0x000000575B18D678
0xCCCCCCCCCCCCCCCC 0x000001AF8A4B0000),
std::_Construct_in_place<std::_Container_proxy,std::_Container_base12
*>() + 0x56 bytes(s), C:\Program Files
(x86)\Microsoft Visual
Studio\2019\Community\VC\Tools\MSVC\14.24.28314\include\xmemory,
line 205</p>
<p class="MsoNormal">0x00007FF68DEF45E8
(0x0000000000000000 0x000000005B18D6B1
0xFFFFFFFFFFFFFFFE 0x000000575B18DB80),
std::_Container_base12::_Alloc_proxy<std::allocator<std::_Container_proxy>
>() + 0x58 bytes(s), C:\Program Files (x86)\Microsoft
Visual
Studio\2019\Community\VC\Tools\MSVC\14.24.28314\include\xmemory,
line 1100</p>
<p class="MsoNormal">0x00007FF68DF36634
(0xCCCCCCCCCCCCCCCC 0xCCCCCCCCCCCCCCCC
0xCCCCCCCCCCCCCCCC 0x0000000000000001),
std::vector<llvm::GenericValue,std::allocator<llvm::GenericValue>
>::vector<llvm::GenericValue,std::allocator<llvm::GenericValue>
>() + 0x54 bytes(s), C:\Program Files (x86)\Microsoft
Visual
Studio\2019\Community\VC\Tools\MSVC\14.24.28314\include\vector,
line 446</p>
<p class="MsoNormal">0x00007FF68E06B048
(0x000001AF8A6A3058 0x0000000000000001
0xCCCCCCCCCCCCCCCC 0xCCCCCCCCCCCCCCCC),
llvm::APInt::getZExtValue() + 0x28 bytes(s),
C:\dev\llvm-project\llvm\include\llvm\ADT\APInt.h, line
1589 + 0xA byte(s)</p>
<p class="MsoNormal">0x00007FF68ED9E0F0
(0x000001AF8A563310 0x000000575B18DB88
0x000001AF8A583F18 0x000000575B18DBC0),
llvm::MCJIT::runFunction() + 0x480 bytes(s),
C:\dev\llvm-project\llvm\lib\ExecutionEngine\MCJIT\MCJIT.cpp,
line 550 + 0x16 byte(s)</p>
<p class="MsoNormal">0x00007FF68EC09680
(0x000001AF8A563310 0x000001AF8A583F18
0x00007FF6920964A0 0x000001AF8A532460),
llvm::ExecutionEngine::runFunctionAsMain() + 0x410
bytes(s),
C:\dev\llvm-project\llvm\lib\ExecutionEngine\ExecutionEngine.cpp,
line 470 + 0x65 byte(s)</p>
<p class="MsoNormal">0x00007FF68DEE4200
(0x0000000000000002 0x000001AF8A5515B0
0x000001AF8A532460 0x00007FF6909C0A7D), main() + 0x1D10
bytes(s), C:\dev\llvm-project\llvm\tools\lli\lli.cpp,
line 614 + 0x4D byte(s)</p>
<p class="MsoNormal">0x00007FF6909C1A29
(0x00007FF690C2C000 0x00007FF690C2FE30
0x0000000000000000 0x0000000000000000), invoke_main() +
0x39 bytes(s),
d:\agent\_work\5\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl,
line 79</p>
<p class="MsoNormal">0x00007FF6909C190E
(0x0000000000000000 0x0000000000000000
0x0000000000000000 0x0000000000000000),
__scrt_common_main_seh() + 0x12E bytes(s),
d:\agent\_work\5\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl,
line 288 + 0x5 byte(s)</p>
<p class="MsoNormal">0x00007FF6909C17CE
(0x0000000000000000 0x0000000000000000
0x0000000000000000 0x0000000000000000),
__scrt_common_main() + 0xE bytes(s),
d:\agent\_work\5\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl,
line 331</p>
<p class="MsoNormal">0x00007FF6909C1AB9
(0x0000000000000000 0x0000000000000000
0x0000000000000000 0x0000000000000000), mainCRTStartup()
+ 0x9 bytes(s),
d:\agent\_work\5\s\src\vctools\crt\vcstartup\src\startup\exe_main.cpp,
line 17</p>
<p class="MsoNormal">0x00007FFC76417BD4
(0x0000000000000000 0x0000000000000000
0x0000000000000000 0x0000000000000000),
BaseThreadInitThunk() + 0x14 bytes(s)</p>
<p class="MsoNormal">0x00007FFC7746CED1
(0x0000000000000000 0x0000000000000000
0x0000000000000000 0x0000000000000000),
RtlUserThreadStart() + 0x21 bytes(s)</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">Sent from <a
href="https://go.microsoft.com/fwlink/?LinkId=550986"
target="_blank" moz-do-not-send="true">
Mail</a> for Windows 10</p>
<p class="MsoNormal"> </p>
</div>
</div>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank"
moz-do-not-send="true">llvm-dev@lists.llvm.org</a><br>
<a
href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev"
rel="noreferrer" target="_blank" moz-do-not-send="true">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
LLVM Developers mailing list
<a class="moz-txt-link-abbreviated" href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>
<a class="moz-txt-link-freetext" href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a>
</pre>
</blockquote>
<pre class="moz-signature" cols="72">--
<a class="moz-txt-link-freetext" href="https://flowcrypt.com/pub/stefan.graenitz@gmail.com">https://flowcrypt.com/pub/stefan.graenitz@gmail.com</a></pre>
</body>
</html>