From 28bfe7cee2d66d1aebb12a367ce34367516ef54c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Thu, 28 Jul 2016 04:32:19 +0200 Subject: [PATCH] [arm] Make HAVE_ARMV{5,6,7} macros override hwcap detection. This is necessary on weird devices where the hwcap code might fail to detect the ARM version it's running on (usually caused by differences in /proc/cpuinfo output). --- mono/mini/mini-arm.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/mono/mini/mini-arm.c b/mono/mini/mini-arm.c index 4fbe7c06c08..a708eb3eb22 100644 --- a/mono/mini/mini-arm.c +++ b/mono/mini/mini-arm.c @@ -880,6 +880,21 @@ mono_arch_init (void) v6_supported = mono_hwcap_arm_is_v6; v7_supported = mono_hwcap_arm_is_v7; + /* + * On weird devices, the hwcap code may fail to detect + * the ARM version. In that case, we can at least safely + * assume the version the runtime was compiled for. + */ +#ifdef HAVE_ARMV5 + v5_supported = TRUE; +#endif +#ifdef HAVE_ARMV6 + v6_supported = TRUE; +#endif +#ifdef HAVE_ARMV7 + v7_supported = TRUE; +#endif + #if defined(__APPLE__) /* iOS is special-cased here because we don't yet have a way to properly detect CPU features on it. */ -- 2.11.4.GIT