From 85c14cfd927c212125f8cca9bfc46245ea532ae516ad25a12d2b07d74abc45cc Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Fri, 21 Sep 2018 05:26:36 +0000 Subject: [PATCH] - Add 3184b0a675fc425b821b528d7fdf744b2f08dadf.patch as a workardond against https://bitbucket.org/cffi/cffi/issues/378/ (possible bug in GCC, see https://bugzilla.redhat.com/1552724). OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cffi?expand=0&rev=50 --- ...b0a675fc425b821b528d7fdf744b2f08dadf.patch | 46 +++++++++++++++++++ python-cffi.changes | 8 ++++ python-cffi.spec | 2 + 3 files changed, 56 insertions(+) create mode 100644 3184b0a675fc425b821b528d7fdf744b2f08dadf.patch diff --git a/3184b0a675fc425b821b528d7fdf744b2f08dadf.patch b/3184b0a675fc425b821b528d7fdf744b2f08dadf.patch new file mode 100644 index 0000000..8fb8c07 --- /dev/null +++ b/3184b0a675fc425b821b528d7fdf744b2f08dadf.patch @@ -0,0 +1,46 @@ +# HG changeset patch +# User Armin Rigo +# Date 1536839482 -7200 +# Node ID 3184b0a675fc425b821b528d7fdf744b2f08dadf +# Parent 97a61f7b0bcd48eb74f136280ffd8733e829f153 +Issue 378 + +Workaround for a GCC bug + +diff --git a/c/_cffi_backend.c b/c/_cffi_backend.c +--- a/c/_cffi_backend.c ++++ b/c/_cffi_backend.c +@@ -892,11 +892,21 @@ + return 0; + } + ++#ifdef __GNUC__ ++/* This is a workaround for what I think is a GCC bug on several ++ platforms. See issue #378. */ ++__attribute__((noinline)) ++#endif ++void _cffi_memcpy(char *target, const void *src, size_t size) ++{ ++ memcpy(target, src, size); ++} ++ + #define _write_raw_data(type) \ + do { \ + if (size == sizeof(type)) { \ + type r = (type)source; \ +- memcpy(target, &r, sizeof(type)); \ ++ _cffi_memcpy(target, &r, sizeof(type)); \ + return; \ + } \ + } while(0) +@@ -970,8 +980,8 @@ + if (size == 2*sizeof(type)) { \ + type r = (type)source.real; \ + type i = (type)source.imag; \ +- memcpy(target, &r, sizeof(type)); \ +- memcpy(target+sizeof(type), &i, sizeof(type)); \ ++ _cffi_memcpy(target, &r, sizeof(type)); \ ++ _cffi_memcpy(target+sizeof(type), &i, sizeof(type)); \ + return; \ + } \ + } while(0) diff --git a/python-cffi.changes b/python-cffi.changes index c972f4b..73c0c1d 100644 --- a/python-cffi.changes +++ b/python-cffi.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Fri Sep 21 07:24:58 CEST 2018 - mcepl@suse.com + +- Add 3184b0a675fc425b821b528d7fdf744b2f08dadf.patch as + a workardond against + https://bitbucket.org/cffi/cffi/issues/378/ (possible bug in + GCC, see https://bugzilla.redhat.com/1552724). + ------------------------------------------------------------------- Wed Sep 19 20:43:08 CEST 2018 - mcepl@suse.com diff --git a/python-cffi.spec b/python-cffi.spec index a1895aa..626e2b0 100644 --- a/python-cffi.spec +++ b/python-cffi.spec @@ -28,6 +28,8 @@ Source0: https://files.pythonhosted.org/packages/source/c/cffi/cffi-%{ver Source1: python-cffi-rpmlintrc # https://bitbucket.org/cffi/cffi/issues/384/ Patch0: e2e324a2f13e3a646de6f6ff03e90ed7d37e2636.patch +# https://bitbucket.org/cffi/cffi/issues/378 +Patch1: 3184b0a675fc425b821b528d7fdf744b2f08dadf.patch BuildRequires: %{python_module devel} BuildRequires: %{python_module pycparser} BuildRequires: %{python_module pytest}