Simplescalar Installation Guide

This guide is for installing simplescalar 3.0d on linux based PCs. It is tested on Mandrake Linux 9.2 with native gcc 3.3.1 and Redhat Linux 9.0 with gcc 3.2.2.

Step 1. Preparations.
Donwload and untar the four tar balls from official simplescalar website. They are simpleutils-990811.tar.gz, simplesim-3v0d.tgz, gcc-2.7.2.3.ss.tar.gz and simpletools-2v0.tgz. Untar simpletools-2v0.tgz will produce several direcotries among which gcc-2.6.3 and f2c-1994.09.27 are not useful, just delete them. Put all the untared directories under $IDIR (installation directory) (PS. This is not necessary, I do this in order to avoid importing other directories when stating the command line instructions).

 

Step 2. Build utils, which will result in a number of utilities used when compiling simplescalar cross gcc.

Instructions:
export IDIR=/your installation directory
cd $IDIR/simpleutils-990811/
./configure --host=i386-*-linux --target=sslittle-na-sstrix --with-gnu-as --with-gnu-ld --prefix=$IDIR
make all install


The produced utils are installed under $IDIR/sslitle-na-sstrix/bin.

 

Step 3. Build simplescalar 3.0. Simple!

Instructions:
cd $IDIR/simplesim-3.0
make config-pisa
make
make sim-tests

 

Step 4. Build simplescalar gcc. This is the main error source for most unsuccessful compilation experiences.

Instructions:
cd $IDIR/gcc-2.7.2.3
export PATH=$PATH:$IDIR/sslittle-na-sstrix/bin
(This path is very important!! It is to tell the location of utils (i.e., as, ld, etc.) compiled in Step 2. Don't put $IDIR/bin in the path, the files in $IDIR/bin are the ones with the cross gcc but not the ones used to compile the cross gcc).

./configure --host=i386-*-linux --target=sslittle-na-sstrix --with-gnu-as --with-gnu-ld --prefix=$IDIR --enable-languages=c,c++
(--enable-languages tells GCC not to compile all the other language frontends it supports, but only C and C++ (optional).)

make
(During make process, depending on the current native gcc version, you might encounter the following errors, do the following modifications to the corresponding files will remove the them.
1. In insn-output.c, delete all the line breaks ('\'s) that cause problem.
2. Cover the original cdefs.h (under $IDIR/sslittle-na-sstrix/include/sys) with patched one under "patched" directory (which redefined __NORETURN);
3. In objc/sendmsg.c, add "#define STRUCT_VALUE 0" at line 35;
4. In protoize.c, replace "#include <varargs.h>" at line 60 with "#include <stdarg.h>".)

make enquire
../simplesim-3.0/sim-safe ./enquire -f > float.h-cross
make install

 

Step 5. Build glibs. Don't need as suggested in the original simplescalar installation text. The whole lib resides in the big $IDIR/sslittle-na-sstrix/lib/libc.a.

 

Reference:

Original simplescalar installation guide, http://www.simplescalar.com/docs/install_guide_v2.txt

GCC Cross-Compiler at php-wiki, http://www.mega-tokyo.com/osfaq2/index.php/GCC%20Cross-Compiler

 

Best of Luck
-Pan Yu (panyu at comp.nus.edu.sg)