DISABLE_HW_TRAPS flag to disable signal reliance
authorAndi McClure <andi.mcclure@xamarin.com>
Thu, 18 Feb 2016 22:16:29 +0000 (17:16 -0500)
committerAndi McClure <andi.mcclure@xamarin.com>
Thu, 18 Feb 2016 22:16:29 +0000 (17:16 -0500)
Single switch for both explicit null checks and explicit illegal-divide checks

configure.ac
mono/mini/driver.c
mono/mini/mini.h

index bf6208e5dd7c381f327f974e0c79009ce4f5efcf..94160c5fe0ac02e69d33275fae2d3935b2b29735 100644 (file)
@@ -3020,6 +3020,7 @@ if test "x$host" != "x$target"; then
                arch_target=amd64;
                AC_DEFINE(TARGET_AMD64, 1, [...])
                AC_DEFINE(TARGET_PS4, 1, [...])
+               AC_DEFINE(DISABLE_HW_TRAPS, 1, [...])
                CPPFLAGS="$CPPFLAGS"
                # Can't use tls, since it depends on the runtime detection of tls offsets
                # in mono-compiler.h
index dada64022d8d4245e015258627a8a358e0459784..0f6aed5e6737c544d6ee25fc4e42f96c544d2484 100644 (file)
@@ -1928,6 +1928,11 @@ mono_main (int argc, char* argv[])
        }
 #endif
 
+#ifdef DISABLE_HW_TRAPS
+       // Signal handlers not available
+       opt->explicit_null_checks = TRUE;
+#endif
+
        if (!argv [i]) {
                mini_usage ();
                return 1;
index 6954a7639ac771732aab96445870b50923a4eaea..5af87a2878bd60b76b636207c3eda7fbd3d63c79 100644 (file)
@@ -3115,6 +3115,11 @@ void mono_cross_helpers_run (void);
  * Signal handling
  */
 
+#ifdef DISABLE_HW_TRAPS
+ // Signal handlers not available
+#define MONO_ARCH_NEED_DIV_CHECK 1
+#endif
+
 void MONO_SIG_HANDLER_SIGNATURE (mono_sigfpe_signal_handler) ;
 void MONO_SIG_HANDLER_SIGNATURE (mono_sigill_signal_handler) ;
 void MONO_SIG_HANDLER_SIGNATURE (mono_sigsegv_signal_handler);