我完全实现了以下网页的内容:
http://www.gem5.org/documentation/learning_gem5/part3/running/
该程序可以根据网页要求在X86下编译,但是我想得到一个ARM二进制文件,所以我使用以下代码编译它:
aarch64-linux-gnu-g++ -o threads threads.cpp -pthread -std = c ++ 11 -static
我可以编译并获取二进制文件,但在运行过程中出现以下错误:erminate called after throwing an instance of 'std::system_error'
what(): Enable multithreading to use std::thread: Operation not permitted
由于gem5的bin文件夹中没有提供编译好的ARM二进制文件,是不是说gem5不支持运行ARM多线程程序,还是我的编译选项不对?
最佳答案
该程序无法运行 -static
两个qemu-aarch64
和 Ubuntu 20.04 amd64 native (总是检查其他更稳定的平台:-))
已知-static
存在一些非gem5 特有的问题。和线程,例如:when g++ static link pthread, cause Segmentation fault, why?
如果提到的解决方法不起作用,您现在也可以使用动态链接运行,如:How to run a dynamically linked executable syscall emulation mode se.py in gem5?我现在刚刚对其进行了测试,它适用于该示例。
最后请注意,存在一个严重的多线程 SE Ruby 问题,我们不确定如何解决:https://gem5.atlassian.net/browse/GEM5-676
关于c++ - 如何在 Ruby 系统中运行 ARM 多线程程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63517567/