1

I fully implemented the content of the following webpage: http://www.gem5.org/documentation/learning_gem5/part3/running/ The program can be compiled under X86 according to webpage requirements,however I want to get an ARM binary file,so I use the following code to compile it:

aarch64-linux-gnu-g++ -o threads threads.cpp -pthread -std = c ++ 11 -static

I can compile and get the binary file, but I get the following error during running:

erminate called after throwing an instance of 'std::system_error'

what():  Enable multithreading to use std::thread: Operation not permitted

Since the compiled ARM binary file is not provided in gem5's bin folder, does it mean that gem5 does not support running ARM multi-threaded programs, or my compilation options are wrong?

Siqing Fu
  • 63
  • 5
  • That can't be your actual command line, right? It should be `-std=c++11`, not `-std = c ++ 11`. – Michael Aug 21 '20 at 07:17

1 Answers1

1

That program fails to run with -static on both qemu-aarch64 and Ubuntu 20.04 amd64 native (always check other more stable platforms :-))

It is known that there are some nongem5-specific problems with -static and threads, see e.g.: when g++ static link pthread, cause Segmentation fault, why?

If workaround mentioned there don't work, you can now also run with dynamic linking as mentioned at: How to run a dynamically linked executable syscall emulation mode se.py in gem5? I've just tested it now and it worked with that example.

And at last note that there is a serious multithread SE Ruby problem which we are not sure how to solve: https://gem5.atlassian.net/browse/GEM5-676

Ciro Santilli
  • 2,603
  • 1
  • 8
  • 31