Hi Ahmad,

On 10/09/2013 11:06 AM, Ahmad Hassan wrote:
I have built gem5.opt but I cannot build 'm5' utility inside gem5/util/m5. If I run 'make' inside gem5/util/m5 then I get the following errors;

gem5/util/m5# make m5
cc     m5.c   -o m5
/tmp/ccw63Np2.o: In function `read_file':
m5.c:(.text+0x113): undefined reference to `m5_readfile'
<snip>
collect2: ld returned 1 exit status
make: *** [m5] Error 1

Any clues how to build 'm5' utility so that I copy this in my own custom image.


The problem you're experiencing is because you aren't using the correct make file. Just typing 'make m5' will invoke a default rule to compile m5.c to a standalone application. You need to manually specify the makefile to use when you build the m5 tool. There are different makefiles for each ISA supported by gem5.

If you're running on x86 and want to compile the x86 m5 tool, you'd do this: make -f Makefile.x86

Things are a bit trickier if you need to cross-compile. For ARM, you'd generally do 'make -f Makefile.arm' if your cross-compiler has the same names as the default in the makefile. You can override the cross-compiler like this: 'make -f Makefile.arm CROSS_COMPILE=arm-linux-gnueabi-".

//Andreas



_______________________________________________
gem5-users mailing list
gem5-users@gem5.org
http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users

Reply via email to