From 48ed8407c90f8aa93b6720b6b7bc1bc030dbeaed Mon Sep 17 00:00:00 2001 From: Richard Cooper Date: Thu, 3 Mar 2022 18:08:39 +0000 Subject: [PATCH] cpu: Fix build for MacOS. * The value of build environment variable KVM_ISA is serialized into the generated file `kvm_isa.hh'. This value should be a string, but on hosts where the KVM headers are not available, the default `None` is inserted. Changed the default value to the string `""` in this case. * Added missing include for `std::array`. Change-Id: I651122cc46fc9c0757f592b05f4b4cab285cb91f Reviewed-by: Giacomo Travaglini Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/57889 Reviewed-by: Gabe Black Maintainer: Gabe Black Tested-by: kokoro --- src/cpu/kvm/SConsopts | 4 +++- src/cpu/static_inst.hh | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/cpu/kvm/SConsopts b/src/cpu/kvm/SConsopts index 72f2a2e5e6..31f56c5ac0 100644 --- a/src/cpu/kvm/SConsopts +++ b/src/cpu/kvm/SConsopts @@ -40,7 +40,9 @@ with gem5_scons.Configure(main) as conf: # we rely on exists since version 2.6.36 of the kernel, but somehow # the KVM_API_VERSION does not reflect the change. We test for one of # the types as a fall back. - conf.env['KVM_ISA'] = None + # The default value of KVM_ISA should serialize to a string in the + # C++ header and test False in Scons/Python. + conf.env['KVM_ISA'] = '' if not conf.CheckHeader('linux/kvm.h', '<>'): print("Info: Compatible header file not found, " "disabling KVM support.") diff --git a/src/cpu/static_inst.hh b/src/cpu/static_inst.hh index 2275598ada..af5975ecc1 100644 --- a/src/cpu/static_inst.hh +++ b/src/cpu/static_inst.hh @@ -42,6 +42,7 @@ #ifndef __CPU_STATIC_INST_HH__ #define __CPU_STATIC_INST_HH__ +#include #include #include #include