Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/erikd/ghc-llvm-next

Build scripts and patches to build GHC git HEAD against LLVM git HEAD (ie next version of llvm)
https://github.com/erikd/ghc-llvm-next

Last synced: 3 days ago
JSON representation

Build scripts and patches to build GHC git HEAD against LLVM git HEAD (ie next version of llvm)

Awesome Lists containing this project

README

        

# ghc-llvm-next

A build script (actually a Makefile) and patches to build GHC git HEAD against
the HEAD of LLVM.

* Grabs the HEAD revision of the LLVM tools and builds it.
* Grabs the HEAD revision of GHC.
* Applies patches using the quilt tool.
* Builds the patched GHC using the LLVM tools built in the first step.

## Why

GHC has an LLVM backend and for some architectures (Arm and
AArch64/Arm64/Armv8-a) the LLVM backend is the primary backend. The GHC
developers therefore have a keen interest in tracking between-release changes
in LLVM.

GHC use of LLVM is made somewhat more complicated by the fact that GHC generates
the text version (there is also a binary format) of LLVM Intermediate
Representation (IR) language which it then passes through the LLVM `llc` and
`opt` tools to generate native assembler.

Unfortunately, the LLVM developers do not guaranteed that the IR language will
remain unchanged across major releases. It should also be obvious that the GHC
developers should not wait for the actual release of a new LLVM version before
testing it. This project has therefore been set up to make test the development
version of GHC against the development version of LLVM.

## How to use it

Currently this only builds on Linux (patches accepted to fix that). You will
also need the following tool which should be available in most Linux distros:

* ghc (a version that can build git HEAD, currently ghc >= 7.8)
* The standard build tools needed to build ghc.
* gcc/g++ or clang/clang++ to build LLVM
* quilt
* git

Assuming you have all the tools, after checking out this repo, all you need to
do is:

make

To pull new changes from both GHC and LLVM git just:

make update

which automatically removes some of the stamp files.

Toe build everything and run the GHC test suites with the freshly built GHC
just do:

make

## Versions

GHC git HEAD currently uses the last stable LLVM reslease, version 3.9. However,
the LLVM project has already branched version 4.0 and LLVM git HEAD is now
marked as version 3.9.

The master branch of this repo now builds against LLVM version 4.0.