<html xmlns:v="urn:schemas-microsoft-com:vml" 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=us-ascii"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:Wingdings;
panose-1:5 0 0 0 0 0 0 0 0 0;}
@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;}
@font-face
{font-family:"Book Antiqua";
panose-1:2 4 6 2 5 3 5 3 3 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
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;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
p.MsoPlainText, li.MsoPlainText, div.MsoPlainText
{mso-style-priority:99;
mso-style-link:"Plain Text Char";
margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Courier New";
mso-fareast-language:EN-US;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
{mso-style-priority:34;
margin-top:0cm;
margin-right:0cm;
margin-bottom:0cm;
margin-left:36.0pt;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Book Antiqua",serif;
font-variant:normal !important;
color:black;
text-transform:none;
text-shadow:none;
font-weight:normal;
font-style:normal;
text-decoration:none none;
vertical-align:baseline;}
span.PlainTextChar
{mso-style-name:"Plain Text Char";
mso-style-priority:99;
mso-style-link:"Plain Text";
font-family:"Courier New";}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
/* List Definitions */
@list l0
{mso-list-id:1059324788;
mso-list-type:hybrid;
mso-list-template-ids:1276833048 403243009 403243011 403243013 403243009 403243011 403243013 403243009 403243011 403243013;}
@list l0:level1
{mso-level-number-format:bullet;
mso-level-text:\F0B7;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Symbol;}
@list l0:level2
{mso-level-number-format:bullet;
mso-level-text:o;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:"Courier New";}
@list l0:level3
{mso-level-number-format:bullet;
mso-level-text:\F0A7;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Wingdings;}
@list l0:level4
{mso-level-number-format:bullet;
mso-level-text:\F0B7;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Symbol;}
@list l0:level5
{mso-level-number-format:bullet;
mso-level-text:o;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:"Courier New";}
@list l0:level6
{mso-level-number-format:bullet;
mso-level-text:\F0A7;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Wingdings;}
@list l0:level7
{mso-level-number-format:bullet;
mso-level-text:\F0B7;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Symbol;}
@list l0:level8
{mso-level-number-format:bullet;
mso-level-text:o;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:"Courier New";}
@list l0:level9
{mso-level-number-format:bullet;
mso-level-text:\F0A7;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Wingdings;}
ol
{margin-bottom:0cm;}
ul
{margin-bottom:0cm;}
--></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]--></head><body lang=EN-IE link="#0563C1" vlink="#954F72"><div class=WordSection1><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Book Antiqua",serif;color:black'>Our out-of-tree LLVM compiler is configured and built on Linux, but I cannot get it to run under the Windows 10 Linux Subsystem.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Book Antiqua",serif;color:black'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Book Antiqua",serif;color:black'>When run in this context it reports a crash:<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Book Antiqua",serif;color:black'><o:p> </o:p></span></p><p class=MsoPlainText style='margin-left:36.0pt'>warning: Error disabling address space randomisation: Success<o:p></o:p></p><p class=MsoPlainText style='margin-left:36.0pt'>warning: linux_ptrace_test_ret_to_nx: PTRACE_KILL waitpid returned -1: <o:p></o:p></p><p class=MsoPlainText style='margin-left:36.0pt'>Interrupted system call<o:p></o:p></p><p class=MsoPlainText style='margin-left:36.0pt'><o:p> </o:p></p><p class=MsoPlainText style='margin-left:36.0pt'>Program received signal SIGSEGV, Segmentation fault.<o:p></o:p></p><p class=MsoPlainText style='margin-left:36.0pt'>0x0000000003b31e1b in __ctype_init ()<o:p></o:p></p><p class=MsoPlainText style='margin-left:36.0pt'>(gdb) bt<o:p></o:p></p><p class=MsoPlainText style='margin-left:36.0pt'>#0 0x0000000003b31e1b in __ctype_init ()<o:p></o:p></p><p class=MsoPlainText style='margin-left:36.0pt'>#1 0x0000000003b2ed4e in __libc_start_main ()<o:p></o:p></p><p class=MsoPlainText style='margin-left:36.0pt'>#2 0x00000000004022ad in _start ()<o:p></o:p></p><p class=MsoPlainText style='margin-left:36.0pt'>(gdb) list<o:p></o:p></p><p class=MsoPlainText style='margin-left:36.0pt'>302<o:p></o:p></p><p class=MsoPlainText style='margin-left:36.0pt'><<i>myPathTo</i>>/llvm/tools/clang/tools/driver/driver.cpp: <o:p></o:p></p><p class=MsoPlainText style='margin-left:36.0pt'>No such file or directory.<o:p></o:p></p><p class=MsoPlainText style='margin-left:36.0pt'>(gdb)<o:p></o:p></p><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Book Antiqua",serif;color:black'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Book Antiqua",serif;color:black'>However, the Linux version from the LLVM website works perfectly, so it must be something to do with how I am configuring LLVM. The following are the OS and tool versions I am using:<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Book Antiqua",serif;color:black'><o:p> </o:p></span></p><p class=MsoListParagraph style='text-indent:-18.0pt;mso-list:l0 level1 lfo1'><![if !supportLists]><span style='font-size:12.0pt;font-family:Symbol;color:black'><span style='mso-list:Ignore'>·<span style='font:7.0pt "Times New Roman"'> </span></span></span><![endif]><span style='font-size:12.0pt;font-family:"Book Antiqua",serif;color:black'>CentOS Linux release 7.1.1503 (Core)<o:p></o:p></span></p><p class=MsoListParagraph style='text-indent:-18.0pt;mso-list:l0 level1 lfo1'><![if !supportLists]><span style='font-size:12.0pt;font-family:Symbol;color:black'><span style='mso-list:Ignore'>·<span style='font:7.0pt "Times New Roman"'> </span></span></span><![endif]><span style='font-size:12.0pt;font-family:"Book Antiqua",serif;color:black'>gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-4)<o:p></o:p></span></p><p class=MsoListParagraph style='text-indent:-18.0pt;mso-list:l0 level1 lfo1'><![if !supportLists]><span style='font-size:12.0pt;font-family:Symbol;color:black'><span style='mso-list:Ignore'>·<span style='font:7.0pt "Times New Roman"'> </span></span></span><![endif]><span style='font-size:12.0pt;font-family:"Book Antiqua",serif;color:black'>cmake version 3.5.2<o:p></o:p></span></p><p class=MsoListParagraph style='text-indent:-18.0pt;mso-list:l0 level1 lfo1'><![if !supportLists]><span style='font-size:12.0pt;font-family:Symbol;color:black'><span style='mso-list:Ignore'>·<span style='font:7.0pt "Times New Roman"'> </span></span></span><![endif]><span style='font-size:12.0pt;font-family:"Book Antiqua",serif;color:black'>GNU Make 3.82<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Book Antiqua",serif;color:black'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Book Antiqua",serif;color:black'>and I am configuring with the following options:<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Book Antiqua",serif;color:black'><o:p> </o:p></span></p><p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:12.0pt;font-family:"Courier New";color:black'>mkdir -p build/linux64<o:p></o:p></span></p><p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:12.0pt;font-family:"Courier New";color:black'>cd build/linux64<o:p></o:p></span></p><p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:12.0pt;font-family:"Courier New";color:black'>cmake -Wno-dev -G “Unix Makefiles” ../../llvm \<o:p></o:p></span></p><p class=MsoNormal style='margin-left:72.0pt'><span style='font-size:12.0pt;font-family:"Courier New";color:black'>"-DCMAKE_BUILD_TYPE:STRING=Debug" \<o:p></o:p></span></p><p class=MsoNormal style='margin-left:72.0pt'><span style='font-size:12.0pt;font-family:"Courier New";color:black'>"-DCMAKE_INSTALL_PREFIX:STRING=$(CLANG_INSTALL_ROOT)/Debug" \<o:p></o:p></span></p><p class=MsoNormal style='margin-left:72.0pt'><span style='font-size:12.0pt;font-family:"Courier New";color:black;background:yellow;mso-highlight:yellow'>"-DCMAKE_EXE_EXPORTS_C_FLAG:STRING=" \<o:p></o:p></span></p><p class=MsoNormal style='margin-left:72.0pt'><span style='font-size:12.0pt;font-family:"Courier New";color:black;background:yellow;mso-highlight:yellow'>"-DCMAKE_EXE_EXPORTS_CXX_FLAG:STRING=" \<o:p></o:p></span></p><p class=MsoNormal style='margin-left:72.0pt'><span style='font-size:12.0pt;font-family:"Courier New";color:black;background:yellow;mso-highlight:yellow'>"-DCMAKE_EXE_LINKER_FLAGS:STRING=-static-libgcc -static-libstdc++ -static" \</span><span style='font-size:12.0pt;font-family:"Courier New";color:black'><o:p></o:p></span></p><p class=MsoNormal style='margin-left:72.0pt'><span style='font-size:12.0pt;font-family:"Courier New";color:black'>-DLLVM_TARGETS_TO_BUILD="OURTARGET" \<o:p></o:p></span></p><p class=MsoNormal style='margin-left:72.0pt'><span style='font-size:12.0pt;font-family:"Courier New";color:black'>-DLLVM_DEFAULT_TARGET_TRIPLE=ourtarget<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Book Antiqua",serif;color:black'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Book Antiqua",serif;color:black'>Only the <span style='background:yellow;mso-highlight:yellow'>highlighted</span> options are perhaps unusual as I need to build with statically linked GCC libraries, and the ‘</span><span style='font-size:12.0pt;font-family:"Courier New";color:black'>DCMAKE_EXE_EXPORTS</span><span style='font-size:12.0pt;font-family:"Book Antiqua",serif;color:black'>’ flags were required to prevent another problem with dynamic libraries, though I have forgotten what this was now.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Book Antiqua",serif;color:black'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Book Antiqua",serif;color:black'>The resulting compiler works perfectly on Linux, but when I run the same binary in the Windows 10 Linux Subsystem, I get the crash report above.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Book Antiqua",serif;color:black'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Book Antiqua",serif;color:black'>Has anyone any idea what I need to do in my configuration to produce a healthy binary that will work in this subsystem? The packaged version on the LLVM website is fine, so I know that it is possible and I must have missed something.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Book Antiqua",serif;color:black'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Book Antiqua",serif;color:black'>Thanks,<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Book Antiqua",serif;color:black'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Book Antiqua",serif;color:black'> MartinO<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Book Antiqua",serif;color:black'><o:p> </o:p></span></p></div></body></html>