diff --git a/fix_pycparse_float128.patch b/fix_pycparse_float128.patch new file mode 100644 index 0000000..c803b84 --- /dev/null +++ b/fix_pycparse_float128.patch @@ -0,0 +1,35 @@ +From 9bcd83905e5b7e718fe3787600f3ecf957c66430 Mon Sep 17 00:00:00 2001 +From: Alberto Planas +Date: Fri, 17 Feb 2023 13:58:18 +0100 +Subject: [PATCH] setup: define __float128 for pycparse + +When compiling in 32bit stddef.h makes use of the __float128 type, that +pycparse cannot recognize. + +This patch define the type as "long double", fixing the issue in 32bits +platforms. + +Fix #497 + +Signed-off-by: Alberto Planas +--- + setup.py | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/setup.py b/setup.py +index 17736597..4554db0b 100644 +--- a/setup.py ++++ b/setup.py +@@ -204,7 +204,11 @@ def get_mappings(self): + if policy_header_path: + pdata = preprocess_file( + policy_header_path, +- cpp_args=["-D__extension__=", "-D__attribute__(x)="], ++ cpp_args=[ ++ "-D__extension__=", ++ "-D__attribute__(x)=", ++ "-D__float128=long double", ++ ], + ) + parser = c_parser.CParser() + past = parser.parse(pdata, "tss2_policy.h") diff --git a/python-tpm2-pytss.changes b/python-tpm2-pytss.changes index 5c69889..59f2f6c 100644 --- a/python-tpm2-pytss.changes +++ b/python-tpm2-pytss.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Fri Feb 17 13:17:22 UTC 2023 - Alberto Planas Dominguez + +- Add fix_pycparse_float128.patch to fix issue in 32bits platforms + ------------------------------------------------------------------- Thu Feb 16 15:30:10 UTC 2023 - aplanas@suse.com diff --git a/python-tpm2-pytss.spec b/python-tpm2-pytss.spec index 87b3251..d343cfb 100644 --- a/python-tpm2-pytss.spec +++ b/python-tpm2-pytss.spec @@ -27,6 +27,8 @@ Summary: Python bindings for TSS License: BSD-2-Clause URL: https://github.com/tpm2-software/tpm2-pkcs11 Source: %{srcname}-%{version}.tar.gz +# PATCH-FIX-UPSTREAM fix_pycparse_float128.patch gh#tpm2-software/tpm2-pytss#497 +Patch0: fix_pycparse_float128.patch BuildRequires: %{python_module PyYAML} BuildRequires: %{python_module asn1crypto} BuildRequires: %{python_module cffi}