From: soeren@soeren-tempel.net
To: 69074@debbugs.gnu.org
Cc: jgart@dismail.de, Lars-Dominik Braun <lars@6xq.net>,
Marius Bakke <marius@gnu.org>,
Munyoki Kilyungi <me@bonfacemunyoki.com>,
Sharlatan Hellseher <sharlatanus@gmail.com>,
Tanguy Le Carrour <tanguy@bioneland.org>,
jgart <jgart@dismail.de>
Subject: [bug#69074] [PATCH 08/11] gnu: Add python-pyvex.
Date: Thu, 11 Jul 2024 23:27:19 +0200 [thread overview]
Message-ID: <f747b4798b6517a49fcf1b9f8ab70b90bb7bcb62.1720733241.git.soeren@soeren-tempel.net> (raw)
In-Reply-To: <a1a1a1b2baac9ef12e6fc821f22c5bfa16200869.1720733241.git.soeren@soeren-tempel.net>
From: Sören Tempel <soeren@soeren-tempel.net>
* gnu/packages/patches/python-pyvex-remove-angr-dependency.patch:
New patch.
* gnu/local.mk (dist_patch_DATA): Add it.
* gnu/packages/python-xyz.scm (python-pyvex): New variable.
---
gnu/local.mk | 1 +
.../python-pyvex-remove-angr-dependency.patch | 80 +++++++++++++++++++
gnu/packages/python-xyz.scm | 37 +++++++++
3 files changed, 118 insertions(+)
create mode 100644 gnu/packages/patches/python-pyvex-remove-angr-dependency.patch
diff --git a/gnu/local.mk b/gnu/local.mk
index 73b445f1fc..020f85337a 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1981,6 +1981,7 @@ dist_patch_DATA = \
%D%/packages/patches/python-pytorch-runpath.patch \
%D%/packages/patches/python-pytorch-system-libraries.patch \
%D%/packages/patches/python-pytorch-without-kineto.patch \
+ %D%/packages/patches/python-pyvex-remove-angr-dependency.patch \
%D%/packages/patches/python-robotframework-atest.patch \
%D%/packages/patches/python-robotframework-source-date-epoch.patch \
%D%/packages/patches/python-robotframework-sshlibrary-rf5-compat.patch \
diff --git a/gnu/packages/patches/python-pyvex-remove-angr-dependency.patch b/gnu/packages/patches/python-pyvex-remove-angr-dependency.patch
new file mode 100644
index 0000000000..dccf22bbc6
--- /dev/null
+++ b/gnu/packages/patches/python-pyvex-remove-angr-dependency.patch
@@ -0,0 +1,80 @@
+This patch removes the angr dependency from the pyvex these, thus
+resolving a circular dependency (as angr depends on pyvex). This
+patch has been taken from upstream.
+
+This patch is a squashed version of the following upstream patches:
+
+* https://github.com/angr/pyvex/commit/61fb26f223a8d8a276b702d2448a12e02c5c9c6b
+* https://github.com/angr/pyvex/commit/a1fb2a4d0826b0e43bd8bbdd00b6db032643ec95
+
+diff --git a/tests/test_spotter.py b/tests/test_spotter.py
+index 9271ccd..bed7dd4 100644
+--- a/tests/test_spotter.py
++++ b/tests/test_spotter.py
+@@ -1,6 +1,5 @@
+ import os
+
+-import angr
+ import archinfo
+
+ import pyvex
+@@ -98,53 +97,28 @@ class CortexSpotter(GymratLifter):
+ register(CortexSpotter, "ARMEL")
+
+
+-def test_full_binary():
+- p = angr.Project(
+- os.path.join(test_location, "armel", "RTOSDemo.axf.issue_685"),
+- arch="ARMEL",
+- auto_load_libs=False,
+- )
+- st = p.factory.call_state(0x000013CE + 1)
+- b = st.block().vex
+- simgr = p.factory.simulation_manager(st)
+- simgr.step()
+- assert b.jumpkind == "Ijk_Sys_syscall"
+- assert simgr.active[0].regs.ip_at_syscall.args[0] == 0x13FB
+-
+-
+ def test_tmrs():
+- test_location = str(os.path.join(os.path.dirname(os.path.realpath(__file__)), "../../binaries/tests"))
+- p = angr.Project(
+- os.path.join(test_location, "armel", "helloworld"),
+- arch="ARMEL",
+- auto_load_libs=False,
+- )
++ arch = archinfo.arch_from_id("ARMEL")
+ ins = b"\xef\xf3\x08\x82"
+- b = pyvex.block.IRSB(ins, 1, p.arch)
++ b = pyvex.block.IRSB(ins, 1, arch)
+ assert b.jumpkind == "Ijk_Boring"
+ assert type(b.statements[1].data) == pyvex.expr.Get
+- assert p.arch.register_names.get(b.statements[1].data.offset, "") == "sp"
++ assert arch.register_names.get(b.statements[1].data.offset, "") == "sp"
+ assert type(b.statements[2]) == pyvex.stmt.Put
+
+
+ def test_tmsr():
+- test_location = str(os.path.join(os.path.dirname(os.path.realpath(__file__)), "../../binaries/tests"))
+- p = angr.Project(
+- os.path.join(test_location, "armel", "helloworld"),
+- arch="ARMEL",
+- auto_load_libs=False,
+- )
++ arch = archinfo.arch_from_id("ARMEL")
+ inss = b"\x82\xf3\x08\x88"
+- b = pyvex.block.IRSB(inss, 1, p.arch, opt_level=3)
++ b = pyvex.block.IRSB(inss, 1, arch, opt_level=3)
+ assert b.jumpkind == "Ijk_Boring"
+ assert type(b.statements[1].data) == pyvex.expr.Get
+- assert p.arch.register_names.get(b.statements[1].data.offset, "") == "r2"
++ assert arch.register_names.get(b.statements[1].data.offset, "") == "r2"
+ assert type(b.statements[2]) == pyvex.stmt.Put
+
+
+ if __name__ == "__main__":
+ test_basic()
+ test_embedded()
+- test_full_binary()
+ test_tmrs()
+ test_tmsr()
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index dc92d4db08..6abeac61e6 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -200,6 +200,7 @@ (define-module (gnu packages python-xyz)
#:use-module (gnu packages docker)
#:use-module (gnu packages documentation)
#:use-module (gnu packages elf)
+ #:use-module (gnu packages emulators)
#:use-module (gnu packages enchant)
#:use-module (gnu packages file)
#:use-module (gnu packages fonts)
@@ -33787,6 +33788,42 @@ (define-public python-opcodes
and BMI2).")
(license license:bsd-2))))
+(define-public python-pyvex
+ (package
+ (name "python-pyvex")
+ ;; Must be the same version as python-angr.
+ (version "9.2.46")
+ (source
+ (origin
+ (method url-fetch)
+ (patches (search-patches "python-pyvex-remove-angr-dependency.patch"))
+ (uri (pypi-uri "pyvex" version))
+ (sha256
+ (base32 "1v64rn7gxy6fg065bgsy38z6r494k5ri5r6sn4g08hjj32ihx1ka"))))
+ (build-system pyproject-build-system)
+ (arguments
+ (list
+ #:phases #~(modify-phases %standard-phases
+ (replace 'check
+ (lambda* (#:key tests? #:allow-other-keys)
+ (when tests?
+ (with-directory-excursion "tests"
+ (invoke "python" "-m" "unittest")))))
+
+ (add-before 'build 'set-cc-native
+ (lambda _
+ (setenv "CC" #$(cc-for-target))
+ (setenv "CC_NATIVE" "gcc"))))))
+ (propagated-inputs (list python-archinfo python-bitstring python-cffi))
+ (home-page "https://github.com/angr/pyvex")
+ (synopsis "Python interface to libVEX and VEX IR")
+ (description
+ "This package provides a Python interface the libVEX and VEX IR.
+VEX is the intermediate representation (also known as intermediate
+language) used by the Valgrind analysis tool. As such, VEX is designed
+to enable all kinds of binary analysis tasks.")
+ (license license:bsd-2)))
+
(define-public python-claripy
(package
(name "python-claripy")
next prev parent reply other threads:[~2024-07-11 21:29 UTC|newest]
Thread overview: 78+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-12 14:55 [bug#69074] [PATCH] Add python-angr soeren
2024-02-12 14:58 ` [bug#69074] [PATCH] gnu: Add python-itanium-demangle soeren
2024-02-12 14:58 ` [bug#69074] [PATCH] gnu: Add python-keystone-engine soeren
2024-02-12 14:58 ` [bug#69074] [PATCH] gnu: Add python-mulpyplexer soeren
2024-02-12 14:58 ` [bug#69074] [PATCH] gnu: Add python-nampa soeren
2024-02-12 14:58 ` [bug#69074] [PATCH] gnu: Add python-rpyc soeren
2024-02-12 14:58 ` [bug#69074] [PATCH] gnu: Add python-pysmt soeren
2024-02-12 14:58 ` Troy Figiel
2024-02-12 14:58 ` [bug#69074] [PATCH] gnu: Add python-claripy soeren
2024-02-12 14:58 ` [bug#69074] [PATCH] gnu: Add python-archinfo soeren
2024-02-12 14:58 ` [bug#69074] [PATCH] gnu: Add python-pyvex soeren
2024-02-12 14:58 ` [bug#69074] [PATCH] gnu: Add python-cle soeren
2024-02-12 14:58 ` [bug#69074] [PATCH] gnu: Add python-ailment soeren
2024-02-12 14:58 ` [bug#69074] [PATCH] gnu: unicorn: Update to 2.0.1.post1 soeren
2024-02-12 14:58 ` [bug#69074] [PATCH] gnu: capstone: Backport upstream fix for Python bindings soeren
2024-02-12 14:58 ` [bug#69074] [PATCH] gnu: Add python-angr soeren
2024-02-12 14:58 ` Troy Figiel
2024-02-12 22:53 ` [bug#69074] [PATCH] " Troy Figiel
2024-02-13 9:53 ` [bug#69074] " Sören Tempel
2024-02-13 11:52 ` Troy Figiel
2024-02-15 21:39 ` Troy Figiel
2024-02-15 22:09 ` Troy Figiel
2024-03-01 12:02 ` Sören Tempel
2024-03-10 20:09 ` [bug#69074] [PATCH v2 01/14] gnu: Add python-itanium-demangle soeren
2024-03-10 20:09 ` [bug#69074] [PATCH v2 02/14] gnu: Add python-keystone-engine soeren
2024-03-10 20:09 ` [bug#69074] [PATCH v2 03/14] gnu: Add python-mulpyplexer soeren
2024-03-10 20:09 ` [bug#69074] [PATCH v2 04/14] gnu: Add python-nampa soeren
2024-03-10 20:09 ` [bug#69074] [PATCH v2 05/14] gnu: Add python-rpyc soeren
2024-03-10 20:09 ` [bug#69074] [PATCH v2 06/14] gnu: Add python-pysmt soeren
2024-03-10 20:09 ` [bug#69074] [PATCH v2 07/14] gnu: Add python-claripy soeren
2024-03-10 20:09 ` [bug#69074] [PATCH v2 08/14] gnu: Add python-archinfo soeren
2024-03-10 20:09 ` [bug#69074] [PATCH v2 09/14] gnu: Add python-pyvex soeren
2024-03-10 20:09 ` [bug#69074] [PATCH v2 10/14] gnu: Add python-cle soeren
2024-03-10 20:09 ` [bug#69074] [PATCH v2 11/14] gnu: Add python-ailment soeren
2024-03-10 20:09 ` [bug#69074] [PATCH v2 12/14] gnu: unicorn: Update to 2.0.1.post1 soeren
2024-03-10 20:09 ` [bug#69074] [PATCH v2 13/14] gnu: capstone: Backport upstream fix for Python bindings soeren
2024-03-10 20:09 ` [bug#69074] [PATCH v2 14/14] gnu: Add python-angr soeren
2024-03-10 20:12 ` [bug#69074] [PATCH] " Sören Tempel
2024-03-10 22:46 ` Troy Figiel
2024-03-11 8:50 ` Sören Tempel
2024-07-04 14:05 ` Sören Tempel
2024-07-04 14:54 ` jgart via Guix-patches via
2024-07-04 20:26 ` Sören Tempel
2024-07-04 20:52 ` jgart via Guix-patches via
2024-07-05 11:47 ` Sören Tempel
2024-07-08 21:29 ` jgart via Guix-patches via
2024-07-09 16:35 ` Sören Tempel
2024-07-09 19:19 ` jgart via Guix-patches via
2024-07-10 8:12 ` Sören Tempel
2024-07-11 21:32 ` Sören Tempel
2024-07-13 20:11 ` bug#69074: " jgart via Guix-patches via
2024-07-04 20:54 ` [bug#69074] " jgart via Guix-patches via
2024-07-05 0:09 ` jgart via Guix-patches via
2024-07-04 20:05 ` [bug#69074] [PATCH v3 01/14] gnu: Add python-itanium-demangle soeren
2024-07-04 20:05 ` [bug#69074] [PATCH v3 02/14] gnu: Add python-keystone-engine soeren
2024-07-04 20:05 ` [bug#69074] [PATCH v3 03/14] gnu: Add python-mulpyplexer soeren
2024-07-04 20:05 ` [bug#69074] [PATCH v3 04/14] gnu: Add python-nampa soeren
2024-07-04 20:05 ` [bug#69074] [PATCH v3 05/14] gnu: Add python-rpyc soeren
2024-07-04 20:05 ` [bug#69074] [PATCH v3 06/14] gnu: Add python-pysmt soeren
2024-07-04 20:05 ` [bug#69074] [PATCH v3 07/14] gnu: Add python-claripy soeren
2024-07-04 20:05 ` [bug#69074] [PATCH v3 08/14] gnu: Add python-archinfo soeren
2024-07-04 20:05 ` [bug#69074] [PATCH v3 09/14] gnu: Add python-pyvex soeren
2024-07-04 20:05 ` [bug#69074] [PATCH v3 10/14] gnu: Add python-cle soeren
2024-07-04 20:05 ` [bug#69074] [PATCH v3 11/14] gnu: Add python-ailment soeren
2024-07-04 20:05 ` [bug#69074] [PATCH v3 12/14] gnu: unicorn: Update to 2.0.1.post1 soeren
2024-07-04 20:05 ` [bug#69074] [PATCH v3 13/14] gnu: capstone: Backport upstream fix for Python bindings soeren
2024-07-04 20:05 ` [bug#69074] [PATCH v3 14/14] gnu: Add python-angr soeren
2024-07-11 21:27 ` [bug#69074] [PATCH 01/11] gnu: Add python-keystone-engine soeren
2024-07-11 21:27 ` [bug#69074] [PATCH 02/11] gnu: Add python-mulpyplexer soeren
2024-07-11 21:27 ` [bug#69074] [PATCH 03/11] gnu: Add python-nampa soeren
2024-07-11 21:27 ` [bug#69074] [PATCH 04/11] gnu: Add python-rpyc soeren
2024-07-11 21:27 ` [bug#69074] [PATCH 05/11] gnu: Add python-pysmt soeren
2024-07-11 21:27 ` [bug#69074] [PATCH 06/11] gnu: Add python-claripy soeren
2024-07-11 21:27 ` [bug#69074] [PATCH 07/11] gnu: Add python-archinfo soeren
2024-07-11 21:27 ` soeren [this message]
2024-07-11 21:27 ` [bug#69074] [PATCH 09/11] gnu: Add python-cle soeren
2024-07-11 21:27 ` [bug#69074] [PATCH 10/11] gnu: Add python-ailment soeren
2024-07-11 21:27 ` [bug#69074] [PATCH 11/11] gnu: Add python-angr soeren
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f747b4798b6517a49fcf1b9f8ab70b90bb7bcb62.1720733241.git.soeren@soeren-tempel.net \
--to=soeren@soeren-tempel.net \
--cc=69074@debbugs.gnu.org \
--cc=jgart@dismail.de \
--cc=lars@6xq.net \
--cc=marius@gnu.org \
--cc=me@bonfacemunyoki.com \
--cc=sharlatanus@gmail.com \
--cc=tanguy@bioneland.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.