Clang编译器挂在窗口上
clang compiler hangs on windows
我已经用VS9下面的手册构建了clang
构建时没有错误。但是当我试图编译一些代码时-它挂起(不消耗周期,两个进程),主干和3.2版本:
> "binclang++.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 <...> search starts here:
C:/llvm/bin/../lib/clang/3.2/include
End of search list.
[HANG IS HERE]^C
怎么了?如何让它发挥作用?
编辑:你能找到第二个进程启动的位置吗?它的stdin重定向到管道吗?
第二个进程在这里执行,它是"clang.exe":
>clang.exe!llvm::sys::Program::ExecuteAndWait(const llvm::sys::Path & 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<char,std::char_traits<char>,std::allocator<char> > * ErrMsg="") line 34 C++
clang.exe!clang::driver::Compilation::ExecuteCommand(const clang::driver::Command & C={...}, const clang::driver::Command * & FailingCommand=0x00000000) line 282 + 0x24 bytes C++
clang.exe!clang::driver::Compilation::ExecuteJob(const clang::driver::Job & J={...}, const clang::driver::Command * & FailingCommand=0x00000000) line 298 + 0x10 bytes C++
clang.exe!clang::driver::Compilation::ExecuteJob(const clang::driver::Job & J={...}, const clang::driver::Command * & FailingCommand=0x00000000) line 303 + 0x12 bytes C++
clang.exe!clang::driver::Driver::ExecuteCompilation(const clang::driver::Compilation & C={...}, const clang::driver::Command * & FailingCommand=0x00000000) line 508 + 0x15 bytes C++
clang.exe!main(int argc_=3, const char * * argv_=0x001b28c0) line 476 + 0x1e bytes C++
编辑:如果我运行:
type test.cpp | ..buildbinDebugclang.exe -emit-llvm -c test.cpp -o test.bs
或命令行从上面clang输出直接-我得到真正的编译错误(关于头)。所以,它看起来像是参数解析/传递的一些问题。
问题是我的INCLUDE env var,它的路径像
c:somedir
clang将其传递给子进程(Win CreateProcess接受连接的参数):
clang.exe someargs "c:somedir" otherargs
和看起来像由于最后一个反斜杠,双引号被"转义",因为argv_在subprocess中是:
somepath/clang.exe
someargs
c:somedir" otherargs
注意如何"使用"反斜杠,以及otherargs与该路径连接,这就是为什么它等待-它没有获得args的一部分。
Clang的Program::Execute应该被修正为支持反斜杠转义或解析的代码INCLUDE env var.
EDIT from Stefan v.K: llvm错误跟踪器中相应的条目,可能有补丁。http://llvm.org/bugs/show_bug.cgi?id=15802
相关文章:
- C/C++编译器通常会删除重复的库吗
- 模板-模板参数推导:三个不同的编译器三种不同的行为
- Win32编译器选项和内存分配
- 如何在Qt窗口小部件中使用QStringView(或QStringRef)
- MSVC多行宏编译器错误
- 静态数据成员的问题-修复链接错误会导致编译器错误
- C++,我收到一个无法理解的编译器错误
- 问:如何使用C++中的按钮从窗口打开窗口
- 在线编译器中的分段C++没有打印消息
- SDL 窗口不会弹出
- 在createdialog创建的窗口中捕获用于编辑控件的OnMouseMove消息
- 如何解决gcc编译器优化导致的centos双编译器设置中的分段错误
- C/C++预处理器是否可以检测一些编译器选项
- 如何在cpp文件之间切换窗口?在Qt中
- 带有窗口的 C 编译器
- Qt - 编译器在我的主窗口上调用 setLayout() 时抱怨
- matlab编译器:更新数据到图形窗口
- 如何在Mac OS中隐藏控制台窗口(gcc编译器)
- Clang编译器挂在窗口上
- 如何在没有资源编译器的情况下将自定义窗口的资源添加到可执行文件中?