Just successfully compiled M5 (the old version, not the GEM5) on a Fedora 64-bit machine. Lots of troubles encountered and here are some experience:
1. I tried to use gcc-4.4 to compile it but lots of errors showed up. It seems like you have to compile it using gcc-3.4
2. I got the following 5 files in hand: ( you should be able to download them by googling
cpp-3.4_3.4.6-1ubuntu2_amd64.deb
g++-3.4_3.4.6-1ubuntu2_amd64.deb
gcc-3.4_3.4.6-1ubuntu2_amd64.deb
gcc-3.4-base_3.4.6-1ubuntu2_amd64.deb
libstdc++6-dev_3.4.6-1ubuntu2_amd64.deb
3. Unfortunately I am using Fedora which only supports RPM files not deb files. So I use a tool called “alien” (http://kitenet.net/~joey/code/alien/) to convert those files from deb to RPM. After that I am able to install gcc-3.4 on my machine.
4. Change the software link of “g++” to gcc-3.4
5. Rebuild M5. However errors still show up.
Most of them are basically complaining something like: “/usr/bin/ld: skipping incompatible ” blah blah blah.
The problem is that the libraries that it found are not compatible with the compiler.
I started to look at the libraries that the compiler is looking for, located at “/usr/lib/gcc/x86_64-linux-gnu/3.4.6″
Everything looks right. However here are the tricks: all files (libraries and .o files) under the above location are not real files and software links pointing to files under /usr/lib or /lib
On my system for some reason all files under /usr/lib and /lib are 32-bit files. Those 64-bit libraries are located under /lib64 and /usr/lib64
So here is what I did:
1) Under /usr/lib64, create a software link from libstdc++.so to libstdc++.so.6
2) Under /lib64, create a software link from libgcc_s.so to libgcc_s.so.1
3) Under /usr/lib, I replace all the .o files (link header files) by those .o files under /usr/lib64.
4) In the SConstruct file under m5/build/ which is the scons script for building, I added:
env.Append(LINKFLAGS=’-L/usr/lib64 -L/lib64′)
to let the liker looking for libraries in the right position.