<div dir="rtl"><div dir="ltr">clang uses its own *<span style="font-size:12.8000001907349px">intrin.h files, found in ..\lib\clang\3.7.0\include\ relative to the bin, which appears before the gcc include directories. </span><span style="font-size:12.8000001907349px">If you run clang++ -v somefile.cpp you'll see which directory clang looks for, it should look something like:</span></div><div dir="ltr"><span style="font-size:12.8000001907349px"><br></span></div><div dir="ltr"><span style="font-size:12.8000001907349px"><div dir="ltr">#include <...> search starts here:</div><div dir="ltr"> C:\mingw32\i686-w64-mingw32\include\c++</div><div dir="ltr"> C:\mingw32\i686-w64-mingw32\include\c++\i686-w64-mingw32</div><div dir="ltr"> C:\mingw32\i686-w64-mingw32\include\c++\backward</div><div dir="ltr"><b> C:\llvm\msvc\RelWithDebInfo\bin\..\lib\clang\3.7.0\include</b></div><div dir="ltr"> C:\mingw32\lib\gcc\i686-w64-mingw32\4.9.1\include</div><div dir="ltr"> C:\mingw32\lib\gcc\i686-w64-mingw32\4.9.1\include-fixed</div><div dir="ltr"> C:\mingw32\i686-w64-mingw32\include</div><div dir="ltr"> C:\mingw32\include</div><div dir="ltr"><br></div></span></div><div dir="ltr"><span style="font-size:12.8000001907349px"><br></span></div><div class="gmail_extra"><br><div class="gmail_quote"><div dir="ltr">2015-07-05 8:43 GMT+03:00 Edward Diener <span dir="ltr"><<a href="mailto:eldlistmailingz@tropicsoft.com" target="_blank">eldlistmailingz@tropicsoft.com</a>></span>:</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span>On 7/3/2015 10:59 AM, Yaron Keren wrote:<br>
</span><span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
You only need to have the bin directory in your PATH. clang will find<br>
the include and library directory based on the bin directory. There are<br>
no fixed paths, you can put in c:\mingw or wherever.<br>
</blockquote>
<br></span>
I ran into a problem using mingw-64 and the latest clang. In the mingw-64 intrin.h for gcc-4.9 on up it uses the gcc version number to decide whether to define the macro __MINGW_FORCE_SYS_INTRINS. If this macro is not defined it leads to multiple declarations for __m64 and some other CPU feature typdefs. Its gcc implementation defines __MINGW_FORCE_SYS_INTRINS for gcc-4.9 on up but clang still sets the gcc version number to gcc-4.2.1 so that __MINGW_FORCE_SYS_INTRINS is not automatically defined.<br>
<br>
My workaround for this was to define __MINGW_FORCE_SYS_INTRINS when using clang. This appears to work fine in my tests for clang but then I found a link of yours at <a href="http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20141110/118349.html" rel="noreferrer" target="_blank">http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20141110/118349.html</a> which appears to claim that defining __MINGW_FORCE_SYS_INTRINS forces the use of invalid CPU instructions when compiling with clang but evidently not when compiling with gcc.<br>
<br>
Does merely specifying all the x86-x64 compiler intrinsics, as the intrin.h in gcc-4.9 and up does, cause CPU instruction set problems when compiling with clang ? If so this means that I cannot use clang with gcc-4.9 and up unless I locally change their headers to avoid the problem. I have alerted mingw-64 about the general issue.<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span>
<br>
<br>
<br>
2015-07-03 16:13 GMT+03:00 Edward Diener<br>
<<a href="mailto:eldlistmailingz@tropicsoft.com" target="_blank">eldlistmailingz@tropicsoft.com</a><br></span>
<mailto:<a href="mailto:eldlistmailingz@tropicsoft.com" target="_blank">eldlistmailingz@tropicsoft.com</a>>>:<span><br>
<br>
On 6/25/2015 2:13 PM, Yaron Keren wrote:<br>
<br>
See <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__reviews.llvm.org_D5268&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=CnzuN65ENJ1H9py9XLiRvC_UQz6u3oG6GUNn7_wosSM&m=6v0YYUzHFzH7arlP_9zpzG3JiWS0RZk2iJCNknhFq2w&s=MbW9hMCfmYAvYW_gmgoNZDxw2dkTs9GWeBpSpkJ56Cs&e=" rel="noreferrer" target="_blank">http://reviews.llvm.org/D5268</a><br></span>
<<a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__reviews.llvm.org_D5268&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=CnzuN65ENJ1H9py9XLiRvC_UQz6u3oG6GUNn7_wosSM&m=ecMMp1TUmHLfiiZ_MlnPwTgmGQGZqkJoByqz4GWmOJ8&s=GyhTLhjqmvS-L0bXc8ytxxjhk6AnpKowj6eW2JYk9i4&e=" rel="noreferrer" target="_blank">https://urldefense.proofpoint.com/v2/url?u=http-3A__reviews.llvm.org_D5268&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=CnzuN65ENJ1H9py9XLiRvC_UQz6u3oG6GUNn7_wosSM&m=ecMMp1TUmHLfiiZ_MlnPwTgmGQGZqkJoByqz4GWmOJ8&s=GyhTLhjqmvS-L0bXc8ytxxjhk6AnpKowj6eW2JYk9i4&e=</a>><span><br>
<<a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__reviews.llvm.org_D5268&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=CnzuN65ENJ1H9py9XLiRvC_UQz6u3oG6GUNn7_wosSM&m=YgSrUuiAhPt76cF_h_LXb8Mg84W8p9nMvUiL3koHKP4&s=aW_6t6KDGfo5hO6NiTn5Hy9afNhzwfkX-BZHT9PtXmk&e=" rel="noreferrer" target="_blank">https://urldefense.proofpoint.com/v2/url?u=http-3A__reviews.llvm.org_D5268&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=CnzuN65ENJ1H9py9XLiRvC_UQz6u3oG6GUNn7_wosSM&m=YgSrUuiAhPt76cF_h_LXb8Mg84W8p9nMvUiL3koHKP4&s=aW_6t6KDGfo5hO6NiTn5Hy9afNhzwfkX-BZHT9PtXmk&e=</a>><br>
<br>
<br>
I can see that the patch has been applied officially to the latest<br>
clang source. It's in the latest code when I update llvm/clang.<br>
Thanks very much !<br>
<br>
But how do I use it ?<br>
<br>
Am I supposed to be able to build clang using a mingw-64 distro in<br>
my PATH ?<br>
<br>
When I compile with clang how do I tell it to use the mingw-64<br>
headers and RTL ? Does it matter whether the mingw-64 distro is 32<br>
bit or 64 bit ?<br>
<br>
Do I need to have the mingw-64 distro at c:\mingw ?<br>
<br>
I am willing to test this for clang and report back results here,<br>
since I can easily switch between mingw-64 distros ( 4.8.4, 4.9.2,<br>
5.1 ) and I test a number of Boost libraries including my own with<br>
clang, but I need a little information on how to do it.<br>
<br>
<br>
<br>
<br>
2015-06-25 10:46 GMT+03:00 Edward Diener<br>
<<a href="mailto:eldlistmailingz@tropicsoft.com" target="_blank">eldlistmailingz@tropicsoft.com</a><br>
<mailto:<a href="mailto:eldlistmailingz@tropicsoft.com" target="_blank">eldlistmailingz@tropicsoft.com</a>><br></span>
<mailto:<a href="mailto:eldlistmailingz@tropicsoft.com" target="_blank">eldlistmailingz@tropicsoft.com</a><div><div><br>
<mailto:<a href="mailto:eldlistmailingz@tropicsoft.com" target="_blank">eldlistmailingz@tropicsoft.com</a>>>>:<br>
<br>
<br>
For either the latest clang built from souce on Windows or<br>
a binary<br>
distribution of clang on Windows it appears that clang<br>
expects the<br>
supporting gcc include files and lib files to be in the<br>
hardcoded<br>
directory:<br>
<br>
c:\mingw<br>
<br>
and follow the mingw directory structure.<br>
<br>
1) Can this please be changed in the future so that some<br>
environment<br>
variable ( maybe CLANG_GCC ) can be set to the gcc installation<br>
rather than use a hardcoded path ?<br>
<br>
2) Can clang be updated to support the mingw-64 directory<br>
structure<br>
and not just the mingw directory structure ? The mingw-64<br>
distros<br>
seem now to be the preferred gcc distributions on Windows and<br>
support the latest versions of gcc.<br>
<br>
Do I need to make these suggestions on the clang bug<br>
tracker for the<br>
suggestions to be seriously considered ?u<br>
<br>
<br>
<br>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu" target="_blank">cfe-dev@cs.uiuc.edu</a><br></div></div>
<mailto:<a href="mailto:cfe-dev@cs.uiuc.edu" target="_blank">cfe-dev@cs.uiuc.edu</a>><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><span><br>
<br>
<br>
<br>
<br>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu" target="_blank">cfe-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
<br>
</span></blockquote><div><div>
<br>
<br>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu" target="_blank">cfe-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
</div></div></blockquote></div><br></div></div>