In the local.conf file, MACHINE should be set as follow: MACHINE ?= "gem5-arm64"
And in the bblayers.conf the following layers need to be added: ##OEROOT##/meta-arm/meta-arm-toolchain ##OEROOT##/meta-arm/meta-arm
bash$ bitbake core-image-minimal
After compilation of an image, you can execute it using the compiled gem5 with the followin command: ./tmp/deploy/tools/start-gem5.sh
You can modify the script to change the command line options of gem5.