<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Aug 9, 2016, at 9:24 AM, Kevin Choi via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">-Wl,--plugin=LLVMgold.so,--<wbr class="">plugin-opt=emit-llvm<br class=""></div></div></blockquote><div><br class=""></div><div>This is totally Gold specific. The fact that he mentions using LTOCodeGenerator makes me think that he does not use Gold.</div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><br class=""><a href="http://llvm.org/docs/CommandGuide/opt.html" target="_blank" class="">http://llvm.org/docs/<wbr class="">CommandGuide/opt.html</a><br class=""><a href="http://llvm.org/docs/CommandGuide/llc.html" target="_blank" class="">http://llvm.org/docs/<wbr class="">CommandGuide/llc.html</a><br class=""><br class="">"The <strong class="">llc</strong> command compiles LLVM source inputs into assembly language
for a specified architecture."</div><div class="gmail_extra"><br class=""><div class="gmail_quote">On 9 August 2016 at 04:16, Umesh Kalappa via llvm-dev <span dir="ltr" class=""><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank" class="">llvm-dev@lists.llvm.org</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Guys ,<br class="">
<br class="">
We enabled the LTO on our code base and found that LTO uses the<br class="">
integrated/builtin assembler to emit the final optimized code .O<br class="">
(FileType= CGFT_ObjectFile) .<br class="">
<br class="">
Can we bypass this semantic ,for something like you emit .S  file<br class="">
(FileType=CGFT_AssemblyFile),<br class="">
<br class="">
Then we pass this  .S file to our native assembler and  the linker<br class="">
.....any switch/ options  do so ?<br class="">
<br class="">
i.e  something like as we have   "-no-integrated-as" for clang driver .<br class="">
<br class="">
Currently ,we thought of hacking the LTOCodeGenerator.cpp for the same .<br class="">
<br class="">
The bottom-line is that ,we need to use our native assembler ,not the builtin .<br class="">
<br class="">
Any thoughts on this ?<br class=""></blockquote></div></div></div></blockquote><div><br class=""></div><div>Unfortunately there is no “ready-to-use” way, clang has a driver that can dump intermediate file (here the .s) and invoke a chain of commands. The linker plugin is not designed this way, it is invoked by the linker and given the input bitcode will produce one or multiple object files for the linker.</div><div>What you want to do could be achieved by hacking the LTOCodeGenerator and do something like use posix_spawn and pipes to invoke your assembler.</div><div>Otherwise you can also do something like what Kevin had in mind: ask LTOCodeGenerator to produce the bitcode before the backend and exit the linker process at this point, then run llc on it to get the assembly, assemble it, and re-invoke the linker. This is probably less convenient if you need to integrate with a build system.</div><div><br class=""></div><div>— </div><div>Mehdi</div><div><br class=""></div></div></body></html>