title: clang compiler hangs on windows
body: <p>I have built <strong>clang</strong> with VS9 following <a href="http://clang.llvm.org/get_started.html#buildWindows" rel="nofollow">manual</a>.</p>
  
  <p>It was built without errors. But when I am trying to compile some code - it hangs (not consuming cycles, two processes), both trunk and 3.2 release:</p>
  
  <pre><code>&gt; "bin\clang++.exe" -c test.cpp -o test.bs -emit-llvm -v
  
  clang version 3.2 (tags/RELEASE_32/final)
  Target: i686-pc-win32
  Thread model: posix
   "C:/llvm/bin/clang++.exe" -cc1 -triple i686-pc-win32 -emit-llvm-bc -disable-free -main-file-name test.cpp -mrelocation-model static -mdisable-fp-elim -fmath-errno -masm-verbose -mconstructor-aliases -target-cpu pentium4 -momit-leaf-frame-pointer -v -coverage-file "C:\\llvm\\test.bs" -resource-dir "C:/llvm/bin\\..\\lib\\clang\\3.2" -fmodule-cache-path "C:\\Users\\qble\\AppData\\Local\\Temp\\1\\clang-module-cache" -internal-isystem C:/llvm/bin/../lib/clang/3.2/include -internal-isystem -std=c++11 -fdeprecated-macro -ferror-limit 19 -fmessage-length 0 -mstackrealign -fms-extensions -fms-compatibility -fmsc-version=1300 -fdelayed-template-parsing -fobjc-runtime=gcc -fobjc-default-synthesize-properties -fcxx-exceptions -fexceptions -fdiagnostics-show-option -o test.bs -x c++ test.cpp
  clang -cc1 version 3.2 based upon LLVM 3.2svn default target i686-pc-win32 -std=c++11 -fdeprecated-macro -ferror-limit 19 -fmessage-length 0 -mstackrealign -fms-extensions -fms-compatibility -fmsc-version=1300 -fdelayed-template-parsing -fobjc-runtime=gcc -fobjc-default-synthesize-properties -fcxx-exceptions -fexceptions -fdiagnostics-show-option -o test.bs -x c++ test.cpp "
  #include "..." search starts here:
  #include &lt;...&gt; search starts here:
   C:/llvm/bin/../lib/clang/3.2/include
  End of search list.
  [HANG IS HERE]^C
  </code></pre>
  
  <p>What is wrong? How to make it work?</p>
  
  <p>EDIT:</p>
  
  <blockquote>
    <p>Can you find where the second process is launched? Is its stdin redirected to a pipe?</p>
  </blockquote>
  
  <p>Second proccess is executed here, it is "clang.exe":</p>
  
  <pre><code>&gt;clang.exe!llvm::sys::Program::ExecuteAndWait(const llvm::sys::Path &amp; path={...}, const char * * args=0x001ba3f0, const char * * envp=0x00000000, const llvm::sys::Path * * redirects=0x00000000, unsigned int secondsToWait=0, unsigned int memoryLimit=0, std::basic_string&lt;char,std::char_traits&lt;char&gt;,std::allocator&lt;char&gt; &gt; * ErrMsg="")  line 34  C++
  clang.exe!clang::driver::Compilation::ExecuteCommand(const clang::driver::Command &amp; C={...}, const clang::driver::Command * &amp; FailingCommand=0x00000000)  line 282 + 0x24 bytes C++
  clang.exe!clang::driver::Compilation::ExecuteJob(const clang::driver::Job &amp; J={...}, const clang::driver::Command * &amp; FailingCommand=0x00000000)  line 298 + 0x10 bytes C++
  clang.exe!clang::driver::Compilation::ExecuteJob(const clang::driver::Job &amp; J={...}, const clang::driver::Command * &amp; FailingCommand=0x00000000)  line 303 + 0x12 bytes C++
  clang.exe!clang::driver::Driver::ExecuteCompilation(const clang::driver::Compilation &amp; C={...}, const clang::driver::Command * &amp; FailingCommand=0x00000000)  line 508 + 0x15 bytes  C++
  clang.exe!main(int argc_=3, const char * * argv_=0x001b28c0)  line 476 + 0x1e bytes C++
  </code></pre>
  
  <p>EDIT:</p>
  
  <p>If I run:</p>
  
  <pre><code>type test.cpp | ..\build\bin\Debug\clang.exe -emit-llvm -c test.cpp -o test.bs
  </code></pre>
  
  <p>Or command line from above clang output directly - I am getting real compile error (about header). So, it looks like some problem with arguments parsing/passing.</p>