SAFECode Install Guide

Written by the LLVM Research Group

Overview

Welcome to the SAFECode compiler! This manual provides instructions for downloading and compiling SAFECode. It also provides information on software that you must have in order to install SAFECode.

Requirements
Software and Build Tool Dependencies

SAFECode depends upon several other pieces of software. SAFECode is built using the LLVM Compiler Infrastructure, so you must have LLVM. SAFECode also uses libraries from the Automatic Pool Allocation project. Directions on how to download these will be provided with the directions on downloading SAFECode.

SAFECode comes only as source code; you will need the proper tools (namely GCC and GNU make) to compile it. The necessary requirements are those needed by LLVM and are listed here.

Supported Platforms

SAFECode is currently supported on Linux and Mac OS X running on x86 processors (only 32-bit code is known to work).

Getting the Source Code

SAFECode is stored in a CVS repository. You will need to use CVS over ssh to check out the source code. Before you begin, set the CVS_RSH environment variable to "ssh" so that CVS uses SSH to log into llvm.org.

You will need to get the LLVM source code from the Subversion repository. You will then need to put Automatic Pool Allocation and SAFECode into the projects subdirectory of the LLVM source distribution. The following commands should do the trick:

You may optionally want to get the LLVM Test Suite (test-suite) source code:

If you use the LLVM Test Suite, you will also need the LLVM GCC front-end, and you will need to configure LLVM so that it knows where to find llvm-gcc and llvm-g++. Directions for downloading and installing the front-end can be found in the LLVM Getting Started Guide .

Configuring the Source Code

Once you have the source code checked out, you should be able to configure LLVM and the poolalloc project using just the top level LLVM configure script. You can then configure SAFECode separately (currently, the LLVM configure script does not configure SAFECode automatically). You may need to add the following options to the command line when running configure in order to configure Automatic Pool Allocation and SAFECode correctly:

Additional options for the SAFECode configure script include:

The overall process will look like the following if you are building Automatic Pool Allocation and SAFECode in the the projects subdirectory of the LLVM object tree:
Compiling SAFECode

To build SAFECode, first compile the LLVM tools, then Automatic Pool Allocation, and then SAFECode itself:

SAFECode will, by default, perform the same type of build that LLVM does. For example, if LLVM is configured to do a Release build by default, SAFECode will do a Release build by default as well. There are three types of builds:

If you only want to use SAFECode, use a Release build. If you are doing development work on SAFECode, use the Debug or Profile builds as appropriate.