使用stdlibc ++ 4.7构建svn clang

时间:2012-08-04 08:06:54

标签: c++ gcc clang

我是新手直接从svn编译clang。我想针对stdlibc ++ 4.7构建clang。

我的系统正在运行Mac OS Mountain lion 10.8,因此我使用MacPorts安装gcc47。现在该库位于/ opt / local / lib / gcc47中,标头位于/ opt / local / include / gcc47中。

我从svn下载了clang,并按照以下指南进行操作:http://clang.llvm.org/get_started.html

如何指定clang configure使用stdlibc ++ 4.7?它在指南中提到我应该使用--with-gcc-toolchain来指定它。我应该在--with-gcc-toolchain使用什么?只是../configure --with-gcc-toolchain

我还尝试从svn编译gcc并将其作为$HOME/gcc安装到我的主目录中。然后使用--with-gcc-toolchain=PATH_TO_GCC_IN_HOME_DIR传递configure。编译完成后,尝试了以下内容: ./clang -v -x c++ /dev/null -fsyntax-only

它仍然显示与Mac OS附带的gcc4.2 lib链接:

clang version 3.2 (trunk 161295)
Target: x86_64-apple-darwin12.0.0
Thread model: posix
"/Users/chen/Repository/build/Debug+Asserts/bin/clang" -cc1 -triple x86_64-apple-macosx10.8.0 -fsyntax-only -disable-free -main-file-name null -pic-level 2 -mdisable-fp-elim -masm-verbose -munwind-tables -target-cpu core2 -target-linker-version 128.2 -v -resource-dir /Users/chen/Repository/build/Debug+Asserts/bin/../lib/clang/3.2 -fmodule-cache-path /var/folders/1l/m5km38_d3lxbrvysgv6s42680000gn/T/clang-module-cache -fdeprecated-macro -fdebug-compilation-dir /Users/chen/Repository/build/Debug+Asserts/bin -ferror-limit 19 -fmessage-length 145 -stack-protector 1 -mstackrealign -fblocks -fobjc-runtime=macosx-10.8.0 -fobjc-dispatch-method=mixed -fobjc-default-synthesize-properties -fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics -x c++ /dev/null
clang -cc1 version 3.2 based upon LLVM 3.2svn default target x86_64-apple-darwin12.0.0
ignoring nonexistent directory "/usr/include/c++/4.2.1/i686-apple-darwin10/x86_64"
ignoring nonexistent directory "/usr/include/c++/4.0.0"
ignoring nonexistent directory "/usr/include/c++/4.0.0/i686-apple-darwin8/"
ignoring nonexistent directory "/usr/include/c++/4.0.0/backward"
#include "..." search starts here:
#include <...> search starts here:
/usr/include/c++/4.2.1
/usr/include/c++/4.2.1/backward
/usr/local/include
/Users/chen/Repository/build/Debug+Asserts/bin/../lib/clang/3.2/include
/usr/include
/System/Library/Frameworks (framework directory)
/Library/Frameworks (framework directory)
End of search list.

如何用libstdc ++ 4.7编译clang?

谢谢,

0 个答案:

没有答案