User Tools

Site Tools


developersguide:llvmbitcode

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

developersguide:llvmbitcode [2014/12/02 07:28]
bengras created
developersguide:llvmbitcode [2014/12/11 08:57] (current)
lionelsambuc
Line 1: Line 1:
 +This page will contain information on how to compile minix in LLVM with bitcode-based linking. ​
 +
 +This allows LTO and instrumentation/​analysis of the system.
 +
 +===== Quick start =====
 +<​code>​
 + 1. git clone git@git.minix3.org:​minix
 + 2. cd minix
 + 3. git remote add minix-llvm git@git.minix3.org:​minix-llvm
 + 4. git fetch minix-llvm
 + 5. git checkout -t minix-llvm/​master-llvm
 + 6. [JOBS=1] ./​minix/​llvm/​generate_gold_plugin.sh
 + 7. [JOBS=1] BUILDVARS='​-V MKBITCODE=yes'​ ./​releasetools/​x86_hdimage.sh
 +</​code>​
 +
 +===== The "​llvm-apps way" (requires llvm-apps repository separately checked out) =====
 +Replace 6,7 above with:
 +<​code>​
 + a. cd minix/llvm
 + b. ./​configure.llvm
 + c. [C=modules] ./​relink.llvm [args]
 + d. [C=modules] ./​build.llvm [args]
 + e. ./clientctl buildimage
 + f. ./clientctl run
 +</​code>​
 +
 +===== Running Minix LLVM passes on Minix bitcode files  =====
 +After building the sources, we may wish to run some LLVM passes on the Minix bitcode files. There are a few LLVM passes available under minix/​llvm/​passes and they get installed into minix/​llvm/​bin directory.
 +Following is how they could be used:
 +<​code>​
 + 1. cd minix/llvm
 + 2. [C=modules] [LLVM_PASS_ARGS=<​arguments to llvm pass(es)>​] ./​build.llvm [<​llvm-pass(es)>​]
 +    example:
 +      C=pm ./​build.llvm hello
 +      C=servers ./​build.llvm hello weak-alias-module-override
 + 3. ./clientctl buildimage
 + 4. ./clientctl run
 +</​code>​
 +
 +===== Documentation Generated from the Sources =====
 +
 +The following documentation has been generated from the LLVM sources available in the git repository. As such it should be more pertinent than the latest documentation available on the official LLVM website.
 +
 +  * [[http://​www.few.vu.nl/​~lsc300/​LLVM/​clang/​html/​index.html|clang index]]
 +  * [[http://​www.few.vu.nl/​~lsc300/​LLVM/​llvm/​html/​index.html|LLVM index]]
 +  * [[http://​www.few.vu.nl/​~lsc300/​LLVM/​doxygen/​index.html|LLVM Doxygen documentation]]
 +
 +<div round info>
 +The documentation contains links to the official web site, so be sure to always check you did not lend on the official LLVM site.
 +</​div>​
  
developersguide/llvmbitcode.txt · Last modified: 2014/12/11 08:57 by lionelsambuc