<div dir="ltr">It should just work if you remove the Windows-only restriction in Attr.td:<div><div><br></div><div>def DLLExport : InheritableAttr, TargetSpecificAttr<TargetWindows> {</div><div> let Spellings = [Declspec<"dllexport">, GCC<"dllexport">];</div><div> let Subjects = SubjectList<[Function, Var, CXXRecord]>;</div><div> let Documentation = [Undocumented];</div><div>}</div><div><br></div><div>def DLLImport : InheritableAttr, TargetSpecificAttr<TargetWindows> {</div><div> let Spellings = [Declspec<"dllimport">, GCC<"dllimport">];</div><div> let Subjects = SubjectList<[Function, Var, CXXRecord]>;</div><div> let Documentation = [Undocumented];</div><div>}</div></div><div><br></div><div>I know Sony does this, so it can't require too much patching.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, May 30, 2016 at 6:38 AM, Martin J. O'Riordan via cfe-dev <span dir="ltr"><<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="EN-IE" link="#0563C1" vlink="#954F72"><div><p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Book Antiqua","serif"">For our SHAVE target I have re-used ‘</span><span style="font-size:12.0pt;font-family:"Courier New"">__attribute__((dllexport))</span><span style="font-size:12.0pt;font-family:"Book Antiqua","serif"">’ to allow me to create indirect address tables for symbols with this annotation.<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Book Antiqua","serif""><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Book Antiqua","serif"">However, with almost every release of LLVM and CLang my implementation is broken and I have to rework my implementation. For the most part, the existing ‘</span><span style="font-size:12.0pt;font-family:"Courier New";color:black">dllexport</span><span style="font-size:12.0pt;font-family:"Book Antiqua","serif"">’ attribute does everything I require and makes more sense for me to pass it through CLang/LLVM until it reaches our back-end where it emits the IAT support rather than adding my own new attribute.<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Book Antiqua","serif""><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Book Antiqua","serif"">This got broken again with v3.8 and this time the controls are more strict on Windows supporting targets. I thought that before I go in an make another set of changes to re-enable this with our target, that I would ask first if there anybody has any advice or recommendation for how to “borrow” this attribute for non-Windows targets? The problem is principally CLang rather than LLVM, so I would like to find a good and future-proof way of adapting CLang to enable this attribute on my target.<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Book Antiqua","serif""><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Book Antiqua","serif"">Thanks in advance,<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Book Antiqua","serif""><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Book Antiqua","serif""> MartinO<u></u><u></u></span></p><div style="border:none;border-bottom:solid windowtext 1.5pt;padding:0cm 0cm 1.0pt 0cm"><p class="MsoNormal" style="border:none;padding:0cm"><span lang="EN-GB" style="font-size:10.0pt;font-family:"Courier New""><u></u> <u></u></span></p></div><p class="MsoNormal"><span lang="EN-GB" style="font-size:10.0pt;font-family:"Courier New"">Martin J. O’Riordan Email: <a href="mailto:Martin.ORiordan@movidius.com" target="_blank">Martin.ORiordan@movidius.com</a><u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-GB" style="font-size:10.0pt;font-family:"Courier New"">Compiler Development Web: <a href="http://www.movidius.com/" target="_blank">www.movidius.com</a><u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-GB" style="font-size:10.0pt;font-family:"Courier New"">Movidius Ltd. Skype: moviMartinO<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-GB" style="font-size:10.0pt;font-family:"Courier New"">1st Floor, O’Connell Bridge House, d’Olier Street, Dublin 2, Ireland<u></u><u></u></span></p><p class="MsoNormal"><u></u> <u></u></p></div></div><br>_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
<br></blockquote></div><br></div>