Fix mono/mono#20022 - changing the signature of mono_handle_native_crash() for s390x...
authormonojenkins <jo.shields+jenkins@xamarin.com>
Tue, 30 Jun 2020 01:41:43 +0000 (21:41 -0400)
committerGitHub <noreply@github.com>
Tue, 30 Jun 2020 01:41:43 +0000 (21:41 -0400)
* Fix exception-s390x so mono_handle_native_crash() is called according to the changes made in mono/mono#19973
* Make roslyn the default compiler for s390x

Co-authored-by: nealef <nealef@users.noreply.github.com>
src/mono/configure.ac
src/mono/mono/mini/exceptions-s390x.c

index bd3e76d..befd0f6 100644 (file)
@@ -1124,7 +1124,10 @@ AC_ARG_WITH(csc, [  --with-csc=mcs,roslyn,default      Configures the CSharp com
 
 if test $csc_compiler = default; then
    if test $endian = big; then
-      csc_compiler=mcs
+      case "$host" in
+        s390x*) csc_compiler=roslyn ;;
+        *) csc_compiler=mcs
+      esac
    elif test $endian = little; then
       case "$host" in
         powerpc*) csc_compiler=mcs ;;
index 82ea923..0a8903f 100644 (file)
@@ -564,7 +564,7 @@ mono_arch_unwind_frame (MonoDomain *domain, MonoJitTlsData *jit_tls,
 /*========================= End of Function ========================*/
 
 static void
-altstack_handle_and_restore (MonoContext *ctx, gpointer obj, guint32 flags)
+altstack_handle_and_restore (MonoContext *ctx, MONO_SIG_HANDLER_INFO_TYPE *siginfo, gpointer obj, guint32 flags)
 {
        MonoContext mctx;
        MonoJitInfo *ji = mini_jit_info_table_find (mono_domain_get (), MONO_CONTEXT_GET_IP (ctx), NULL);
@@ -573,7 +573,7 @@ altstack_handle_and_restore (MonoContext *ctx, gpointer obj, guint32 flags)
 
        if (!ji || (!stack_ovf && !nullref)) {
                if (mono_dump_start ())
-                       mono_handle_native_crash (mono_get_signame (SIGSEGV), ctx, NULL);
+                       mono_handle_native_crash (mono_get_signame (SIGSEGV), ctx, siginfo, ctx);
                /* if couldn't dump or if mono_handle_native_crash returns, abort */
                abort ();
        }
@@ -635,8 +635,9 @@ mono_arch_handle_altstack_exception (void *sigctx, MONO_SIG_HANDLER_INFO_TYPE *s
        UCONTEXT_IP(uc)         = (uintptr_t) altstack_handle_and_restore;
        UCONTEXT_REG_Rn(uc, 1)  = (uintptr_t) sp;
        UCONTEXT_REG_Rn(uc, S390_FIRST_ARG_REG) = (uintptr_t) uc_copy;
-       UCONTEXT_REG_Rn(uc, S390_FIRST_ARG_REG + 1) = (uintptr_t) exc;
-       UCONTEXT_REG_Rn(uc, S390_FIRST_ARG_REG + 2) = (stack_ovf ? 1 : 0) | (nullref ? 2 : 0);
+       UCONTEXT_REG_Rn(uc, S390_FIRST_ARG_REG + 1) = (uintptr_t) siginfo;
+       UCONTEXT_REG_Rn(uc, S390_FIRST_ARG_REG + 2) = (uintptr_t) exc;
+       UCONTEXT_REG_Rn(uc, S390_FIRST_ARG_REG + 3) = (stack_ovf ? 1 : 0) | (nullref ? 2 : 0);
 #endif
 }