<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Mar 23, 2017 at 4:55 AM, Mateusz Mikuła <span dir="ltr"><<a href="mailto:mati865@gmail.com" target="_blank">mati865@gmail.com</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">
<div id="gmail-m_-4175624814147688239smartTemplate4-template">
<p> Yes, logs come from unmodified build of in-tree build of
libc++.</p>
<p>Here is NODEFAULTLIBS check<br>
</p>
<blockquote>
<p>Performing C++ SOURCE FILE Test
LIBCXXABI_HAS_NODEFAULTLIBS_<wbr>FLAG succeeded with the following
output:<br>
Change Dir:
D:/projekty/msys2/MINGW-<wbr>packages/mingw-w64-clang/src/<wbr>build-i686/CMakeFiles/CMakeTmp<br>
<br>
Run Build Command:"D:/msys64/usr/bin/<wbr>make.exe"
"cmTC_a0b32/fast"<br>
/usr/bin/make -f CMakeFiles/cmTC_a0b32.dir/<wbr>build.make
CMakeFiles/cmTC_a0b32.dir/<wbr>build<br>
[1;34mmake[1]: [0m Entering directory
'/d/projekty/msys2/MINGW-<wbr>packages/mingw-w64-clang/src/<wbr>build-i686/CMakeFiles/<wbr>CMakeTmp'<br>
Building CXX object CMakeFiles/cmTC_a0b32.dir/src.<wbr>cxx.obj<br>
/D/msys64/mingw32/bin/g++.exe <wbr> -D_GNU_SOURCE -Wall -W
-Wno-unused-parameter -Wwrite-strings -Wcast-qual
-Wno-missing-field-<wbr>initializers -pedantic -Wno-long-long
-Wno-maybe-uninitialized -Wdelete-non-virtual-dtor
-Wno-comment -Werror=date-time -std=gnu++11
-DLIBCXXABI_HAS_NODEFAULTLIBS_<wbr>FLAG -nodefaultlibs -o
CMakeFiles/cmTC_a0b32.dir/src.<wbr>cxx.obj -c
/D/projekty/msys2/MINGW-<wbr>packages/mingw-w64-clang/src/<wbr>build-i686/CMakeFiles/<wbr>CMakeTmp/src.cxx<br>
Linking CXX executable cmTC_a0b32.exe<br>
/D/msys64/mingw32/bin/cmake.<wbr>exe -E remove -f
CMakeFiles/cmTC_a0b32.dir/<wbr>objects.a<br>
/D/msys64/mingw32/bin/ar.exe cr
CMakeFiles/cmTC_a0b32.dir/<wbr>objects.a
"CMakeFiles/cmTC_a0b32.dir/<wbr>src.cxx.obj" <br>
/D/msys64/mingw32/bin/g++.exe -D_GNU_SOURCE -Wall -W
-Wno-unused-parameter -Wwrite-strings -Wcast-qual
-Wno-missing-field-<wbr>initializers -pedantic -Wno-long-long
-Wno-maybe-uninitialized -Wdelete-non-virtual-dtor
-Wno-comment -Werror=date-time -std=gnu++11
-DLIBCXXABI_HAS_NODEFAULTLIBS_<wbr>FLAG -pipe
-Wl,--stack,16777216 -Wl,--whole-archive
CMakeFiles/cmTC_a0b32.dir/<wbr>objects.a -Wl,--no-whole-archive -o
cmTC_a0b32.exe
-Wl,--major-image-version,0,--<wbr>minor-image-version,0 -lkernel32
-luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32
-luuid -lcomdlg32 -ladvapi32 <br>
[1;34mmake[1]: [0m Leaving directory
'/d/projekty/msys2/MINGW-<wbr>packages/mingw-w64-clang/src/<wbr>build-i686/CMakeFiles/<wbr>CMakeTmp'<br>
<br>
Source file was:<br>
int main() { return 0; }</p>
<p><br>
</p>
</blockquote>
</div>
I'll try out of tree build soon.<br></div></blockquote><div><br></div><div>I don't think that will make a difference. LLVM isn't adding these libraries AFAIK. They must be getting automatically added by CMake.</div><div>Can you check if they're getting added via "CMAKE_REQUIRED_LIBRARIES"?</div><div><br></div><div>I've been looking for CMake documentation about this but I can't find anything.</div><div><br></div><div>/Eric</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">
<br>
<br>
<div id="gmail-m_-4175624814147688239smartTemplate4-quoteHeader">------ Original Message ------<br>
Subject: Re: [cfe-dev] [libc++] Compiling with MinGW-w64<br>
Date: Thu, 23 Mar 2017 02:34:09 -0600<br>
To: Mateusz Mikuła<br>
From: Eric Fiselier</div><div><div class="gmail-h5">
<blockquote type="cite">
<div dir="ltr">Just to verify you're not manually adding any of
the following libraries, right?
<div><br>
</div>
<div><span style="color:rgb(0,0,0);font-family:menlo,consolas,monaco,monospace;font-size:12px;white-space:pre-wrap;background-color:rgb(255,254,245)">-lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32</span><br>
</div>
<div><span style="color:rgb(0,0,0);font-family:menlo,consolas,monaco,monospace;font-size:12px;white-space:pre-wrap;background-color:rgb(255,254,245)">
</span></div>
<div><span style="color:rgb(0,0,0);font-family:menlo,consolas,monaco,monospace;font-size:12px;white-space:pre-wrap;background-color:rgb(255,254,245)">/Eric</span></div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Wed, Mar 22, 2017 at 7:04 PM, Eric
Fiselier <span dir="ltr"><<a href="mailto:eric@efcs.ca" target="_blank">eric@efcs.ca</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 dir="ltr"><br>
<div class="gmail_extra"><br>
<div class="gmail_quote"><span>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>
</span>
<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"><span>
<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_-4175624814147688239m_-308411374499290371gmail-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/conf<wbr>ig-ix.cmake#L27</a></p>
<p>[2] <a class="gmail-m_-4175624814147688239m_-308411374499290371gmail-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_-4175624814147688239m_-308411374499290371gmail-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>
</span>______________________________<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>
</blockquote>
</div>
<br>
</div>
</blockquote>
<br>
</div></div></div>
</blockquote></div><br></div></div>