<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Mar 17, 2017 at 4:34 PM, Mateusz Mikuła 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:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div bgcolor="#FFFFFF">
<p>Hello,</p>
<p>I'm planing to get libc++ compiling with MinGW-w64, right now
without patches it fails with:</p>
<blockquote>
<p>CMake Error at projects/libcxx/CMakeLists.txt<wbr>:396 (message):<br>
C++11 or greater is required but the compiler does not support
c++11</p>
</blockquote>
<p>It is caused by adding `-nodefaultlibs` flag (it passes it's own
check <a href="https://github.com/llvm-mirror/libcxx/blob/master/cmake/config-ix.cmake#L27" target="_blank">[1]</a>).
However many following checks fail due to undefined references,
results with gcc <a href="https://reviews.llvm.org/P7975" target="_blank">[2]</a>
and clang <a href="https://reviews.llvm.org/P7976" target="_blank">[3]</a>.</p></div></blockquote><div>CMake seems to be adding system libraries automagically. Specifically it adds <span style="background-color:rgb(255,254,245);color:rgb(0,0,0);font-family:menlo,consolas,monaco,monospace;font-size:12px;white-space:pre-wrap"> -lgcc_s -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32.</span></div><div>I'm guessing that these libraries are where the undefined symbols are coming from, and I suspect the correct fix is to somehow prevent CMake from adding them.</div><div><br></div><div><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div bgcolor="#FFFFFF">
<p>Hard-coding 0 for LIBCXX_SUPPORTS_NODEFAULTLIBS_<wbr>FLAG allows it go
finish configuration and fail during build (that's another story).
<br>
</p>
<p>`-nodefaultlibs` appears several times in libc++ and libc++abi
code and I'm not sure about cleanest way to fix/workaround it.</p>
<p>Any suggestions?<br>
</p>
<p><br>
</p>
<p>[1]
<a class="gmail-m_5555656344556012329m_-6702888354140731109moz-txt-link-freetext" href="https://github.com/llvm-mirror/libcxx/blob/master/cmake/config-ix.cmake#L27" target="_blank">https://github.com/llvm-mirror<wbr>/libcxx/blob/master/cmake/<wbr>config-ix.cmake#L27</a></p>
<p>[2] <a class="gmail-m_5555656344556012329m_-6702888354140731109moz-txt-link-freetext" href="https://reviews.llvm.org/P7975" target="_blank">https://reviews.llvm.org/P7975</a><br>
</p>
<p>[3] <a class="gmail-m_5555656344556012329m_-6702888354140731109moz-txt-link-freetext" href="https://reviews.llvm.org/P7976" target="_blank">https://reviews.llvm.org/P7976</a></p>
<p><br>
</p>
<p>Thanks,</p>
<p>Mateusz<br>
</p>
</div>
<br>______________________________<wbr>_________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">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/<wbr>mailman/listinfo/cfe-dev</a><br>
<br></blockquote></div><br></div></div>