<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Hi Rajesh<br>
<br>
On 1.: ORC defers compilation of the module and on first request,
compiles the entire module. This will trigger recursive lookups for
external symbols. Eager compilation means that the modules which
provide these symbols will now be compiled too, while lazy
compilation should instead insert stubs that will trigger
compilation once they are reached by execution.<br>
<br>
On 2.: I am maybe not perfectly up-to-date, but what I would expect
to happen is this. First, your remote process allocates memory for
the executable code and sends the base address to the compiler
process. Then the compiler process compiles and links with this base
address and sends the (position-dependent) code back. You may also
manage to go with position-independent code, but then your remote
needs a dynamic linker. Not sure if there's an example for it.<br>
<br>
Best<br>
Stefan<br>
<br>
On 18/07/2019 03:08, Rajesh S R via llvm-dev wrote:<br>
<blockquote type="cite"
cite="mid:CAKWTe273BNCW8ndWFVAF8Hgy48V8VCUq3X+yXE_=cPJbNsLqbw@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div dir="ltr">Hi all,
<div>I am following the LLVM JIT tutorial API based on: <a
href="https://llvm.org/docs/tutorial/BuildingAJIT1.html"
moz-do-not-send="true">https://llvm.org/docs/tutorial/BuildingAJIT1.html</a></div>
<div><br>
</div>
<div>I have 2 independent questions:</div>
<div>1. The tutorial mentions that "<b>will defer compilation of
the module until any of its definitions is looked up</b>". </div>
<div><br>
</div>
<div>Does that mean to force eager compilation, i have to keep
track of all functions added to the Module and do a lookup? I
want the module to be compiled fully after I do add module to
compile_layer. What is the best way to achieve this? Or should
I not use ORC API at all?</div>
<div><br>
</div>
<div>2. I want to compile on one process and want to ship the
machine code to another process and load it for execution
(with no lazy compilation where an uncompiled function will
trigger compilation to remote process which as I understand is
what the tutorial talks about). This means we need to generate
position-independent code and may need dynamic linking to
resolve any unknown function call based on symbol name. What
is the best way to achieve this? Is there some code pointers?</div>
<div><br>
</div>
<div>Thanks!</div>
<div><br>
</div>
<div>Rajesh S R</div>
</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>