[mini] Add a MONO_ARM_FORCE_SOFT_FLOAT environment variable.
authorAlex Rønne Petersen <alexrp@xamarin.com>
Fri, 13 Feb 2015 07:08:32 +0000 (08:08 +0100)
committerAlex Rønne Petersen <alexrp@xamarin.com>
Fri, 13 Feb 2015 07:08:44 +0000 (08:08 +0100)
man/mono.1
mono/mini/mini-arm.c

index f87188c3d0d1ec0691691ab83a6f0bececc439eb..07f7192b75d92f72a8ebaa6a23ee63af3dca2536 100644 (file)
@@ -970,6 +970,10 @@ where V is the architecture number 4, 5, 6, 7 and the options can be currently b
 
 .fi
 .TP
+\fBMONO_ARM_FORCE_SOFT_FLOAT\fR
+When Mono is built with a soft float fallback on ARM and this variable is set to
+"1", Mono will always emit soft float code, even if a VFP unit is detected.
+.TP
 \fBMONO_DISABLE_AIO\fR
 If set, tells mono NOT to attempt using native asynchronous I/O services. In
 that case, a default select/poll implementation is used. Currently only epoll()
index 06456fdd7ab9079c842c4c1d545a462219beeb45..fe1cc21b73826459c9686f4a6e673e0c6cf9af41 100644 (file)
@@ -954,12 +954,25 @@ mono_arch_init (void)
        arm_fpu = MONO_ARM_FPU_VFP;
 
 #if defined(ARM_FPU_NONE) && !defined(__APPLE__)
-       /* If we're compiling with a soft float fallback and it
-          turns out that no VFP unit is available, we need to
-          switch to soft float. We don't do this for iOS, since
-          iOS devices always have a VFP unit. */
+       /*
+        * If we're compiling with a soft float fallback and it
+        * turns out that no VFP unit is available, we need to
+        * switch to soft float. We don't do this for iOS, since
+        * iOS devices always have a VFP unit.
+        */
        if (!mono_hwcap_arm_has_vfp)
                arm_fpu = MONO_ARM_FPU_NONE;
+
+       /*
+        * This environment variable can be useful in testing
+        * environments to make sure the soft float fallback
+        * works. Most ARM devices have VFP units these days, so
+        * normally soft float code would not be exercised much.
+        */
+       const char *soft = g_getenv ("MONO_ARM_FORCE_SOFT_FLOAT");
+
+       if (!strncmp (soft, "1", 1))
+               arm_fpu = MONO_ARM_FPU_NONE;
 #endif
 #endif