<div dir="ltr">I've added myself to the review thread and commented.<div><br></div><div>Thanks!</div><div><br></div><div>-eric<br><br><div class="gmail_quote">On Thu Jan 29 2015 at 3:49:46 AM Vladimir Medic <<a href="mailto:Vladimir.Medic@imgtec.com">Vladimir.Medic@imgtec.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">




<div vlink="purple" lang="EN-GB" link="blue">
<div style="direction:ltr;font-family:Tahoma;color:#000000;font-size:10pt">Hi Eric,<br>
as I was working on the same issues that are covered in your patch I also made a change in clang driver to pass this option to the assembler. Could you please review it and tell me your opinion?<br>
<a href="http://reviews.llvm.org/D6091" target="_blank">http://reviews.llvm.org/D6091</a><br>
<br>
Thanks<br>
<br>
Vladimir<br>
<div style="font-family:Times New Roman;color:#000000;font-size:16px">
<hr>
<div style="direction:ltr"><font face="Tahoma" color="#000000"><b>From:</b> Daniel Sanders<br>
<b>Sent:</b> Wednesday, January 28, 2015 8:59 PM<br>
<b>To:</b> Eric Christopher; Vladimir Medic; <a href="mailto:llvmdev@cs.uiuc.edu" target="_blank">llvmdev@cs.uiuc.edu</a><br>
<b>Subject:</b> RE: [LLVMdev] [Mips][TargetOptions] How to properly instantiate TargetOptions in MC layer?<br>
</font><br>
</div></div></div></div><div vlink="purple" lang="EN-GB" link="blue"><div style="direction:ltr;font-family:Tahoma;color:#000000;font-size:10pt"><div style="font-family:Times New Roman;color:#000000;font-size:16px">
<div></div>
<div>
<div style="direction:ltr;font-family:Tahoma;color:#000000;font-size:10pt">
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"">Hi Eric,</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><br>
</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"">The main thing we need to fix is that the selection between ELF32/ELF64 needs to depend on the ABI being N64 and not on whether we used a
<span>mips</span>-<span>linux</span>-gnu triple versus a mips64-linux-gnu triple. So 'clang -target mips-linux-gnu' -mips64r2 -mabi=64' should produce an ELF64 and 'clang -target mips64-linux-gnu -mips32r2 -mabi=32' should produce
 an ELF32. In terms of code, we need to get the ABI name to createMipsELFObjectWriter().<br>
</span></p>
<p class="MsoNormal"><br>
<span style="font-size:11.0pt;font-family:"Calibri","sans-serif""></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""></span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"">One of your commits on Monday (r227102) seems to make this a lot easier than it was looking last
 week when Vladimir and I were discussing this internally (I've been off sick so I only saw your commit last night). I haven't had chance to try this but I'm currently thinking that createMCAsmBackend() should have an LLVMTargetMachine* argument. The Mips-specific
 versions of this function can then get the ABI name from there and pass it down to createMipsELFObjectWriter().<br>
</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""> </span></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt">
<div>
<div style="border:none;border-top:solid #b5c4df 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><a name="msg-f:1491633109691890128__MailOriginal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"" lang="EN-US">From:</span></b></a><span><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"" lang="EN-US"> <a href="mailto:llvmdev-bounces@cs.uiuc.edu" target="_blank">llvmdev-bounces@cs.uiuc.edu</a>
 [mailto:<a href="mailto:llvmdev-bounces@cs.uiuc.edu" target="_blank">llvmdev-bounces@cs.uiuc.edu</a>] <b>On Behalf Of </b>Eric Christopher<br>
<b>Sent:</b> 28 January 2015 00:00<br>
<b>To:</b> Vladimir Medic; <a href="mailto:llvmdev@cs.uiuc.edu" target="_blank">llvmdev@cs.uiuc.edu</a><br>
<b>Subject:</b> Re: [LLVMdev] [Mips][TargetOptions] How to properly instantiate TargetOptions in MC layer?</span></span></p>
</div>
</div>
<p class="MsoNormal"><span> </span></p>
<div>
<p class="MsoNormal"><span>You can't really get there from here is the short answer. You can possible get MCTargetOptions, but then you need to change all of the constructors and calls across all of the backends to do this.<br>
<br>
I fixed all of the things that are currently in tree - what are you seeing or what do you need migrated around?</span></p>
<div>
<p class="MsoNormal"><span> </span></p>
</div>
<div>
<p class="MsoNormal"><span>-eric</span></p>
</div>
<div>
<p class="MsoNormal"><span> </span></p>
</div>
<div>
<p class="MsoNormal"><span>ps. Also, cc'ing me on it would have likely gotten you a faster answer, I just noticed this while going through email.</span></p>
</div>
</div>
<p class="MsoNormal"><span> </span></p>
<div>
<p class="MsoNormal"><span>On Tue Jan 27 2015 at 5:49:58 AM Vladimir Medic <</span><a href="mailto:Vladimir.Medic@imgtec.com" target="_blank"><span>Vladimir.Medic@imgtec.com</span><span></span></a><span>> wrote:</span></p>
<div>
<div>
<p class="MsoNormal"><span><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:black">Hi all,<br>
we have several features in Mips that are dependent on target abi. A recent commit(r224492) introduced a new -target-abi option to TargetOptions struct that provides access to abi string. This info is stored in MCSubtarget class(ARMSubratget in this case) and
 distributed to other libraries. Unfortunately, for Mips we need this info in other classes that don't have access to MCSubtarget class, like MCAsmBackend and MCTargetStreamer and instantiating a new copy od TargetOption causes  link errors as it is already
 instantiated in some drivers(llc.cpp for example). What would be the proper way to get the TargetOptions struct available in other classes?<br>
<br>
Kind regards,<br>
<br>
Vladimir</span></span></p>
</div>
</div>
<p class="MsoNormal"><span>_______________________________________________<br>
LLVM Developers mailing list<br>
</span><a href="mailto:LLVMdev@cs.uiuc.edu" target="_blank"><span>LLVMdev@cs.uiuc.edu</span><span></span></a><span>         </span><a href="http://llvm.cs.uiuc.edu" target="_blank"><span>http://llvm.cs.uiuc.edu</span><span></span></a><span><br>
</span><a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank"><span>http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</span><span></span></a><span></span></p>
</div>
</div>
</div>
</div>
</div>
</div></div></div></blockquote></div></div></div>