Documente Academic
Documente Profesional
Documente Cultură
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.
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
Solution:
Edit insn-output.c
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:
Solution:
Solution:
5. When running a program which involves input from a file, the input stream is
disrupted without warning, do the following:
make enquire
make install
Test the gcc cross-compiler by type the following lines into hello.c
#include<stdio.h>
main()
{
printf("Hello World!\n");
$IDIR/bin/sslittle-na-sstrix-gcc hello.c
$IDIR/simplesim-3.0/sim-safe a.out
Hello World!
$IDIR/sslittle-na-sstrix/bin/gcc –v
sslittle-na-sstrix/bin/gcc program.c
Reference:
SimpleScalar installation guide, downloaded from the following url:
http://www.simplescalar.com/docs/install_guide_v2.txt
SimpleSclar installation guide prepared by Pan Yu of National University of
Singapore, http://www.comp.nus.edu.sg/~panyu/simplesim.htm
Special thanks to Dr. Bruce Hutton, Dr. Douge Burger and Alvan Tan for their kind
advise for solving problems that are encountered in making this paper.