Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Rønne Petersen <alexrp@xamarin.com>2016-07-28 05:32:19 +0300
committerAlex Rønne Petersen <alexrp@xamarin.com>2016-08-01 11:32:24 +0300
commit28bfe7cee2d66d1aebb12a367ce34367516ef54c (patch)
tree3ea89519afb1cdb97ed29b4d9464fcee7c40459a
parent2cac09666c04914ea74a3e2f39e5dfbd66be1293 (diff)
[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).
-rw-r--r--mono/mini/mini-arm.c15
1 files changed, 15 insertions, 0 deletions
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. */