VisualStudio 2013 Build Clang Success, But Clang can't use

When I use VS2013 to build clang successfully, using Clang compile C or C + + program, whether it is with VC + +2012 (Windows kit 8.0) backend or VC + +2013 (Windows kit 8.1) as the backend, Clang without a exceptions are unresponsive.

Use Visual Studio 2013 X64 toochain( Lib Header tools)
E:\ClangSetup\Build\MSVC12\X64_CPack_Packages\win64\NSIS\LLVM-3.4.svn-win64>clang bd.c -v
clang version 3.4 (trunk)
Target: x86_64-pc-win32
Thread model: posix
“E:\ClangSetup\Build\MSVC12\X64_CPack_Packages\win64\NSIS\LLVM-3.4.svn-win64\bin\clang.exe” -cc1 -triple x86_64-pc-win
32 -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -main-file-name bd.c -mrelocation-model pic -pic-level 2 -
mdisable-fp-elim -fmath-errno -masm-verbose -mconstructor-aliases -munwind-tables -target-cpu x86-64 -v -resource-dir “E
:\ClangSetup\Build\MSVC12\X64\_CPack_Packages\win64\NSIS\LLVM-3.4.svn-win64\bin\…\lib\clang\3.4” -internal
-isystem “E:\ClangSetup\Build\MSVC12\X64\_CPack_Packages\win64\NSIS\LLVM-3.4.svn-win64\bin\…\lib\clang\3.4
\include” -internal-isystem “E:\ClangSetup\Build\MSVC12\X64\_CPack_Packages\win64\NSIS\LLVM-3.4.svn-win64\incl
ude” -internal-isystem “D:\Program Files\Microsoft Visual Studio 12.0\VC\INCLUDE” -internal-isystem “D:\Program Fil
es\Microsoft Visual Studio 12.0\VC\ATLMFC\INCLUDE” -internal-isystem “C:\Program Files (x86)\Windows Kits\8.1\in
clude\shared” -internal-isystem “C:\Program Files (x86)\Windows Kits\8.1\include\um” -internal-isystem “C:\Progra
m Files (x86)\Windows Kits\8.1\include\winrt” -fdebug-compilation-dir “E:\ClangSetup\Build\MSVC12\X64\_CPack_Pa
ckages\win64\NSIS\LLVM-3.4.svn-win64” -ferror-limit 19 -fmessage-length 120 -mstackrealign -fms-extensions -fms-compa
tibility -fmsc-version=1700 -fdelayed-template-parsing -fobjc-runtime=gcc -fdiagnostics-show-option -fcolor-diagnostics
-vectorize-slp -o “D:\Users\HUXIZE~1\Local\Temp\bd-f135a8.o” -x c bd.c
clang -cc1 version 3.4 based upon LLVM 3.4svn default target x86_64-pc-win32
#include “…” search starts here:
#include <…> search starts here:
E:\ClangSetup\Build\MSVC12\X64_CPack_Packages\win64\NSIS\LLVM-3.4.svn-win64\bin…\lib\clang\3.4\include
E:\ClangSetup\Build\MSVC12\X64_CPack_Packages\win64\NSIS\LLVM-3.4.svn-win64\include
D:\Program Files\Microsoft Visual Studio 12.0\VC\INCLUDE
D:\Program Files\Microsoft Visual Studio 12.0\VC\ATLMFC\INCLUDE
C:\Program Files (x86)\Windows Kits\8.1\include\shared
C:\Program Files (x86)\Windows Kits\8.1\include\um
C:\Program Files (x86)\Windows Kits\8.1\include\winrt
End of search list.
Stack dump:
0. Program arguments: E:\ClangSetup\Build\MSVC12\X64_CPack_Packages\win64\NSIS\LLVM-3.4.svn-win64\bin\clang.exe -c
c1 -triple x86_64-pc-win32 -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -main-file-name bd.c -mrelocation-
model pic -pic-level 2 -mdisable-fp-elim -fmath-errno -masm-verbose -mconstructor-aliases -munwind-tables -target-cpu x8
6-64 -v -resource-dir E:\ClangSetup\Build\MSVC12\X64_CPack_Packages\win64\NSIS\LLVM-3.4.svn-win64\bin…\lib\clang\3.4
-internal-isystem E:\ClangSetup\Build\MSVC12\X64_CPack_Packages\win64\NSIS\LLVM-3.4.svn-win64\bin…\lib\clang\3.4\incl
ude -internal-isystem E:\ClangSetup\Build\MSVC12\X64_CPack_Packages\win64\NSIS\LLVM-3.4.svn-win64\include -internal-isy
stem D:\Program Files\Microsoft Visual Studio 12.0\VC\INCLUDE -internal-isystem D:\Program Files\Microsoft Visual Studio
12.0\VC\ATLMFC\INCLUDE -internal-isystem C:\Program Files (x86)\Windows Kits\8.1\include\shared -internal-isystem C:\Pr
ogram Files (x86)\Windows Kits\8.1\include\um -internal-isystem C:\Program Files (x86)\Windows Kits\8.1\include\winrt -f
debug-compilation-dir E:\ClangSetup\Build\MSVC12\X64_CPack_Packages\win64\NSIS\LLVM-3.4.svn-win64 -ferror-limit 19 -fme
ssage-length 120 -mstackrealign -fms-extensions -fms-compatibility -fmsc-version=1700 -fdelayed-template-parsing -fobjc-
runtime=gcc -fdiagnostics-show-option -fcolor-diagnostics -vectorize-slp -o D:\Users\HUXIZE~1\Local\Temp\bd-f135a8.o -x
c bd.c

  1. D:\Program Files\Microsoft Visual Studio 12.0\VC\INCLUDE\crtdefs.h:2074:55: current parser token ‘;’
    0x00007FF7985D06D0 (0x00000023410D1220 0x000000234101C610 0x000000234101D5B0 0x0000000000000000)
    0x00007FF798130777 (0x00000023410AEE78 0x0000000000000000 0x00000023000282D0 0x0000000000000006)
    0x00007FF798128160 (0x000000234101CDF0 0x00000023410AED20 0x000000234101CDF0 0x00007FF797F4B422)
    0x00007FF798128B83 (0x00000023430DD0D8 0x00007FF79811923F 0x0000000000000000 0x00000023410AEE78)
    0x00007FF79812BC11 (0x00000023430DD0F8 0x00000023410DBDD0 0x00000023430DD0F8 0x000000234101C7C0)
    0x00007FF798029659 (0x0000002341289EC7 0x0000002341130B80 0x000000234101CB60 0x00000023430DD0C0)
    0x00007FF7980101AF (0x0000002300000002 0x000000234101C990 0x00003B574CB1BEA9 0x000000234101C9D0)
    0x00007FF797F96785 (0x00000023000282E7 0x0000002341130B70 0x00007FF797F99818 0x0000002341130B70)
    0x00007FF797F95AFA (0x000000234101DAF0 0x00007FF797F4B422 0x000000234101D560 0x000000234101D600)
    0x00007FF797F9FA34 (0x0000002341130B70 0x00000023410AED20 0x0000002341130B70 0x00007FF797F4B422)
    0x00007FF797F9603D (0x0000000000000000 0x0000000000000000 0x0000002341130B70 0x000000234101DB38)
    0x00007FF797F873AC (0x0000000000000000 0x00000023430D7D00 0x000000234101DB80 0x00000023410ADAB0)
    0x00007FF797F89159 (0x0000002341130E78 0x00000023430D7D00 0x0000002341130B70 0x00000023410CFC50)
    0x00007FF797F836F6 (0x0000000000000000 0x0000000000000000 0x00000023410A43F0 0x0000000000000000)
    0x00007FF797F076CB (0x00000023410A83D0 0x00000023410A43F0 0x00000023410AD280 0x00000023410A8300)
    0x00007FF797DCB9A7 (0x00000023410A83D0 0x0000000000000000 0x00000023410A43F0 0x00000023410A83D0)
    0x00007FF797F075D3 (0x0000000000000000 0x00000023410A43F0 0x00000023410A43F0 0x0000000000000000)
    0x00007FF797F00412 (0x00000023410A56A0 0x00000023410A43F0 0x00000023410A83D0 0x0000000000000000)
    0x00007FF797DBBCE9 (0x00000023410A43F0 0x00000023410A43F0 0x000000234109A1A0 0x00000023410A5780)
    0x00007FF79758F470 (0x00000023410A1070 0x0000000000000000 0x000000000000003A 0x0000000000000000)
    0x00007FF79758DD29 (0x0000000000000000 0x0000000000000000 0x0000000000000001 0x0000000000000000)
    0x00007FF7984C6580 (0x0000000000000000 0x0000000000000000 0x0000000000000000 0x0000000000000000)
    0x00007FF9BB7C15BD (0x0000000000000000 0x0000000000000000 0x0000000000000000 0x0000000000000000), BaseThreadInitThunk()
  • 0xD bytes(s)
    0x00007FF9BC6E43D1 (0x0000000000000000 0x0000000000000000 0x0000000000000000 0x0000000000000000), RtlUserThreadStart() +
    0x1D bytes(s)
    clang.exe: error: clang frontend command failed due to signal (use -v to see invocation)
    clang version 3.4 (trunk)
    Target: x86_64-pc-win32
    Thread model: posix
    clang.exe: note: diagnostic msg: PLEASE submit a bug report to http://llvm.org/bugs/ and include the crash backtrace, pr
    eprocessed source, and associated run script.
    clang.exe: note: diagnostic msg:

This needs more information. If you build clang with debug information, then it will automatically symbolize the stack trace of your crashes.

I test Debug build

Build.Script 2013/10/16 周三 16:41:17.39 Start
E:\ClangSetup\Build\MSVC12\X64\bin>clang -v
clang version 3.4 (trunk)
Target: x86_64-pc-win32
Thread model: posix
E:\ClangSetup\Build\MSVC12\X64\bin>clang bd.c -v
clang version 3.4 (trunk)
Target: x86_64-pc-win32
Thread model: posix
“E:\ClangSetup\Build\MSVC12\X64\bin\Debug\clang.exe” -cc1 -triple x86_64-pc-win32 -emit-obj -mrelax-all -disable-free -
main-file-name bd.c -mrelocation-model pic -pic-level 2 -mdisable-fp-elim -fmath-errno -masm-verbose -mconstructor-alias
es -munwind-tables -target-cpu x86-64 -v -resource-dir “E:\ClangSetup\Build\MSVC12\X64\bin\Debug\…\lib\clang\
3.4” -internal-isystem “E:\ClangSetup\Build\MSVC12\X64\bin\Debug\…\lib\clang\3.4\include” -internal-isystem
“D:\Program Files\Microsoft Visual Studio 12.0\VC\INCLUDE” -internal-isystem “D:\Program Files\Microsoft Visual St
udio 12.0\VC\ATLMFC\INCLUDE” -internal-isystem “C:\Program Files (x86)\Windows Kits\8.1\include\shared” -interna
l-isystem “C:\Program Files (x86)\Windows Kits\8.1\include\um” -internal-isystem “C:\Program Files (x86)\Windows
Kits\8.1\include\winrt” -fdebug-compilation-dir “E:\ClangSetup\Build\MSVC12\X64\bin” -ferror-limit 19 -fmessage-
length 120 -mstackrealign -fms-extensions -fms-compatibility -fmsc-version=1700 -fdelayed-template-parsing -fobjc-runtim
e=gcc -fdiagnostics-show-option -fcolor-diagnostics -vectorize-slp -o “D:\Users\HUXIZE~1\Local\Temp\bd-251b4e.o” -x
c bd.c
clang -cc1 version 3.4 based upon LLVM 3.4svn default target x86_64-pc-win32
#include “…” search starts here:
#include <…> search starts here:
E:\ClangSetup\Build\MSVC12\X64\bin\Debug…\lib\clang\3.4\include
D:\Program Files\Microsoft Visual Studio 12.0\VC\INCLUDE
D:\Program Files\Microsoft Visual Studio 12.0\VC\ATLMFC\INCLUDE
C:\Program Files (x86)\Windows Kits\8.1\include\shared
C:\Program Files (x86)\Windows Kits\8.1\include\um
C:\Program Files (x86)\Windows Kits\8.1\include\winrt
End of search list.
Assertion failed: isa(Val) && “cast_or_null() argument of incompatible type!”, file E:\ClangSetup\LLVM\include\ll
vm/Support/Casting.h, line 250
clang.exe: error: clang frontend command failed with exit code 3 (use -v to see invocation)
E:\ClangSetup\Build\MSVC12\X64\bin>

Please file this at llvm.org/bugs under clang. When an assertion fails, the CRT will pop an abort, retry, or ignore dialog. Hit “retry” to get a stack trace.

ntdll.dll!00007ffbd26c43d1() unknow

Please file this at llvm.org/bugs under clang. When an assertion fails, the CRT will pop an abort, retry, or ignore dialog. Hit “retry” to get a stack trace.