<div dir="ltr">You are correct that "-cxx-abi microsoft" with an appropriate win32 triple is what I would consider ABI compatible.  However, reliance on that cc1 flag is ill-advised.  I (and to my knowledge all others involved in the MSVC ABI effort) want the triple to implicitly control which ABI is selected while removing the -cxx-abi flag altogether.
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Dec 25, 2013 at 11:39 PM, Astron B <span dir="ltr"><<a href="mailto:boldaster@gmail.com" target="_blank">boldaster@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hey David,<br>
<br>
Thanks a lot for the quick response. I had assumed this mode was already
 enabled since while using clang++.exe it said the target is 
i686-pc-win32 rather than i686-pc-mingw. When calling the clang driver cc1 directly is 
"-cxx-abi" "microsoft" the argument that enables this mode? Thanks.</div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Dec 26, 2013 at 2:28 PM, David Majnemer <span dir="ltr"><<a href="mailto:david.majnemer@gmail.com" target="_blank">david.majnemer@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">clang++.exe defaults to the mingw ABI.  It seems you want to use clang-cl.exe, it uses the MSVC ABI.  Note that clang-cl.exe's argument parsing is compatible with MSVC's cl.exe while clang++.exe is compatible with gcc.</div>


<div class="gmail_extra"><br><br><div class="gmail_quote"><div><div>On Wed, Dec 25, 2013 at 10:03 PM, Astron B <span dir="ltr"><<a href="mailto:boldaster@gmail.com" target="_blank">boldaster@gmail.com</a>></span> wrote:<br>

</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div>
<div dir="ltr"><div><div><div><div><div>Hey, <br><br>I have an issue while trying to link some clang compiled code. When I compile my test dll with clang I get a 
new operator like this:<br>
<br>__Znwj<br><br></div><div>I guess this is conformant with GCC's naming.<br></div><div><br></div>But when compiling with visual studio the new operator is:<br><br>Searching libraries<br>    Searching C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\LIB\MSVCRTD.lib:<br>




      Found __purecall<br>        Referenced in ConsoleApplication2.obj<br>        Loaded MSVCRTD.lib(MSVCR110D.dll)<br>      Found "void * __cdecl operator new(unsigned int)" (??2@YAPAXI@Z)<br>        Referenced in ConsoleApplication2.obj<br>




        Loaded MSVCRTD.lib(MSVCR110D.dll)<br>      Found "void __cdecl operator delete(void *)" (??3@YAXPAX@Z)<br>        Referenced in ConsoleApplication2.obj<br>        Loaded MSVCRTD.lib(MSVCR110D.dll)<br><br>




</div>I also noticed that with Clang I get a symbol for pure call catches called:<br>___cxa_pure_virtual<br><br></div>I assume the __purecall above is the visual studio version. <br><br></div>When I try to link the clang compiled object file using link.exe I get unresolved symbol errors because of this. <br>




<br>F:\LLVM-fresh\vs11\bin\Debug>clang++ -c testdll.cpp -o testdll.o -v<br>clang version 3.5 (trunk)<br>Target: i686-pc-win32<br>Thread model: posix<br> "F:\LLVM-fresh\vs11\bin\Debug\clang++.exe" -cc1 -triple i686-pc-win32 -emit-obj<br>




 -mrelax-all -disable-free -main-file-name testdll.cpp -mrelocation-model static<br> -mdisable-fp-elim -fmath-errno -masm-verbose -mconstructor-aliases -target-cpu<br>pentium4 -v -coverage-file "F:\\LLVM-fresh\\vs11\\bin\\Debug\\testdll.o" -resour<br>




ce-dir "F:\\LLVM-fresh\\vs11\\bin\\Debug\\..\\lib\\clang\\3.5" -internal-isystem<br> "F:\\LLVM-fresh\\vs11\\bin\\Debug\\..\\lib\\clang\\3.5\\include" -internal-isys<br>tem "C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\INCLUDE" -intern<br>




al-isystem "C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\ATLMFC\\I<br>NCLUDE" -internal-isystem "C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v7.<br>0A\\include" -std=c++11 -fdeprecated-macro -fdebug-compilation-dir "F:\\LLVM-fre<br>




sh\\vs11\\bin\\Debug" -ferror-limit 19 -fmessage-length 80 -mstackrealign -fms-e<br>xtensions -fms-compatibility -fmsc-version=1700 -fdelayed-template-parsing -fobj<br>c-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-di<br>




agnostics -vectorize-slp -o testdll.o -x c++ testdll.cpp<br>clang -cc1 version 3.5 based upon LLVM 3.5svn default target i686-pc-win32<br>#include "..." search starts here:<br>#include <...> search starts here:<br>




 F:\LLVM-fresh\vs11\bin\Debug\..\lib\clang\3.5\include<br> C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE<br> C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\ATLMFC\INCLUDE<br> C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include<br>




End of search list.<br><br>F:\LLVM-fresh\vs11\bin\Debug>nm testdll.o<br>00000000 t .text<br>00000000 t .text<br>00000001 a @feat.00<br>00000000 T __ZN7testOneC2Ev<br>         U __Znwj<br>00000000 T _whatever<br><br>F:\LLVM-fresh\vs11\bin\Debug><br>




<br><br>C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin>link /DLL /NOENTRY te<br>stdll.o /VERBOSE<br>Microsoft (R) Incremental Linker Version 11.00.50727.1<br>Copyright (C) Microsoft Corporation.  All rights reserved.<br>




<br><br>Starting pass 1<br><br>Searching libraries<br><br>Finished searching libraries<br><br>Finished pass 1<br><br>testdll.o : error LNK2019: unresolved external symbol __Znwj referenced in funct<br>ion _whatever<br>testdll.dll : fatal error LNK1120: 1 unresolved externals<br>




<br><br><br></div>How can I get this to link? Thanks.</div>
<br></div></div>_______________________________________________<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" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>