整个程序llvm

wllvm的Python项目详细描述


这个项目,wllvm,提供了构建整个程序的工具(或者 完整库)LLVM位代码文件来自未修改的C或C++ 源程序包。它目前运行在linux等nix平台上, FreeBSD和Mac OS X。

wllvm提供了基于python的编译器包装器,它们分为两部分工作 台阶。包装器首先以正常方式调用编译器。那么,为了 每个对象文件都调用一个位代码编译器来生成llvm 比特码。包装器还存储生成的位代码的位置。 对象文件的专用部分中的文件。当对象文件是 链接在一起,专用部分的内容是 连接(这样我们就不会丢失任何组成部分的位置 位代码文件)。构建完成后,可以使用wllvm 实用程序,用于读取专用部分的内容并链接所有 将位码转换成一个完整的程序位码文件。这个工具 适用于可执行库和本机库。

这两个阶段的构建过程是必需的 对于任何生成系统中的gccg++。在gcc中使用lto框架 gold linker插件在很多情况下都能工作,但在 生成中存在静态库。WLLVM的方法有 生成工作二进制文件的明显优势,在某些情况下 一个构建过程需要这样做。

wllvm可以与clanggcc dragonegg插件一起工作。

用法

wllvm包含四个python可执行文件:用于编译c代码的wllvm。 和^ TT6}$编译C++,一个辅助工具^ {TT7}$ 从生成产品(对象文件、可执行文件、库)中提取位代码 或者存档),以及一个健全的检查器,wllvm-sanity-checker用于检测 配置疏忽。

必须设置三个环境变量才能使用这些包装器:

  • ^{tt9}$ should be set to either ^{tt10}$ or ^{tt3}$.
  • ^{tt12}$ should be set to the prefix for the version of gcc that should be used with dragonegg. This can be empty if there is no prefix. This variable is not used if ^{tt13}$.
  • ^{tt14}$ should be the full path to the dragonegg plugin. This variable is not used if ^{tt13}$.

设置环境后,只需使用wllvmwllvm++作为C 以及C++编译器。

除上述环境变量外,还可以选择使用以下变量:

  • ^{tt18}$ can be set if your clang compiler is not called ^{tt3}$ but something like ^{tt20}$. Similarly ^{tt21}$ can be used to describe what the C++ compiler is called. Note that in these sorts of cases, the environment variable ^{tt9}$ should still be set to ^{tt3}$ not ^{tt20}$ etc. We also pay attention to the environment variables ^{tt25}$ and ^{tt26}$ in an analagous way, since they too get adorned with suffixes in various Linux distributions.
  • ^{tt27}$ can be set to the absolute path to the folder that contains the compiler and other LLVM tools such as ^{tt28}$ to be used. This prevents searching for the compiler in your PATH environment variable. This can be useful if you have different versions of clang on your system and you want to easily switch compilers without tinkering with your PATH variable. Example ^{tt29}$.
  • ^{tt30}$ can be set to anything. If it is set, ^{tt5}$ and ^{tt6}$ behave like a normal C or C++ compiler. They do not produce bitcode. Setting ^{tt30}$ may prevent configuration errors caused by the unexpected production of hidden bitcode files.

文档

可以找到更详细的文档和一些教程 这里:

https://github.com/SRI-CSL/whole-program-llvm

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java如何通过不精确的参数类型获取构造函数?   找到java文件,但扫描程序未读取   在本地java服务器中部署google translation api,而不调用web服务。   java无法分析Adb版本(错误的ELF类)   java从模型到Servlet再到JSP选项列表获取信息   如何解决将xml文件转换为java文件时出现的错误?   Linux上从Java访问PC硬件端口   java如何覆盖Spring启动库属性?   java在maven的REST服务下获取JDBC连接   java如何将数组对象传递给构造函数?   java Spring BeanFactory作为Swing应用程序中的单例   带JsonDeserializer的java Lombok   用于多个文件的java Groovy脚本xml解析器   java如何从restful web服务中获取一些数据,并将其保存到数据库中?   servlet在java中提取ZIP   在Java中使用超类处理异常   java使hibernate在不使用@OneToOne@OneToMany等的情况下生成外键约束   基于tomcat web应用程序的用户角色的java只读访问   java在一个3乘n的表中找到具有最佳方差的3个值的集合   java Apache Commons CLI:获取选项的字符串值数组