diff --git a/runtime/platform/globals.h b/runtime/platform/globals.h index ed20219f303..7d695485a73 100644 --- a/runtime/platform/globals.h +++ b/runtime/platform/globals.h @@ -356,9 +356,13 @@ typedef simd128_value_t fpu_register_t; // Determine whether we will be using the simulator. #if defined(TARGET_ARCH_IA32) -// No simulator used. +#if !defined(HOST_ARCH_IA32) +#define USING_SIMULATOR 1 +#endif #elif defined(TARGET_ARCH_X64) -// No simulator used. +#if !defined(HOST_ARCH_X64) +#define USING_SIMULATOR 1 +#endif #elif defined(TARGET_ARCH_ARM) #if !defined(HOST_ARCH_ARM) #define TARGET_HOST_MISMATCH 1 diff --git a/runtime/vm/cpu_arm64.cc b/runtime/vm/cpu_arm64.cc index e27ac58d59e..d193d23809e 100644 --- a/runtime/vm/cpu_arm64.cc +++ b/runtime/vm/cpu_arm64.cc @@ -64,7 +64,7 @@ const char* CPU::Id() { return #if defined(USING_SIMULATOR) "sim" -#endif // !defined(HOST_ARCH_ARM64) +#endif // !defined(USING_SIMULATOR) "arm64"; } diff --git a/runtime/vm/cpu_ia32.cc b/runtime/vm/cpu_ia32.cc index a2ed12853c6..27ae5c549f1 100644 --- a/runtime/vm/cpu_ia32.cc +++ b/runtime/vm/cpu_ia32.cc @@ -24,7 +24,11 @@ void CPU::FlushICache(uword start, uword size) { } const char* CPU::Id() { - return "ia32"; + return +#if defined(USING_SIMULATOR) + "sim" +#endif // !defined(USING_SIMULATOR) + "ia32"; } const char* HostCPUFeatures::hardware_ = nullptr; diff --git a/runtime/vm/cpu_x64.cc b/runtime/vm/cpu_x64.cc index 7f5981c8a33..cf0acf3798c 100644 --- a/runtime/vm/cpu_x64.cc +++ b/runtime/vm/cpu_x64.cc @@ -23,7 +23,11 @@ void CPU::FlushICache(uword start, uword size) { } const char* CPU::Id() { - return "x64"; + return +#if defined(USING_SIMULATOR) + "sim" +#endif // !defined(USING_SIMULATOR) + "x64"; } const char* HostCPUFeatures::hardware_ = nullptr; diff --git a/runtime/vm/simulator.h b/runtime/vm/simulator.h index 3194aa918fd..e08337c9b30 100644 --- a/runtime/vm/simulator.h +++ b/runtime/vm/simulator.h @@ -9,8 +9,7 @@ #if defined(USING_SIMULATOR) #if defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64) -// No simulator used. -#error Simulator not supported. +#error Simulator not implemented. #elif defined(TARGET_ARCH_ARM) #include "vm/simulator_arm.h" #elif defined(TARGET_ARCH_ARM64)