GEM5编译中出现的问题解决
1、下载https://gem5.googlesource.com/public/gem5中的数据,
1)翻墙,直接下载tar.gz
2)git clone https://github.com/uart/gem5-mirror
2、pip install m5失败的问题,显示 no module found m5.util
1)直接从https://github.com/uart/gem5-mirror/tree/master/src/python/m5下载m5包,并将其放在python安装地址/lib/site-cons/m5下面
3、执行scons build/RISCV/gem5.opt -j5,后遇到gem5 lto1 fatal error bytecode stream generated with lto version 6.0 instead of the expected 4.1的问题,尝试了降低gcc g++的版本都没有用,后来发现在gem5/SConstruct里面自己在根据环境选择编译器,就安装了clang,使用clang来运行,但是似乎也没有用
4、对于Values object has no attribute use_colors来说,将gem5/site_scons/gem5_scons/util.py下的
return改成return m5.util.terminal.get_termcap(False)即可
5、在gem5/SConstruct下的第505行左右,加入一行:
main[‘CXX’] = main[‘CXX’] + ’ '+ ‘-fno-lto’
来禁止lto优化,发现就没有问题了
6、然后就可以继续跑gem5了