Skip to Content.
Sympa Menu

svadev - [svadev] SAFECode libLTO

svadev AT lists.siebelschool.illinois.edu

Subject: Svadev mailing list

List archive

[svadev] SAFECode libLTO


Chronological Thread 
  • From: John Criswell <criswell AT cs.uiuc.edu>
  • To: svadev AT cs.uiuc.edu
  • Subject: [svadev] SAFECode libLTO
  • Date: Fri, 11 Dec 2009 14:38:30 -0600
  • List-archive: <http://lists.cs.uiuc.edu/mailman/private/svadev>
  • List-id: <svadev.cs.uiuc.edu>

Dear All,

I recently committed a version of libLTO in the safecode repository that will automatically run the SAFECode passes when creating a final executable.

This means that instead of having to compile programs into a single bitcode file (which is painful), you can just compile them with "llvm-gcc -O4" and your linker (if it supports libLTO) will run SAFECode on it for you when you link the final executable image. This should make using SAFECode much easier.

To install libLTO, do the following:

1. Make a backup of your system's currently existing libLTO.so or libLTO.dylib.
2. Copy the SAFECode libLTO.so (or libLTO.dylib) into your system's libLTO.so (libLTO.dylib).
3. Make a directory somewhere. Call it $PREFIX. Make a symbolic link from $PREFIX/gcc to llvm-gcc; do the same for $PREFIX/g++ and llvm-g++ (this step is needed for some versions of libtool that don't understand that llvm-gcc is a compiler driver).

To compile source code that uses autoconf (i.e., the standard, GNU configure script) with SAFECode's libLTO, do the following:

1. Set the environment variable CC to $PREFIX/gcc.
2. Set the environment variable CXX to $PREFIX/g++.
3. Set the environment variable CFLAGS to "-O4"
4. Set the environment variable LDFLAGS to "-L$SAFECODE/$CONFIG/lib -lsc_dbg_rt -lpoolalloc_bitmap -lstdc++" where:
a. $SAFECODE is the root of the SAFECode object tree.
b. $CONFIG is the type of build (Debug, Release, or Profile).
5. Run the configure script
6. Type "make" to compile the source code.

I've been working on this on Mac OS X Leopard. I'll be spending some time getting SAFECode to work on Snow Leopard.

This is early work; I have not done any thorough testing yet. If you try SAFECode libLTO out and have problems with it, please email svadev or file a bug report. libLTO for SAFECode is an important step towards making SAFECode usable; any feedback (positive, negative, or otherwise) is appreciated.

-- John T.




  • [svadev] SAFECode libLTO, John Criswell, 12/11/2009

Archive powered by MHonArc 2.6.16.

Top of Page