Thu May 11 06:47:11 2023 UTC ()
unicorn py-unicorn: updated to 2.0.1.post1

Version 2.0.1

Features:

- Support building & running on BE hosts.
- Fix and support `clang-cl` on Windows.
- Fix python `sdist` and add aarch64 Linux wheels. Note `pip` can build Unicorn2 on M1 now!
- C# binding is refined and upgraded to .Net 6.

Fix/Improvements:

- Various bindings improvements.
- Improvements for tests.
- Fail explicitly when VEX.L is set.
- Fix endianness when writing PPC32 CR register.
- Fix a bug in `uc_ctl_set_cpu_model` check.
- Fix Tricore PC not updating.
- Fix the mapping not updated if users modify the mappings in the hooks.
- Handle pathological cases consistently.
- Fix memory leaks in PPC target.
- Fix memory leaks in Tricore target.
- Fix MSVC handling in cmake.
- Fix PC sync-ing problems for `UC_HOOK_BLOCK` hooks.
- Fix PC sync-ed twice when users request a soft restart.
- Prevent overflow with pre-allocated RAM blocks.
- Add FPCR and FPSR registers
- Fix ARM CPU state not deep copied.
- Fix PC not sync-ed for memory operation on aarch64.
- Exit invalid store operations early to avoid the target registers being overwritten.
- Improve the support for ARM BE32.

Version 2.0.0

Features:

- TriCore Support

Fixes/Improvements:

- Build both shared library and static archive as unicorn1 does.
- Misc bindings improvements.
- Make sure setjmp-setjmp-wrapper-win32 participates in the build.
- Improve Rust bindings build logic.
- Fix wrong python binding for UC_CTL_TB_REMOVE_CACHE
- Flush translation blocks when the count hook is removed.
- Fix unicorn crash when nested `uc_emu_start` deletes a hook
- Fix CPU not fully resumed when writing PC.
- Don't quit TB if `uc_mem_protect` doesn't change the protection of current TB memory.
- Add type annotations for python bindings.
- Add CPUID hook for python bindings.
- Don't repeat memory hooks if there is already an unhandled error.
- Support reads and writes over all Arm SIMD registers
- Fix wrong registers range in python bindings.
- Fix uc_mem_protect on mmio regions
- Fix a UAF caused by hook cache.
- Fix the value collision between UC_MODE_ARMBE8 and UC_MODE_ARM926


(adam)
diff -r1.4 -r1.5 pkgsrc/emulators/py-unicorn/Makefile
diff -r1.3 -r1.4 pkgsrc/emulators/py-unicorn/PLIST
diff -r1.20 -r1.21 pkgsrc/emulators/unicorn/Makefile
diff -r1.7 -r1.8 pkgsrc/emulators/unicorn/Makefile.common
diff -r1.4 -r1.5 pkgsrc/emulators/unicorn/PLIST
diff -r1.2 -r1.3 pkgsrc/emulators/unicorn/buildlink3.mk
diff -r1.11 -r1.12 pkgsrc/emulators/unicorn/distinfo
diff -r1.3 -r0 pkgsrc/emulators/unicorn/patches/patch-Makefile
diff -r1.2 -r0 pkgsrc/emulators/unicorn/patches/patch-bindings_python_setup.py
diff -r0 -r1.1 pkgsrc/emulators/unicorn/patches/patch-bundle__static.cmake

cvs diff -r1.4 -r1.5 pkgsrc/emulators/py-unicorn/Makefile (expand / switch to unified diff)

--- pkgsrc/emulators/py-unicorn/Makefile 2023/05/10 19:14:51 1.4
+++ pkgsrc/emulators/py-unicorn/Makefile 2023/05/11 06:47:11 1.5
@@ -1,17 +1,18 @@ @@ -1,17 +1,18 @@
1# $NetBSD: Makefile,v 1.4 2023/05/10 19:14:51 adam Exp $ 1# $NetBSD: Makefile,v 1.5 2023/05/11 06:47:11 adam Exp $
2 2
3.include "../../emulators/unicorn/Makefile.common" 3.include "../../emulators/unicorn/Makefile.common"
4 4
5PKGNAME= ${PYPKGPREFIX}-${DISTNAME} 5PKGNAME= ${PYPKGPREFIX}-${DISTNAME}
6CATEGORIES+= python 6CATEGORIES+= python
7 7
8MAINTAINER= pkgsrc-users@NetBSD.org 8MAINTAINER= pkgsrc-users@NetBSD.org
9COMMENT= Python bindings for unicorn 9COMMENT= Python bindings for unicorn
10LICENSE= gnu-gpl-v2 10LICENSE= gnu-gpl-v2
11 11
12USE_LANGUAGES= # none 12USE_LANGUAGES= # none
13PYSETUPSUBDIR= bindings/python 13PYSETUPSUBDIR= bindings/python
 14MAKE_ENV+= LIBUNICORN_PATH=${BUILDLINK_PREFIX.unicorn}/lib
14 15
15.include "../../emulators/unicorn/buildlink3.mk" 16.include "../../emulators/unicorn/buildlink3.mk"
16.include "../../lang/python/egg.mk" 17.include "../../lang/python/egg.mk"
17.include "../../mk/bsd.pkg.mk" 18.include "../../mk/bsd.pkg.mk"

cvs diff -r1.3 -r1.4 pkgsrc/emulators/py-unicorn/PLIST (expand / switch to unified diff)

--- pkgsrc/emulators/py-unicorn/PLIST 2021/02/25 19:47:50 1.3
+++ pkgsrc/emulators/py-unicorn/PLIST 2023/05/11 06:47:11 1.4
@@ -1,33 +1,45 @@ @@ -1,33 +1,45 @@
1@comment $NetBSD: PLIST,v 1.3 2021/02/25 19:47:50 leot Exp $ 1@comment $NetBSD: PLIST,v 1.4 2023/05/11 06:47:11 adam Exp $
2${PYSITELIB}/${EGG_INFODIR}/PKG-INFO 2${PYSITELIB}/${EGG_INFODIR}/PKG-INFO
3${PYSITELIB}/${EGG_INFODIR}/SOURCES.txt 3${PYSITELIB}/${EGG_INFODIR}/SOURCES.txt
4${PYSITELIB}/${EGG_INFODIR}/dependency_links.txt 4${PYSITELIB}/${EGG_INFODIR}/dependency_links.txt
5${PYSITELIB}/${EGG_INFODIR}/top_level.txt 
6${PYSITELIB}/${EGG_INFODIR}/not-zip-safe 5${PYSITELIB}/${EGG_INFODIR}/not-zip-safe
 6${PYSITELIB}/${EGG_INFODIR}/top_level.txt
7${PYSITELIB}/unicorn/__init__.py 7${PYSITELIB}/unicorn/__init__.py
8${PYSITELIB}/unicorn/__init__.pyc 8${PYSITELIB}/unicorn/__init__.pyc
9${PYSITELIB}/unicorn/__init__.pyo 9${PYSITELIB}/unicorn/__init__.pyo
10${PYSITELIB}/unicorn/arm64_const.py 10${PYSITELIB}/unicorn/arm64_const.py
11${PYSITELIB}/unicorn/arm64_const.pyc 11${PYSITELIB}/unicorn/arm64_const.pyc
12${PYSITELIB}/unicorn/arm64_const.pyo 12${PYSITELIB}/unicorn/arm64_const.pyo
13${PYSITELIB}/unicorn/arm_const.py 13${PYSITELIB}/unicorn/arm_const.py
14${PYSITELIB}/unicorn/arm_const.pyc 14${PYSITELIB}/unicorn/arm_const.pyc
15${PYSITELIB}/unicorn/arm_const.pyo 15${PYSITELIB}/unicorn/arm_const.pyo
16${PYSITELIB}/unicorn/m68k_const.py 16${PYSITELIB}/unicorn/m68k_const.py
17${PYSITELIB}/unicorn/m68k_const.pyc 17${PYSITELIB}/unicorn/m68k_const.pyc
18${PYSITELIB}/unicorn/m68k_const.pyo 18${PYSITELIB}/unicorn/m68k_const.pyo
19${PYSITELIB}/unicorn/mips_const.py 19${PYSITELIB}/unicorn/mips_const.py
20${PYSITELIB}/unicorn/mips_const.pyc 20${PYSITELIB}/unicorn/mips_const.pyc
21${PYSITELIB}/unicorn/mips_const.pyo 21${PYSITELIB}/unicorn/mips_const.pyo
 22${PYSITELIB}/unicorn/ppc_const.py
 23${PYSITELIB}/unicorn/ppc_const.pyc
 24${PYSITELIB}/unicorn/ppc_const.pyo
 25${PYSITELIB}/unicorn/riscv_const.py
 26${PYSITELIB}/unicorn/riscv_const.pyc
 27${PYSITELIB}/unicorn/riscv_const.pyo
 28${PYSITELIB}/unicorn/s390x_const.py
 29${PYSITELIB}/unicorn/s390x_const.pyc
 30${PYSITELIB}/unicorn/s390x_const.pyo
22${PYSITELIB}/unicorn/sparc_const.py 31${PYSITELIB}/unicorn/sparc_const.py
23${PYSITELIB}/unicorn/sparc_const.pyc 32${PYSITELIB}/unicorn/sparc_const.pyc
24${PYSITELIB}/unicorn/sparc_const.pyo 33${PYSITELIB}/unicorn/sparc_const.pyo
 34${PYSITELIB}/unicorn/tricore_const.py
 35${PYSITELIB}/unicorn/tricore_const.pyc
 36${PYSITELIB}/unicorn/tricore_const.pyo
25${PYSITELIB}/unicorn/unicorn.py 37${PYSITELIB}/unicorn/unicorn.py
26${PYSITELIB}/unicorn/unicorn.pyc 38${PYSITELIB}/unicorn/unicorn.pyc
27${PYSITELIB}/unicorn/unicorn.pyo 39${PYSITELIB}/unicorn/unicorn.pyo
28${PYSITELIB}/unicorn/unicorn_const.py 40${PYSITELIB}/unicorn/unicorn_const.py
29${PYSITELIB}/unicorn/unicorn_const.pyc 41${PYSITELIB}/unicorn/unicorn_const.pyc
30${PYSITELIB}/unicorn/unicorn_const.pyo 42${PYSITELIB}/unicorn/unicorn_const.pyo
31${PYSITELIB}/unicorn/x86_const.py 43${PYSITELIB}/unicorn/x86_const.py
32${PYSITELIB}/unicorn/x86_const.pyc 44${PYSITELIB}/unicorn/x86_const.pyc
33${PYSITELIB}/unicorn/x86_const.pyo 45${PYSITELIB}/unicorn/x86_const.pyo

cvs diff -r1.20 -r1.21 pkgsrc/emulators/unicorn/Makefile (expand / switch to unified diff)

--- pkgsrc/emulators/unicorn/Makefile 2023/05/10 19:14:50 1.20
+++ pkgsrc/emulators/unicorn/Makefile 2023/05/11 06:47:11 1.21
@@ -1,27 +1,13 @@ @@ -1,27 +1,13 @@
1# $NetBSD: Makefile,v 1.20 2023/05/10 19:14:50 adam Exp $ 1# $NetBSD: Makefile,v 1.21 2023/05/11 06:47:11 adam Exp $
2 2
3.include "Makefile.common" 3.include "Makefile.common"
4 4
5MAINTAINER= pkgsrc-users@NetBSD.org 5MAINTAINER= pkgsrc-users@NetBSD.org
6COMMENT= CPU emulator engine framework based on QEMU 6COMMENT= CPU emulator engine framework based on QEMU
7LICENSE= gnu-gpl-v2 7LICENSE= gnu-gpl-v2
8 8
9USE_TOOLS+= gmake pkg-config 9USE_LANGUAGES= c c++
10 
11.include "../../lang/python/application.mk" 
12 
13MAKE_ENV+= UNICORN_QEMU_FLAGS=--python=${PYTHONBIN:Q} 
14MAKE_ENV+= UNICORN_QEMU_FLAGS=--extra-ldflags=\"${LDFLAGS:Q}\" 
15MAKE_ENV+= CONFIG_SHELL=${CONFIG_SHELL:Q} 
16 
17ALL_ENV+= USE_GENERIC_LIBDATADIR=yes 
18 
19.include "../../mk/bsd.prefs.mk" 
20.if ${OPSYS} == "Darwin" 
21post-install: 
22 install_name_tool -id ${PREFIX}/lib/libunicorn.1.dylib \ 
23 ${DESTDIR}${PREFIX}/lib/libunicorn.1.dylib 
24.endif 
25 10
 11.include "../../devel/cmake/build.mk"
26.include "../../devel/glib2/buildlink3.mk" 12.include "../../devel/glib2/buildlink3.mk"
27.include "../../mk/bsd.pkg.mk" 13.include "../../mk/bsd.pkg.mk"

cvs diff -r1.7 -r1.8 pkgsrc/emulators/unicorn/Makefile.common (expand / switch to unified diff)

--- pkgsrc/emulators/unicorn/Makefile.common 2023/05/10 19:14:50 1.7
+++ pkgsrc/emulators/unicorn/Makefile.common 2023/05/11 06:47:11 1.8
@@ -1,16 +1,16 @@ @@ -1,16 +1,16 @@
1# $NetBSD: Makefile.common,v 1.7 2023/05/10 19:14:50 adam Exp $ 1# $NetBSD: Makefile.common,v 1.8 2023/05/11 06:47:11 adam Exp $
2# 2#
3# used by emulators/unicorn/Makefile 3# used by emulators/unicorn/Makefile
4# used by emulators/py-unicorn/Makefile 4# used by emulators/py-unicorn/Makefile
5 5
6DISTNAME= unicorn-1.0.3 6DISTNAME= unicorn-2.0.1.post1
7CATEGORIES= emulators 7CATEGORIES= emulators
8MASTER_SITES= ${MASTER_SITE_GITHUB:=unicorn-engine/} 8MASTER_SITES= ${MASTER_SITE_GITHUB:=unicorn-engine/}
9GITHUB_PROJECT= unicorn 9GITHUB_PROJECT= unicorn
10 10
11HOMEPAGE= https://www.unicorn-engine.org/ 11HOMEPAGE= https://www.unicorn-engine.org/
12 12
13DISTINFO_FILE= ${.CURDIR}/../../emulators/unicorn/distinfo 13DISTINFO_FILE= ${.CURDIR}/../../emulators/unicorn/distinfo
14PATCHDIR= ${.CURDIR}/../../emulators/unicorn/patches 14PATCHDIR= ${.CURDIR}/../../emulators/unicorn/patches
15 15
16CHECK_PORTABILITY_SKIP+= install-cmocka-linux.sh 16CHECK_PORTABILITY_SKIP+= install-cmocka-linux.sh

cvs diff -r1.4 -r1.5 pkgsrc/emulators/unicorn/PLIST (expand / switch to unified diff)

--- pkgsrc/emulators/unicorn/PLIST 2021/02/25 19:47:50 1.4
+++ pkgsrc/emulators/unicorn/PLIST 2023/05/11 06:47:11 1.5
@@ -1,13 +1,17 @@ @@ -1,13 +1,17 @@
1@comment $NetBSD: PLIST,v 1.4 2021/02/25 19:47:50 leot Exp $ 1@comment $NetBSD: PLIST,v 1.5 2023/05/11 06:47:11 adam Exp $
2include/unicorn/arm.h 2include/unicorn/arm.h
3include/unicorn/arm64.h 3include/unicorn/arm64.h
4include/unicorn/m68k.h 4include/unicorn/m68k.h
5include/unicorn/mips.h 5include/unicorn/mips.h
6include/unicorn/platform.h 6include/unicorn/platform.h
 7include/unicorn/ppc.h
 8include/unicorn/riscv.h
 9include/unicorn/s390x.h
7include/unicorn/sparc.h 10include/unicorn/sparc.h
 11include/unicorn/tricore.h
8include/unicorn/unicorn.h 12include/unicorn/unicorn.h
9include/unicorn/x86.h 13include/unicorn/x86.h
10lib/libunicorn.a 14lib/libunicorn.a
11lib/libunicorn.so 15lib/libunicorn.so
12lib/libunicorn.so.1 16lib/libunicorn.so.2
13lib/pkgconfig/unicorn.pc 17lib/pkgconfig/unicorn.pc

cvs diff -r1.2 -r1.3 pkgsrc/emulators/unicorn/buildlink3.mk (expand / switch to unified diff)

--- pkgsrc/emulators/unicorn/buildlink3.mk 2019/11/03 19:24:34 1.2
+++ pkgsrc/emulators/unicorn/buildlink3.mk 2023/05/11 06:47:11 1.3
@@ -1,12 +1,12 @@ @@ -1,12 +1,12 @@
1# $NetBSD: buildlink3.mk,v 1.2 2019/11/03 19:24:34 rillig Exp $ 1# $NetBSD: buildlink3.mk,v 1.3 2023/05/11 06:47:11 adam Exp $
2 2
3BUILDLINK_TREE+= unicorn 3BUILDLINK_TREE+= unicorn
4 4
5.if !defined(UNICORN_BUILDLINK3_MK) 5.if !defined(UNICORN_BUILDLINK3_MK)
6UNICORN_BUILDLINK3_MK:= 6UNICORN_BUILDLINK3_MK:=
7 7
8BUILDLINK_API_DEPENDS.unicorn+= unicorn>=1.0.1 8BUILDLINK_API_DEPENDS.unicorn+= unicorn>=2.0.0
9BUILDLINK_PKGSRCDIR.unicorn?= ../../emulators/unicorn 9BUILDLINK_PKGSRCDIR.unicorn?= ../../emulators/unicorn
10.endif # UNICORN_BUILDLINK3_MK 10.endif # UNICORN_BUILDLINK3_MK
11 11
12BUILDLINK_TREE+= -unicorn 12BUILDLINK_TREE+= -unicorn

cvs diff -r1.11 -r1.12 pkgsrc/emulators/unicorn/distinfo (expand / switch to unified diff)

--- pkgsrc/emulators/unicorn/distinfo 2023/05/10 19:14:50 1.11
+++ pkgsrc/emulators/unicorn/distinfo 2023/05/11 06:47:11 1.12
@@ -1,8 +1,7 @@ @@ -1,8 +1,7 @@
1$NetBSD: distinfo,v 1.11 2023/05/10 19:14:50 adam Exp $ 1$NetBSD: distinfo,v 1.12 2023/05/11 06:47:11 adam Exp $
2 2
3BLAKE2s (unicorn-1.0.3.tar.gz) = 53a6a919c8e46d14add3be520531eb3d6b8d1686855a6980dfc57ebe8edbd852 3BLAKE2s (unicorn-2.0.1.post1.tar.gz) = d2a3e24b963448e11d1b46d7fa3edbd6d1dbef1d2f996b6c66aee2e6f7297c4b
4SHA512 (unicorn-1.0.3.tar.gz) = 10f1b5194358c65bc94723eaafd7b4167fee18f96a4810f46f8c78ed1ef5584546e66e8c910fa4eeadd791fcd73edea68f898e337081409fd188b4090b78a7ca 4SHA512 (unicorn-2.0.1.post1.tar.gz) = 8694d6bc92e3424a8ad050316413d53e56e0f55e7cad7517fb3e98e670a0f1768b060ead8f195da13607cec89a964364f05a8b9d0dc074f4ac5e51026f8343ad
5Size (unicorn-1.0.3.tar.gz) = 3759365 bytes 5Size (unicorn-2.0.1.post1.tar.gz) = 4071380 bytes
6SHA1 (patch-Makefile) = a4cee3d8f880515e10dd053a6d2e93ea019f34d7 
7SHA1 (patch-bindings_python_setup.py) = 035888ce0599abb8ef4670fffb051cb1510d9a29 
8SHA1 (patch-bindings_python_unicorn_unicorn.py) = d7653d205bc999b8c53941c161771b8f72fcfa6e 6SHA1 (patch-bindings_python_unicorn_unicorn.py) = d7653d205bc999b8c53941c161771b8f72fcfa6e
 7SHA1 (patch-bundle__static.cmake) = f6ebe735b2b7e8ef151f15b95a7ee0bb9b9d9ef6

File Deleted: pkgsrc/emulators/unicorn/patches/Attic/patch-Makefile

File Deleted: pkgsrc/emulators/unicorn/patches/Attic/patch-bindings_python_setup.py

File Added: pkgsrc/emulators/unicorn/patches/patch-bundle__static.cmake
$NetBSD: patch-bundle__static.cmake,v 1.1 2023/05/11 06:47:11 adam Exp $

Use proper libtool on Darwin.

--- bundle_static.cmake.orig	2023-05-10 19:31:11.000000000 +0000
+++ bundle_static.cmake
@@ -44,14 +44,12 @@ function(bundle_static_library tgt_name 
     ${CMAKE_BINARY_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}${library_name}${CMAKE_STATIC_LIBRARY_SUFFIX})
   
   if (APPLE)
-    find_program(lib_tool libtool REQUIRED)
-
     foreach(tgt IN LISTS static_libs)
       list(APPEND static_libs_full_names $<TARGET_FILE:${tgt}>)
     endforeach()
 
     add_custom_command(
-      COMMAND ${lib_tool} -static -o ${bundled_tgt_full_name} ${static_libs_full_names}
+      COMMAND /usr/bin/libtool -static -o ${bundled_tgt_full_name} ${static_libs_full_names}
       OUTPUT ${bundled_tgt_full_name}
       COMMENT "Bundling ${bundled_tgt_name}"
       VERBATIM)
@@ -112,4 +110,4 @@ function(bundle_static_library tgt_name 
       #IMPORTED_LINK_INTERFACE_LIBRARIES "${dep_libs}") # Deprecated
   add_dependencies(${bundled_tgt_name} bundling_target)
 
-endfunction()
\ No newline at end of file
+endfunction()