0
0
mirror of https://github.com/termux/termux-packages.git synced 2025-03-04 04:48:55 +00:00
termux-packages/disabled-packages/box86/src_dynarec_dynablock.c.patch
Jia Yuan Lo 514cc2aa72 box86: Disabled
Box86 is designed with glibc in mind so it is expected to not work
great on non-glibc Linux environment. Retire this package until
upstream properly add support for musl libc and maybe bionic libc.

https://github.com/ptitSeb/box86/issues/762
2023-04-08 00:08:54 +08:00

38 lines
1.0 KiB
Diff

diff -uNr box86/src/dynarec/dynablock.c box86.mod/src/dynarec/dynablock.c
--- box86/src/dynarec/dynablock.c 2022-10-31 00:09:49.883470723 +0800
+++ box86.mod/src/dynarec/dynablock.c 2022-10-31 00:08:16.999470789 +0800
@@ -299,12 +299,21 @@
}
//TODO: move this to dynrec_arm.c and track allocated structure to avoid memory leak
+#ifdef ANDROID
+static __thread jmp_buf dynarec_jmpbuf;
+
+void cancelFillBlock()
+{
+ longjmp(dynarec_jmpbuf, 1);
+}
+#else
static __thread struct __jmp_buf_tag dynarec_jmpbuf;
void cancelFillBlock()
{
longjmp(&dynarec_jmpbuf, 1);
}
+#endif
/*
return NULL if block is not found / cannot be created.
@@ -343,7 +352,11 @@
// fill the block
block->x86_addr = (void*)addr;
+#ifdef ANDROID
+ if(sigsetjmp(dynarec_jmpbuf, 1)) {
+#else
if(sigsetjmp(&dynarec_jmpbuf, 1)) {
+#endif
printf_log(LOG_INFO, "FillBlock at %p triggered a segfault, cancelling\n", (void*)addr);
if(need_lock)
mutex_unlock(&my_context->mutex_dyndump);