A guide for building, and testing L-FCPA1
This latest L-FCPA patch is released for gcc-4.7.2.
NOTE: To build gcc-4.7.2 refer to the following instructions
Step I : Downloading the gcc source code tarball
- Make a new folder 'lipta', and cd to it
~/$. mkdir lipta
~/$. cd lipta
- Download gcc-4.7.2 tarball
in this folder.
- Download the required version of patch file in this folder.
- Untar the gcc-4.7.2 tarball
~/lipta$. tar -xvf gcc-4.7.2-tar.gz
After untarring, you will see a folder 'gcc-4.7.2'
- Make the 'build' and 'install' directories.
~/lipta$. mkdir build
~/lipta$. mkdir install
Step II : Building GCC 4.7.2
- Let us assume that $INSTALL is the absolute path of install directory, and
$SRC is the absolute path of gcc-4.7.2 directory.
- cd to the build directory.
~/lipta$. cd build
- Configure gcc-4.7.2. For example, if we wish to build a C compiler,
type the following to configure gcc.
~/lipta/build$. $SRC/configure --enable-languages=c
--prefix=$INSTALL
If you are on a 64 bit system, disable multilib during configure by the option --disable-multilib
- After configuring successfully, build gcc-4.7.2.
~/lipta/build$. make
- If a successful make, install the gcc binaries in the install directory.
~/lipta/build$. make install
Now use the pristine gcc-4.7.2 build for the l-fcpa plugin by following the steps below:
Step I : Building the plugin
- Untar the tarball
~/$.tar -xvf lipta-plugin-gcc-4.7.2.tar.gz
After untarring, you will see a folder "lipta-gcc-4.7-V1.1".
- Change directory to this folder
~/$.cd lipta-plugin-gcc-4.7-V1.1
- Make changes in the Makefile
~/lipta-plugin-gcc-4.7-V1.1$. vi Makefile
Modify the value of INSTALL and NEW_PATH with $INSTALL and $SRC/gcc, respectively
- Hook the plugin dynamically in gcc
~/lipta-plugin-gcc-4.7-V1.1$. make
You will see a file named plugin.so after the successful make.
Step II : Testing L-FCPA
- Create any sample program "test.c" inside the directory lipta-gcc-4.7-V1.1. (As a trial test.c is already given)
- Run the command
~/lipta-plugin-gcc-4.7-V1.1$. make test
- Inspect the generated lipta dump test.c.233i.lipta to analyze the information gathered by the pass.
- Use the following to delete all dump files
~/lipta-plugin-gcc-4.7-V1.1$. make clean