From unknown Fri Aug 15 15:56:59 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#72015] [PATCH] gnu: capstone: Backport upstream fix for Python bindings. Resent-From: soeren@soeren-tempel.net Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 09 Jul 2024 16:22:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 72015 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 72015@debbugs.gnu.org Cc: jgart@dismail.de X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.172054211629270 (code B ref -1); Tue, 09 Jul 2024 16:22:02 +0000 Received: (at submit) by debbugs.gnu.org; 9 Jul 2024 16:21:56 +0000 Received: from localhost ([127.0.0.1]:53945 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sRDbH-0007c2-PX for submit@debbugs.gnu.org; Tue, 09 Jul 2024 12:21:56 -0400 Received: from lists.gnu.org ([209.51.188.17]:40144) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sRDbF-0007bu-Jd for submit@debbugs.gnu.org; Tue, 09 Jul 2024 12:21:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sRDYz-0007rL-SN for guix-patches@gnu.org; Tue, 09 Jul 2024 12:19:36 -0400 Received: from magnesium.8pit.net ([45.76.88.171]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sRDYv-0008J1-RW; Tue, 09 Jul 2024 12:19:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; s=opensmtpd; bh=LTh3kKOT fqK+7KR9OYtYqmmRFM0codwQqqJyTOEF7zQ=; h=date:subject:cc:to:from; d=soeren-tempel.net; b=a43NbmbSc7Ih2a7CxvqTaPgVXAxLEXz7YKFghFEP+vatKIX 2BTEOy5csyfaiZQtDbaKGn7VB4Ybu++KcUS3RnwC9Sky6JkTFNQwDpwLPRstfKznuvYcWa gVnwcCvHylsxJMZ1bLMsU4harV8+p0trQ1L8L/hREuNR37BxrtHn10= Received: from localhost (dynamic-2a02-3102-49da-001b-167b-bb16-88d3-7747.310.pool.telefonica.de [2a02:3102:49da:1b:167b:bb16:88d3:7747]) by magnesium.8pit.net (OpenSMTPD) with ESMTPSA id 994ffd7d (TLSv1.3:TLS_AES_256_GCM_SHA384:256:YES); Tue, 9 Jul 2024 18:19:18 +0200 (CEST) From: soeren@soeren-tempel.net Date: Tue, 9 Jul 2024 18:18:18 +0200 Message-ID: <9274cd3a46536b0ab71ff570328da49c56d61fb7.1720541898.git.soeren@soeren-tempel.net> X-Mailer: git-send-email 2.45.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=45.76.88.171; envelope-from=soeren@soeren-tempel.net; helo=magnesium.8pit.net X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.4 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) From: Sören Tempel * gnu/packages/patches/capstone-fix-python-constants.patch: New patch. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/engineering.scm (capstone): New patch. --- This patch includes a backport of an upstream patch which fixes several issues with the Python bindings that were discovered while packaging angr for Guix and running its test suite. The patch has been taken from #69074 as requested by jgart. gnu/local.mk | 1 + gnu/packages/engineering.scm | 3 +- .../capstone-fix-python-constants.patch | 84 +++++++++++++++++++ 3 files changed, 87 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/capstone-fix-python-constants.patch diff --git a/gnu/local.mk b/gnu/local.mk index 3f493c3050..ea4cc251ae 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1023,6 +1023,7 @@ dist_patch_DATA = \ %D%/packages/patches/calls-disable-application-test.patch \ %D%/packages/patches/calls-disable-sip-test.patch \ %D%/packages/patches/camlboot-dynamically-allocate-stack-signal.patch \ + %D%/packages/patches/capstone-fix-python-constants.patch \ %D%/packages/patches/catdoc-CVE-2017-11110.patch \ %D%/packages/patches/ccextractor-add-missing-header.patch \ %D%/packages/patches/ccextractor-autoconf-tesseract.patch \ diff --git a/gnu/packages/engineering.scm b/gnu/packages/engineering.scm index 0f290de7eb..cc9020c6fd 100644 --- a/gnu/packages/engineering.scm +++ b/gnu/packages/engineering.scm @@ -1787,6 +1787,7 @@ (define-public capstone (version "5.0.1") (source (origin (method git-fetch) + (patches (search-patches "capstone-fix-python-constants.patch")) (uri (git-reference (url "https://github.com/capstone-engine/capstone") (commit version))) @@ -1798,7 +1799,7 @@ (define-public capstone (arguments `(#:tests? #f #:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out")) - "CC=gcc") + (string-append "CC=" ,(cc-for-target))) #:phases (modify-phases %standard-phases (delete 'configure) ; no configure script diff --git a/gnu/packages/patches/capstone-fix-python-constants.patch b/gnu/packages/patches/capstone-fix-python-constants.patch new file mode 100644 index 0000000000..75100c6652 --- /dev/null +++ b/gnu/packages/patches/capstone-fix-python-constants.patch @@ -0,0 +1,84 @@ +Backport upstream patch fixing various constants in the Python bindings. + +Taken from: https://github.com/capstone-engine/capstone/commit/f180e176de3efb060db62820ff981d0291ea8525 + +diff --git a/bindings/python/capstone/__init__.py b/bindings/python/capstone/__init__.py +index bda2fdb6..52353c28 100755 +--- a/bindings/python/capstone/__init__.py ++++ b/bindings/python/capstone/__init__.py +@@ -113,7 +113,6 @@ __all__ = [ + 'CS_OPT_SYNTAX_NOREGNAME', + 'CS_OPT_SYNTAX_MASM', + 'CS_OPT_SYNTAX_MOTOROLA', +- 'CS_OPT_SYNTAX_CS_REG_ALIAS', + + 'CS_OPT_DETAIL', + 'CS_OPT_MODE', +@@ -152,19 +151,6 @@ __all__ = [ + 'CS_OP_REG', + 'CS_OP_IMM', + 'CS_OP_FP', +- 'CS_OP_PRED', +- 'CS_OP_RESERVED_5', +- 'CS_OP_RESERVED_6', +- 'CS_OP_RESERVED_7', +- 'CS_OP_RESERVED_8', +- 'CS_OP_RESERVED_9', +- 'CS_OP_RESERVED_10', +- 'CS_OP_RESERVED_11', +- 'CS_OP_RESERVED_12', +- 'CS_OP_RESERVED_13', +- 'CS_OP_RESERVED_14', +- 'CS_OP_RESERVED_15', +- 'CS_OP_SPECIAL', + 'CS_OP_MEM', + + 'CS_GRP_INVALID', +@@ -298,26 +284,13 @@ CS_OPT_NO_BRANCH_OFFSET = 9 # ARM, prints branch immediates without offset. + + # Capstone option value + CS_OPT_OFF = 0 # Turn OFF an option - default option of CS_OPT_DETAIL +-CS_OPT_ON = 1 << 0 # Turn ON an option (CS_OPT_DETAIL) ++CS_OPT_ON = 3 # Turn ON an option (CS_OPT_DETAIL) + + # Common instruction operand types - to be consistent across all architectures. + CS_OP_INVALID = 0 # uninitialized/invalid operand. + CS_OP_REG = 1 # Register operand. + CS_OP_IMM = 2 # Immediate operand. + CS_OP_FP = 3 # Floating-Point operand. +-CS_OP_PRED = 4 # Predicate operand. +-CS_OP_RESERVED_5 = 5 +-CS_OP_RESERVED_6 = 6 +-CS_OP_RESERVED_7 = 7 +-CS_OP_RESERVED_8 = 8 +-CS_OP_RESERVED_9 = 9 +-CS_OP_RESERVED_10 = 10 +-CS_OP_RESERVED_11 = 11 +-CS_OP_RESERVED_12 = 12 +-CS_OP_RESERVED_13 = 13 +-CS_OP_RESERVED_14 = 14 +-CS_OP_RESERVED_15 = 15 +-CS_OP_SPECIAL = 0x10 # Special operands from archs + CS_OP_MEM = 0x80 # Memory operand. Can be ORed with another operand type. + + # Common instruction groups - to be consistent across all architectures. +@@ -336,13 +309,12 @@ CS_AC_READ = (1 << 0) # Operand that is read from. + CS_AC_WRITE = (1 << 1) # Operand that is written to. + + # Capstone syntax value +-CS_OPT_SYNTAX_DEFAULT = 1 << 1 # Default assembly syntax of all platforms (CS_OPT_SYNTAX) +-CS_OPT_SYNTAX_INTEL = 1 << 2 # Intel X86 asm syntax - default syntax on X86 (CS_OPT_SYNTAX, CS_ARCH_X86) +-CS_OPT_SYNTAX_ATT = 1 << 3 # ATT asm syntax (CS_OPT_SYNTAX, CS_ARCH_X86) +-CS_OPT_SYNTAX_NOREGNAME = 1 << 4 # Asm syntax prints register name with only number - (CS_OPT_SYNTAX, CS_ARCH_PPC, CS_ARCH_ARM) +-CS_OPT_SYNTAX_MASM = 1 << 5 # MASM syntax (CS_OPT_SYNTAX, CS_ARCH_X86) +-CS_OPT_SYNTAX_MOTOROLA = 1 << 6 # MOS65XX use $ as hex prefix +-CS_OPT_SYNTAX_CS_REG_ALIAS = 1 << 7 # Prints common register alias which are not defined in LLVM (ARM: r9 = sb etc.) ++CS_OPT_SYNTAX_DEFAULT = 0 # Default assembly syntax of all platforms (CS_OPT_SYNTAX) ++CS_OPT_SYNTAX_INTEL = 1 # Intel X86 asm syntax - default syntax on X86 (CS_OPT_SYNTAX, CS_ARCH_X86) ++CS_OPT_SYNTAX_ATT = 2 # ATT asm syntax (CS_OPT_SYNTAX, CS_ARCH_X86) ++CS_OPT_SYNTAX_NOREGNAME = 3 # Asm syntax prints register name with only number - (CS_OPT_SYNTAX, CS_ARCH_PPC, CS_ARCH_ARM) ++CS_OPT_SYNTAX_MASM = 4 # MASM syntax (CS_OPT_SYNTAX, CS_ARCH_X86) ++CS_OPT_SYNTAX_MOTOROLA = 5 # MOS65XX use $ as hex prefix + + # Capstone error type + CS_ERR_OK = 0 # No error: everything was fine base-commit: 395a3a3b003f219beb33ed2539ff0a8a35502b59 From unknown Fri Aug 15 15:56:59 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: soeren@soeren-tempel.net Subject: bug#72015: closed (Re: [PATCH] gnu: capstone: Backport upstream fix for Python bindings.) Message-ID: References: <87sewi4d72.fsf@dismail.de> <9274cd3a46536b0ab71ff570328da49c56d61fb7.1720541898.git.soeren@soeren-tempel.net> X-Gnu-PR-Message: they-closed 72015 X-Gnu-PR-Package: guix-patches X-Gnu-PR-Keywords: patch Reply-To: 72015@debbugs.gnu.org Date: Tue, 09 Jul 2024 18:46:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1720550762-11213-1" This is a multi-part message in MIME format... ------------=_1720550762-11213-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #72015: [PATCH] gnu: capstone: Backport upstream fix for Python bindings. which was filed against the guix-patches package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 72015@debbugs.gnu.org. --=20 72015: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D72015 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1720550762-11213-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 72015-done) by debbugs.gnu.org; 9 Jul 2024 18:45:23 +0000 Received: from localhost ([127.0.0.1]:54064 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sRFq7-0002tl-K0 for submit@debbugs.gnu.org; Tue, 09 Jul 2024 14:45:23 -0400 Received: from mx2.dismail.de ([159.69.191.136]:13116) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sRFq5-0002tV-EA for 72015-done@debbugs.gnu.org; Tue, 09 Jul 2024 14:45:22 -0400 Received: from mx2.dismail.de (localhost [127.0.0.1]) by mx2.dismail.de (OpenSMTPD) with ESMTP id ec2a8fa9; Tue, 9 Jul 2024 20:45:09 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=dismail.de; h=from:to:cc :subject:in-reply-to:date:message-id:mime-version:content-type; s=20190914; bh=tnoYVEQ7OQCdC7o+lLjfTZq0PwINvkXT1tVipO52vSc=; b= G2hlmZeGWIa2/uhkK+T3KlTFp5Fvwa4ze+0XcyArzZnXYb1OW50zmqhAmWm3VzMe N5QzqKDDObq9nkCNlDWJB88B3X11N9IgBxiXZhXmzepCuAVLu+nlPf6sHiRFJqoQ A4yn76vM/jaHtoR59ZF8LfPC/tVtdwA5T//0gcwWy6dFSmQsBgA7Nytq/cDpM5M9 Wnv6roxQHTP68PK2CgwlItikMI2iui3Qw4gzd9cHekgnVZEbtdravFIc/L161iXA BnxjReE2SaymlcttOjCGwJnJuXAcK9VzJ6/yuvB3Vz+FGUpKuuCBWR4d5ciUDk8q /9hae8f1YQbMDzwhHAoxLg== Received: from smtp2.dismail.de ( [10.240.26.12]) by mx2.dismail.de (OpenSMTPD) with ESMTP id c7ceb4f3; Tue, 9 Jul 2024 20:45:09 +0200 (CEST) Received: from smtp2.dismail.de (localhost [127.0.0.1]) by smtp2.dismail.de (OpenSMTPD) with ESMTP id a5ed8c91; Tue, 9 Jul 2024 20:45:09 +0200 (CEST) Received: by dismail.de (OpenSMTPD) with ESMTPSA id c4388360 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Tue, 9 Jul 2024 20:45:08 +0200 (CEST) From: jgart To: 72015-done@debbugs.gnu.org Subject: Re: [PATCH] gnu: capstone: Backport upstream fix for Python bindings. In-Reply-To: <9274cd3a46536b0ab71ff570328da49c56d61fb7.1720541898.git.soeren@soeren-tempel.net> Date: Tue, 09 Jul 2024 13:45:05 -0500 Message-ID: <87sewi4d72.fsf@dismail.de> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 72015-done Cc: soeren@soeren-tempel.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Thanks, applied! -- all the best, jgart ------------=_1720550762-11213-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 9 Jul 2024 16:21:56 +0000 Received: from localhost ([127.0.0.1]:53945 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sRDbH-0007c2-PX for submit@debbugs.gnu.org; Tue, 09 Jul 2024 12:21:56 -0400 Received: from lists.gnu.org ([209.51.188.17]:40144) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sRDbF-0007bu-Jd for submit@debbugs.gnu.org; Tue, 09 Jul 2024 12:21:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sRDYz-0007rL-SN for guix-patches@gnu.org; Tue, 09 Jul 2024 12:19:36 -0400 Received: from magnesium.8pit.net ([45.76.88.171]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sRDYv-0008J1-RW; Tue, 09 Jul 2024 12:19:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; s=opensmtpd; bh=LTh3kKOT fqK+7KR9OYtYqmmRFM0codwQqqJyTOEF7zQ=; h=date:subject:cc:to:from; d=soeren-tempel.net; b=a43NbmbSc7Ih2a7CxvqTaPgVXAxLEXz7YKFghFEP+vatKIX 2BTEOy5csyfaiZQtDbaKGn7VB4Ybu++KcUS3RnwC9Sky6JkTFNQwDpwLPRstfKznuvYcWa gVnwcCvHylsxJMZ1bLMsU4harV8+p0trQ1L8L/hREuNR37BxrtHn10= Received: from localhost (dynamic-2a02-3102-49da-001b-167b-bb16-88d3-7747.310.pool.telefonica.de [2a02:3102:49da:1b:167b:bb16:88d3:7747]) by magnesium.8pit.net (OpenSMTPD) with ESMTPSA id 994ffd7d (TLSv1.3:TLS_AES_256_GCM_SHA384:256:YES); Tue, 9 Jul 2024 18:19:18 +0200 (CEST) From: soeren@soeren-tempel.net To: guix-patches@gnu.org Subject: [PATCH] gnu: capstone: Backport upstream fix for Python bindings. Date: Tue, 9 Jul 2024 18:18:18 +0200 Message-ID: <9274cd3a46536b0ab71ff570328da49c56d61fb7.1720541898.git.soeren@soeren-tempel.net> X-Mailer: git-send-email 2.45.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=45.76.88.171; envelope-from=soeren@soeren-tempel.net; helo=magnesium.8pit.net X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.4 (-) X-Debbugs-Envelope-To: submit Cc: jgart@dismail.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) From: Sören Tempel * gnu/packages/patches/capstone-fix-python-constants.patch: New patch. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/engineering.scm (capstone): New patch. --- This patch includes a backport of an upstream patch which fixes several issues with the Python bindings that were discovered while packaging angr for Guix and running its test suite. The patch has been taken from #69074 as requested by jgart. gnu/local.mk | 1 + gnu/packages/engineering.scm | 3 +- .../capstone-fix-python-constants.patch | 84 +++++++++++++++++++ 3 files changed, 87 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/capstone-fix-python-constants.patch diff --git a/gnu/local.mk b/gnu/local.mk index 3f493c3050..ea4cc251ae 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1023,6 +1023,7 @@ dist_patch_DATA = \ %D%/packages/patches/calls-disable-application-test.patch \ %D%/packages/patches/calls-disable-sip-test.patch \ %D%/packages/patches/camlboot-dynamically-allocate-stack-signal.patch \ + %D%/packages/patches/capstone-fix-python-constants.patch \ %D%/packages/patches/catdoc-CVE-2017-11110.patch \ %D%/packages/patches/ccextractor-add-missing-header.patch \ %D%/packages/patches/ccextractor-autoconf-tesseract.patch \ diff --git a/gnu/packages/engineering.scm b/gnu/packages/engineering.scm index 0f290de7eb..cc9020c6fd 100644 --- a/gnu/packages/engineering.scm +++ b/gnu/packages/engineering.scm @@ -1787,6 +1787,7 @@ (define-public capstone (version "5.0.1") (source (origin (method git-fetch) + (patches (search-patches "capstone-fix-python-constants.patch")) (uri (git-reference (url "https://github.com/capstone-engine/capstone") (commit version))) @@ -1798,7 +1799,7 @@ (define-public capstone (arguments `(#:tests? #f #:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out")) - "CC=gcc") + (string-append "CC=" ,(cc-for-target))) #:phases (modify-phases %standard-phases (delete 'configure) ; no configure script diff --git a/gnu/packages/patches/capstone-fix-python-constants.patch b/gnu/packages/patches/capstone-fix-python-constants.patch new file mode 100644 index 0000000000..75100c6652 --- /dev/null +++ b/gnu/packages/patches/capstone-fix-python-constants.patch @@ -0,0 +1,84 @@ +Backport upstream patch fixing various constants in the Python bindings. + +Taken from: https://github.com/capstone-engine/capstone/commit/f180e176de3efb060db62820ff981d0291ea8525 + +diff --git a/bindings/python/capstone/__init__.py b/bindings/python/capstone/__init__.py +index bda2fdb6..52353c28 100755 +--- a/bindings/python/capstone/__init__.py ++++ b/bindings/python/capstone/__init__.py +@@ -113,7 +113,6 @@ __all__ = [ + 'CS_OPT_SYNTAX_NOREGNAME', + 'CS_OPT_SYNTAX_MASM', + 'CS_OPT_SYNTAX_MOTOROLA', +- 'CS_OPT_SYNTAX_CS_REG_ALIAS', + + 'CS_OPT_DETAIL', + 'CS_OPT_MODE', +@@ -152,19 +151,6 @@ __all__ = [ + 'CS_OP_REG', + 'CS_OP_IMM', + 'CS_OP_FP', +- 'CS_OP_PRED', +- 'CS_OP_RESERVED_5', +- 'CS_OP_RESERVED_6', +- 'CS_OP_RESERVED_7', +- 'CS_OP_RESERVED_8', +- 'CS_OP_RESERVED_9', +- 'CS_OP_RESERVED_10', +- 'CS_OP_RESERVED_11', +- 'CS_OP_RESERVED_12', +- 'CS_OP_RESERVED_13', +- 'CS_OP_RESERVED_14', +- 'CS_OP_RESERVED_15', +- 'CS_OP_SPECIAL', + 'CS_OP_MEM', + + 'CS_GRP_INVALID', +@@ -298,26 +284,13 @@ CS_OPT_NO_BRANCH_OFFSET = 9 # ARM, prints branch immediates without offset. + + # Capstone option value + CS_OPT_OFF = 0 # Turn OFF an option - default option of CS_OPT_DETAIL +-CS_OPT_ON = 1 << 0 # Turn ON an option (CS_OPT_DETAIL) ++CS_OPT_ON = 3 # Turn ON an option (CS_OPT_DETAIL) + + # Common instruction operand types - to be consistent across all architectures. + CS_OP_INVALID = 0 # uninitialized/invalid operand. + CS_OP_REG = 1 # Register operand. + CS_OP_IMM = 2 # Immediate operand. + CS_OP_FP = 3 # Floating-Point operand. +-CS_OP_PRED = 4 # Predicate operand. +-CS_OP_RESERVED_5 = 5 +-CS_OP_RESERVED_6 = 6 +-CS_OP_RESERVED_7 = 7 +-CS_OP_RESERVED_8 = 8 +-CS_OP_RESERVED_9 = 9 +-CS_OP_RESERVED_10 = 10 +-CS_OP_RESERVED_11 = 11 +-CS_OP_RESERVED_12 = 12 +-CS_OP_RESERVED_13 = 13 +-CS_OP_RESERVED_14 = 14 +-CS_OP_RESERVED_15 = 15 +-CS_OP_SPECIAL = 0x10 # Special operands from archs + CS_OP_MEM = 0x80 # Memory operand. Can be ORed with another operand type. + + # Common instruction groups - to be consistent across all architectures. +@@ -336,13 +309,12 @@ CS_AC_READ = (1 << 0) # Operand that is read from. + CS_AC_WRITE = (1 << 1) # Operand that is written to. + + # Capstone syntax value +-CS_OPT_SYNTAX_DEFAULT = 1 << 1 # Default assembly syntax of all platforms (CS_OPT_SYNTAX) +-CS_OPT_SYNTAX_INTEL = 1 << 2 # Intel X86 asm syntax - default syntax on X86 (CS_OPT_SYNTAX, CS_ARCH_X86) +-CS_OPT_SYNTAX_ATT = 1 << 3 # ATT asm syntax (CS_OPT_SYNTAX, CS_ARCH_X86) +-CS_OPT_SYNTAX_NOREGNAME = 1 << 4 # Asm syntax prints register name with only number - (CS_OPT_SYNTAX, CS_ARCH_PPC, CS_ARCH_ARM) +-CS_OPT_SYNTAX_MASM = 1 << 5 # MASM syntax (CS_OPT_SYNTAX, CS_ARCH_X86) +-CS_OPT_SYNTAX_MOTOROLA = 1 << 6 # MOS65XX use $ as hex prefix +-CS_OPT_SYNTAX_CS_REG_ALIAS = 1 << 7 # Prints common register alias which are not defined in LLVM (ARM: r9 = sb etc.) ++CS_OPT_SYNTAX_DEFAULT = 0 # Default assembly syntax of all platforms (CS_OPT_SYNTAX) ++CS_OPT_SYNTAX_INTEL = 1 # Intel X86 asm syntax - default syntax on X86 (CS_OPT_SYNTAX, CS_ARCH_X86) ++CS_OPT_SYNTAX_ATT = 2 # ATT asm syntax (CS_OPT_SYNTAX, CS_ARCH_X86) ++CS_OPT_SYNTAX_NOREGNAME = 3 # Asm syntax prints register name with only number - (CS_OPT_SYNTAX, CS_ARCH_PPC, CS_ARCH_ARM) ++CS_OPT_SYNTAX_MASM = 4 # MASM syntax (CS_OPT_SYNTAX, CS_ARCH_X86) ++CS_OPT_SYNTAX_MOTOROLA = 5 # MOS65XX use $ as hex prefix + + # Capstone error type + CS_ERR_OK = 0 # No error: everything was fine base-commit: 395a3a3b003f219beb33ed2539ff0a8a35502b59 ------------=_1720550762-11213-1-- From unknown Fri Aug 15 15:56:59 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#72015] [PATCH] gnu: capstone: Backport upstream fix for Python bindings. References: <9274cd3a46536b0ab71ff570328da49c56d61fb7.1720541898.git.soeren@soeren-tempel.net> Resent-From: jgart Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 09 Jul 2024 18:46:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 72015 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 72015-done@debbugs.gnu.org Cc: soeren@soeren-tempel.net Received: via spool by 72015-done@debbugs.gnu.org id=D72015.172055075311195 (code D ref 72015); Tue, 09 Jul 2024 18:46:02 +0000 Received: (at 72015-done) by debbugs.gnu.org; 9 Jul 2024 18:45:53 +0000 Received: from localhost ([127.0.0.1]:54068 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sRFqa-0002uU-Sl for submit@debbugs.gnu.org; Tue, 09 Jul 2024 14:45:53 -0400 Received: from mx1.dismail.de ([78.46.223.134]:27464) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sRFqZ-0002uH-4I for 72015-done@debbugs.gnu.org; Tue, 09 Jul 2024 14:45:51 -0400 Received: from mx1.dismail.de (localhost [127.0.0.1]) by mx1.dismail.de (OpenSMTPD) with ESMTP id fa68b3c1; Tue, 9 Jul 2024 20:45:39 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=dismail.de; h=from:to:cc :subject:in-reply-to:date:message-id:mime-version:content-type; s=20190914; bh=tnoYVEQ7OQCdC7o+lLjfTZq0PwINvkXT1tVipO52vSc=; b= UOhljuDwfhTuVdlzJAiWHFZ+yfs9xryI3SEI4ISNFeqCplDDA9PONKxWYnrrDDY2 +6oWkePYN6c5yDzrV5O75p9ZlL9zyCbDjXDO5QQPw11cJF0WBZAJDqmFvX60BwYf hUkzj1r7AgGuFUDnD17EbZZBFtDD/KacXHXCJrRx4FWIBDx1Vz++KlUHqsIDbc64 xgYFH2/vX8/u+zC9/rRY1FXbKcYndP6fJwC69SAuiflQ34AihjRovopomLVBvxwH EXjoVhbglPqx/xlVj3s9n27OunoYD4uG4mdul8OFzf9f2i78d9mt3sCReF9KtJPE j/A5cDI6qoo+5ZHpqNhGog== Received: from smtp1.dismail.de ( [10.240.26.11]) by mx1.dismail.de (OpenSMTPD) with ESMTP id b4c12f1d; Tue, 9 Jul 2024 20:45:38 +0200 (CEST) Received: from smtp1.dismail.de (localhost [127.0.0.1]) by smtp1.dismail.de (OpenSMTPD) with ESMTP id 8024957c; Tue, 9 Jul 2024 20:45:38 +0200 (CEST) Received: by dismail.de (OpenSMTPD) with ESMTPSA id 380d3c11 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Tue, 9 Jul 2024 20:45:38 +0200 (CEST) From: jgart In-Reply-To: <9274cd3a46536b0ab71ff570328da49c56d61fb7.1720541898.git.soeren@soeren-tempel.net> Date: Tue, 09 Jul 2024 13:45:36 -0500 Message-ID: <87r0c24d67.fsf@dismail.de> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Thanks, applied! -- all the best, jgart