Table of Contents

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

  - git clone gitosis@git.minix3.org:minix
  - cd minix
  - git remote add minix-llvm gitosis@git.minix3.org:minix-llvm
  - git fetch minix-llvm
  - git checkout llvm-bitcode3
  - [JOBS=1] ./minix/llvm/generate_gold_plugin.sh
  - [JOBS=1] BUILDVARS='-V MKBITCODE=yes' ./releasetools/x86_hdimage.sh

The "llvm-apps way" (requires llvm-apps repository separately checked out)

Replace 6,7 above with:

  - cd minix/llvm
  - ./configure.llvm
  - [C=modules] ./relink.llvm [args]
  - [C=modules] ./build.llvm [args]
  - ./clientctl buildimage
  - ./clientctl run

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:

  - cd minix/llvm
  - [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
  - ./clientctl buildimage
  - ./clientctl run

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.

The documentation contains links to the official web site, so be sure to always check you did not lend on the official LLVM site.