<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><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:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Times New Roman",serif;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style></head><body lang=EN-US link=blue vlink="#954F72"><div class=WordSection1><p class=MsoNormal>Well the error is correct, it’s just checking against the machine type in the PE spec:</p><p class=MsoNormal><o:p> </o:p></p><div><table class=MsoNormalTable border=1 cellspacing=0 cellpadding=0 width="100%" style='width:100.0%;border-collapse:collapse;border:none'><tr><td width="39%" valign=top style='width:39.08%;border:solid windowtext 1.0pt;padding:0in 5.4pt 0in 5.4pt'><p class=MsoNormal><span style='font-size:10.0pt'>IMAGE_FILE_MACHINE_AMD64<o:p></o:p></span></p></td><td width="10%" valign=top style='width:10.6%;border:solid windowtext 1.0pt;border-left:none;padding:0in 5.4pt 0in 5.4pt'><p class=MsoNormal><span style='font-size:10.0pt'>0x8664<o:p></o:p></span></p></td><td width="50%" valign=top style='width:50.32%;border:solid windowtext 1.0pt;border-left:none;padding:0in 5.4pt 0in 5.4pt'><p class=MsoNormal><span style='font-size:10.0pt'>x64<o:p></o:p></span></p></td></tr></table></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>So somewhere along the line an invalid PE file was generated (or for the wrong architecture).</p><div style='mso-element:para-border-div;border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;border:none;padding:0in'><br><b>From: </b>Ryan Scott<br><b>Sent: </b>Wednesday, November 18, 2015 00:44<br><b>To: </b>ghc-devs@haskell.org<br><b>Subject: </b>Re: Window build broken</p></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Times New Roman",serif'><o:p> </o:p></span></p><p class=MsoNormal>Wow, I happened to try building GHC on Windows for the first time ever</p><p class=MsoNormal>today, and I also experienced this error :)</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Interestingly, someone reported a very similar error to this on Trac,</p><p class=MsoNormal>but for GHC 7.8.3 [1]. Here's where the error message comes from [2]</p><p class=MsoNormal>in Linker.c:</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>    static int verifyCOFFHeader</p><p class=MsoNormal>    (COFF_header *hdr, pathchar *fileName)</p><p class=MsoNormal>    {</p><p class=MsoNormal>      if (hdr->Machine != 0x8664) {</p><p class=MsoNormal>        errorBelch("%" PATH_FMT ": Not x86_64 PEi386", fileName);</p><p class=MsoNormal>        return 0;</p><p class=MsoNormal>      }</p><p class=MsoNormal>      ...</p><p class=MsoNormal>    }</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Ryan S.</p><p class=MsoNormal>-----</p><p class=MsoNormal>[1] https://ghc.haskell.org/trac/ghc/ticket/10437</p><p class=MsoNormal>[2] https://github.com/ghc/ghc/blob/233d1312bf15940fca5feca6884f965e7944b555/rts/Linker.c#L3355</p><p class=MsoNormal>_______________________________________________</p><p class=MsoNormal>ghc-devs mailing list</p><p class=MsoNormal>ghc-devs@haskell.org</p><p class=MsoNormal>http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p></div></body></html>