Skip to content

Commit

Permalink
lang/mono6.8: fix build with llvm 16
Browse files Browse the repository at this point in the history
exceptions-ppc.c:817:32: error: incompatible pointer to integer conversion assigning to 'host_mgreg_t' (aka 'long') from 'gpointer' (aka 'void *') [-Wint-conversion]
        ctx->regs [PPC_FIRST_ARG_REG] = user_data;
                                      ^ ~~~~~~~~~
exceptions-ppc.c:819:23: error: incompatible pointer to integer conversion assigning to 'unsigned long' from 'gpointer' (aka 'void *') [-Wint-conversion]
        *(unsigned long *)sp = MONO_CONTEXT_GET_SP(ctx);
                             ^ ~~~~~~~~~~~~~~~~~~~~~~~~
exceptions-ppc.c:821:45: error: incompatible integer to pointer conversion passing 'unsigned long' to parameter of type 'gpointer' (aka 'void *') [-Wint-conversion]
        mono_arch_setup_resume_sighandler_ctx(ctx, (unsigned long) async_cb);
                                                   ^~~~~~~~~~~~~~~~~~~~~~~~
./mini.h:2384:77: note: passing argument to parameter 'func' here
void     mono_arch_setup_resume_sighandler_ctx  (MonoContext *ctx, gpointer func);
                                                                            ^
3 errors generated.
  • Loading branch information
pkubaj committed Oct 1, 2023
1 parent 37848ee commit 104d69c
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions lang/mono6.8/files/patch-mono_mini_exceptions-ppc.c
@@ -0,0 +1,17 @@
--- mono/mini/exceptions-ppc.c.orig 2023-09-30 21:55:09 UTC
+++ mono/mini/exceptions-ppc.c
@@ -795,11 +795,11 @@ mono_arch_setup_async_callback (MonoContext *ctx, void
mono_arch_setup_async_callback (MonoContext *ctx, void (*async_cb)(void *fun), gpointer user_data)
{
uintptr_t sp = (uintptr_t) MONO_CONTEXT_GET_SP(ctx);
- ctx->regs [PPC_FIRST_ARG_REG] = user_data;
+ ctx->regs [PPC_FIRST_ARG_REG] = (host_mgreg_t)user_data;
sp -= PPC_MINIMAL_STACK_SIZE;
- *(unsigned long *)sp = MONO_CONTEXT_GET_SP(ctx);
+ *(unsigned long *)sp = (uintptr_t)MONO_CONTEXT_GET_SP(ctx);
MONO_CONTEXT_SET_BP(ctx, sp);
- mono_arch_setup_resume_sighandler_ctx(ctx, (unsigned long) async_cb);
+ mono_arch_setup_resume_sighandler_ctx(ctx, (gpointer) async_cb);
}

void

0 comments on commit 104d69c

Please sign in to comment.