<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div dir="ltr">Why do you want to use the ELF format with the MS ABI?</div><div dir="ltr"><br><blockquote type="cite">On May 27, 2021, at 3:25 AM, Gaier, Bjoern via cfe-dev <cfe-dev@lists.llvm.org> wrote:<br><br></blockquote></div><blockquote type="cite"><div dir="ltr">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-GB">Hey everyone,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">I currently try to compile a few .cpp files under Windows with Clang-Cl, not targeting the COFF format, but instead I want to create ELF files. I do want to use the Microsoft headers and ABI, I just don't want to get
COFF files in the end. So I tried the following target:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">--target=x86_64-pc-windows-elf<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">From my understanding, I thought this should be correct? Sadly however Clang-Cl failes with:
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">1>fatal error: error in backend: invalid llvm.linker.options<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">------------------------------------------------------------------------<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">Instead I compiled the source file to an IR file to figure out what "invalid llvm.linker.options" might be and got:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">!llvm.linker.options = !{!0}<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">!llvm.dependent-libraries = !{!1, !2}<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">!llvm.module.flags = !{!3, !4, !5}<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">!llvm.ident = !{!6}<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">!0 = !{!"/FAILIFMISMATCH:\22_CRT_STDIO_ISO_WIDE_SPECIFIERS=0\22"}<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">!1 = !{!"msvcrt"}<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">!2 = !{!"oldnames"}<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">!3 = !{i32 1, !"wchar_size", i32 2}<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">!4 = !{i32 7, !"PIC Level", i32 2}<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">!5 = !{i32 7, !"uwtable", i32 1}<o:p></o:p></span></p>
<p class="MsoNormal">!6 = !{!"clang version 13.0.0 (<span lang="EN-GB"><a href="https://github.com/llvm/llvm-project.git"><span lang="DE">https://github.com/llvm/llvm-project.git</span></a></span> 5f500d73cd1aaff4c9ab2fd5c327c2d5ca9ae5c9)"}<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span lang="EN-GB">I assume "/FAILIFMISMATCH" is not supported for ELF files?<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">Is there a workaround for this issue or is it simply not possible to do what I wanted to do?<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">Kind greetings<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">Björn<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
</div>
Als GmbH eingetragen im Handelsregister Bad Homburg v.d.H. HRB 9816, USt.ID-Nr. DE 114 165 789 Geschäftsführer: Dr. Hiroshi Nakamura, Dr. Robert Plank, Markus Bode, Takashi Nagano, Junichi Tajika, Ergin Cansiz.
<span>_______________________________________________</span><br><span>cfe-dev mailing list</span><br><span>cfe-dev@lists.llvm.org</span><br><span>https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</span><br></div></blockquote></body></html>