初识Clang
来源:互联网 发布:织梦系统被占用端口 编辑:程序博客网 时间:2024/05/24 07:24
参照官网http://clang.llvm.org/get_started.html,依赖的东西还挺多,编译Clang挺慢的,耐心等待。
-----------------------------------------------------------------------------------------------------------------------------
On Unix-like Systems
If you would like to check out and build Clang, the current procedure is as follows:
- Get the required tools.
- See Getting Started with the LLVM System - Requirements.
- Note also that Python is needed for running the test suite. Get it at: http://www.python.org/download
- Checkout LLVM:
- Change directory to where you want the llvm directory placed.
- svn co http://llvm.org/svn/llvm-project/llvm/trunk llvm
- Checkout Clang:
- cd llvm/tools
- svn co http://llvm.org/svn/llvm-project/cfe/trunk clang
- cd ../..
- Checkout extra Clang Tools: (optional)
- cd llvm/tools/clang/tools
- svn co http://llvm.org/svn/llvm-project/clang-tools-extra/trunk extra
- cd ../../../..
- Checkout Compiler-RT:
- cd llvm/projects
- svn co http://llvm.org/svn/llvm-project/compiler-rt/trunk compiler-rt
- cd ../..
- Build LLVM and Clang:
- mkdir build (for building without polluting the source dir)
- cd build
- ../llvm/configure
- make
- This builds both LLVM and Clang for debug mode.
- Note: For subsequent Clang development, you can just do make at the clang directory level.
- It is also possible to use CMake instead of the makefiles. With CMake it is possible to generate project files for several IDEs: Xcode, Eclipse CDT4, CodeBlocks, Qt-Creator (use the CodeBlocks generator), KDevelop3.
- If you intend to use Clang's C++ support, you may need to tell it how to find your C++ standard library headers. In general, Clang will detect the best version of libstdc++ headers available and use them - it will look both for system installations of libstdc++ as well as installations adjacent to Clang itself. If your configuration fits neither of these scenarios, you can use the --with-gcc-toolchain configure option to tell Clang where the gcc containing the desired libstdc++ is installed.
- Try it out (assuming you add llvm/Debug+Asserts/bin to your path):
- clang --help
- clang file.c -fsyntax-only (check for correctness)
- clang file.c -S -emit-llvm -o - (print out unoptimized llvm code)
- clang file.c -S -emit-llvm -o - -O3
- clang file.c -S -O3 -o - (output native machine code)
Note that the C front-end uses LLVM, but does not depend on llvm-gcc. If you encounter problems with building Clang, make sure you have the latest SVN version of LLVM. LLVM contains support libraries for Clang that will be updated as well as development on Clang progresses.
//~Not End
- 初识Clang
- clang
- Clang
- clang
- clang
- clang
- 印象Clang
- clang complete
- 什么是Clang?
- 编译clang
- clang编译器
- LLVM/Clang
- clang 命令
- pragma clang
- clang是什么?
- Clang编译器
- 有关Clang
- Clang Diagnostics
- TNS-01106: Message 1106 not found; No message file for product=network, facility=TNS
- 操作系统基本概念
- 温度场有限容积法程序入门之四:网格剖分.边界条件设置.迭代.导出后处理数据
- 移植bootloader到2440中遇到的问题
- Android教程(十一)-- 五种布局对象的用法
- 初识Clang
- Ubuntu配置tftp服务和NFS服务
- 我会告诉你。。。
- asp.net TreeView 一些操作(js)
- java使用poi操作excel(读、写)
- MySQL的大小写敏感性 lower_case_table_names
- ubuntu配置更新修改IP地址
- 作业
- struts2 constant配置