Gem5 Compiler error: error: -Werror=……no option [How to Solve]

When compiling gem5, the following error was reported:

the most likely reason is that your version of GCC is not right. It is recommended to upgrade a higher version of GCC. The pro test shows that 10.2.0 is effective, and no version below 8 seems to work

Read More: