<div dir="ltr"><div>Hi Tim,</div><div><br></div>Thanks a lot for the replies, and the clarification !<div><br></div><div>I can now try these things. </div><div><br></div><div>Thanks and regards,<br>Sandeep.</div></div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Wed, May 28, 2014 at 2:07 AM, Tim Northover <span dir="ltr"><<a href="mailto:t.p.northover@gmail.com" target="_blank">t.p.northover@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Sandeep,<br>
<div class=""><br>
> Does it mean that I need to give -flto option for compilation while<br>
> building the libraries that I am using i.e. lttng-ust and libdl?<br>
<br>
</div>No, you can mix and match lto and non-lto files & libraries.<br>
<div class=""><br>
>> If you just want the LLVM IR for a reasonably large project, you<br>
>> should probably setup a parallel set of "build" steps that produce the<br>
>> IR but aren't involved in the actual compilation.<br>
><br>
> So, does it mean adding -flto option in each build step? Can you<br>
> please explain this a bit? I mean - how to set up such a parallel set<br>
> of builds in my case?<br>
<br>
</div>You need a compatible linker (which means ld.gold or a recent ld.bfd,<br>
I don't know the version off the top of my head). You then need to add<br>
"-flto" to both compile and link steps. With luck, that will just<br>
work. For example, with a trivial single file:<br>
<br>
$ clang -c -O3 -flto hello.c<br>
$ clang -flto hello.o -ohello<br>
<br>
But I realise I didn't say what -flto was: it's link-time<br>
optimization. Generally the code you get out is better, but it incurs<br>
significant memory and build time overheads. It may not be practical,<br>
depending on the size of your project.<br>
<br>
Cheers.<br>
<span class="HOEnZb"><font color="#888888"><br>
Tim.<br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br>Thanks and regards,<br>Sandeep K Chaudhary.
</div>