Hi,

py-unicorn is broken in the current macppc bulk:

> /usr/obj/ports/py-unicorn-1.0.1/unicorn-1.0.1/src/qemu/tcg/ppc/tcg-target.c:
> 1737:3: error: "Unhandled abi"

The impacted code is based on qemu, and it requires the same fix since
clang does not define __CALL_*

With the below diff it builds on powerpc [0]. 

Comments/feedback are welcome,

Charlène.


[0] https://bin.charlenew.xyz/macppc/paths/devel/py-unicorn.log


Index: patches/patch-src_qemu_tcg_ppc_tcg-target_c
===================================================================
RCS file: patches/patch-src_qemu_tcg_ppc_tcg-target_c
diff -N patches/patch-src_qemu_tcg_ppc_tcg-target_c
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_qemu_tcg_ppc_tcg-target_c 26 Apr 2020 11:51:44 -0000
@@ -0,0 +1,19 @@
+$OpenBSD$
+
+Workaround the lack of _CALL_SYSV with clang on powerpc
+
+Index: src/qemu/tcg/ppc/tcg-target.c
+--- src/qemu/tcg/ppc/tcg-target.c.orig
++++ src/qemu/tcg/ppc/tcg-target.c
+@@ -24,6 +24,11 @@
+ 
+ #include "tcg-be-ldst.h"
+ 
++/* clang does not define _CALL_* */
++#if defined __clang__ && defined __ELF__
++#define _CALL_SYSV 1
++#endif
++
+ #if defined _CALL_DARWIN || defined __APPLE__
+ #define TCG_TARGET_CALL_DARWIN
+ #endif

Reply via email to