| ---------------------- |
| - BUILD INSTRUCTIONS - |
| ---------------------- |
| |
| Step 0: Build and install llvm |
| ------------------------------ |
| |
| I'm assuming anyone reading this knows how to build and install llvm. |
| You need the latest llvm from the subversion repository. |
| |
| Step 1: Build gcc |
| ----------------- |
| |
| Check out gcc from the gcc subversion repository: |
| svn checkout svn://gcc.gnu.org/svn/gcc/trunk SomeLocalDir |
| Apply the patches in the gcc-patches subdirectory, if any. Hopefully one day |
| the plugin will work with an unpatched gcc, but for the moment a few small |
| patches need to be applied. Configure gcc with your favorite options. |
| Build gcc, and install it somewhere. |
| |
| Step 2: Build the plugin |
| ------------------------ |
| |
| In the Makefile, set the GCCSOURCE_DIR variable to point to the place you |
| checked out the gcc repository, rather than to where I checked it out. |
| Set the GCCOBJECT_DIR to point to the place you built the repository. |
| Admire the awfulness of the build system, and make a mental note to rewrite |
| it properly. |
| |
| Build the plugin using "make". The end result of the build is a shared |
| library, llvm.so. |
| |
| ---------------------- |
| - USAGE INSTRUCTIONS - |
| ---------------------- |
| |
| Run gcc as usual, but pass -fplugin=./llvm.so as an extra command line argument. |
| Make sure you use the gcc you installed above, not the system gcc! |
| |
| Currently the plugin isn't capable of compiling much - you have been warned. |
| |
| The plugin accepts a few command line arguments, for example |
| -fplugin-arg-llvm-enable-gcc-optzns |
| Search for the comment "Process any plugin arguments" in llvm-backend.cpp, |
| the argument parsing code is just after this. |