1. Download and unpack the source files
The source files can be downloaded from www.simplescalar.com under the section of Download -> Tools. There are four files that are needed for this installation. - simplesim-3v0c.tgz - simpleutils-990811.tar.gz - gcc-2.7.2.3.ss.tar.gz - simpletools-2v0.tgz Use gunzip < file.tgz
tar xvf - to unzip - simplesim-3v0c.tgz - simpletools-2v0.tgz Use gunzip < file.tar.gz
tar xvf – to unzip - gcc-2.7.2.3.ss.tar.gz - simpleutils-990811.tar.gz After this step we should have the following folders: - f2c-1994.09.27 - gcc-2.6.3 - gcc-2.7.2.3 - glibc-1.09 - simplesim-3.0 - simpleutils-990811 - ssbig-na-sstrix - sslittle-na-sstrix And one file: - Readme.gcc-2.7.2.3
2. Set up flex
flex is a program that does some lexical analysis work for the utility tools that we are trying to compile in step 4. We have known issues with the system default 2.5.31 version of flex and the kind admin of our beloved lab had put a more stable version of 2.5.4 of flex on both hydra and lab Debian boxes. Now we need to make a symbolic link of flex-2.5.4 and put that on to our PATH environment variable. - make the symbolic link of flex-2.5.4 ln –s /usr/local/bin/flex-2.5.4 flex The above command will generate a symbolic link called flex which point to /usr/local/bin/flex-2.5.4. We also need to set up the PATH variable so that we can use this symbolic link when we call flex rather than using the system default version of flex.
- set up the PATH, assuming that we put the symbolic link in folder yourunixhome/bin export PATH=yourunixhome/bin:$PATH To test whether we set up the PATH correctly, use flex --version. If the version number is 2.5.4, we are sure that we get it right.
3. Set up environment variables
export IDIR=/your installation directory
export HOST=i686-unknown-linux
export TARGET=sslittle-na-sstrix
4. Install the simpleutils, which contains a few tools the cross-compiler will be using in step 6 Before we start the installation of the simpleutils, we have to make sure that we are using the right version of flex by the following command: flex --version We need version 2.5.4 in order to proceed because version 2.5.31 has known issues with our installation. If you haven’t set up flex, stop here and read step 2, otherwise you will encounter different kinds of errors we describe below. If the version of flex is right, we are ready to precede the installation using the following instructions. cd $IDIR/simpleutils-990811 ./configure --host=$HOST --target=$TARGET --with-gnu-as --with-gnu-ld --prefix=$IDIR make make install
5. Build SimpleScalar 3.0
This step is easy. Just use the following instructions. cd $IDIR/simplesim-3.0 make config-pisa make After a successful setup, we should have last line saying “my work is done here”. Or we could test by: cd $IDIR/simplesim-3.0 ./sim-safe tests/bin.little/test-math
6. Install the gcc cross-compiler for SimpleScalar This gcc cross-compiler will compile code for the SimplScalar PISA instruction set, therefore it is very critical to the simulation that we will run later. The gcc cross-compiler is very delicate since we are using a quite old version of it. There are a few errors that we will encounter but we have got solutions to them so let’s start. cd $IDIR/gcc-2.7.2.3 export PATH=$PATH:$IDIR/sslittle-na-sstrix/bin (This line must be there) ./configure --host=$HOST --target=$TARGET --with-gnu-as --with-gnu-ld
--prefix=$IDIR make LANGUAGES=c During make process, we might have the following errors: 1. Error in insn-output.c, error messages like the following: cc -DCROSS_COMPILE -DIN_GCC -g -I. -I. -I./config -c insn-output.c insn-output.c:675:10: missing terminating " character insn-output.c: In function `output_110': insn-output.c:676: error: parse error before "sll" ……..(omit 50 lines of error messages) make: *** [insn-output.o] Error 1 Solution: Edit insn-output.c - append ‘\’ at the end of at line 675 - append ‘\’ at the end of at line 750 - append ‘\’ at the end of at line 823 2. Error about stdio.h, error messages like the following: In file included from ./libgcc2.c:1419: stdio.h:167: parse error before `void' make: *** [libgcc2.a] Error 1 Solution: Edit Makefile at line 130, append –I/usr/include to the end of the line.
3. Error in objc/sendmsg.c, error messages like the following: sendmsg.c:36: parse error make[1]: *** [sendmsg.o] Error 1 make[1]: Leaving directory `/afs/ec.auckland.ac.nz/users/xyz/unixhome/ss/gcc-2.7.2.3/objc' make: *** [libobjc.a] Error 2 Solution: In objc/sendmsg.c, insert "#define INVISIBLE_STRUCT_RETURN 0" at line 35, and delete line 36 to 40 inclusive. 4. Error with protoize.c, error messages like the following: In file included from protoize.c:60: /usr/lib/gcc-lib/i486-linux/3.3.5/include/varargs.h:4:2: #error "GCC no longer implements
#include
No comments:
Post a Comment