diff options
| -rw-r--r-- | meta-python/recipes-devtools/python/python3-greenlet/0001-PythonAllocator-define-missing-rebind-type.patch | 56 | ||||
| -rw-r--r-- | meta-python/recipes-devtools/python/python3-greenlet_2.0.1.bb | 3 |
2 files changed, 58 insertions, 1 deletions
diff --git a/meta-python/recipes-devtools/python/python3-greenlet/0001-PythonAllocator-define-missing-rebind-type.patch b/meta-python/recipes-devtools/python/python3-greenlet/0001-PythonAllocator-define-missing-rebind-type.patch new file mode 100644 index 0000000000..01092025de --- /dev/null +++ b/meta-python/recipes-devtools/python/python3-greenlet/0001-PythonAllocator-define-missing-rebind-type.patch | |||
| @@ -0,0 +1,56 @@ | |||
| 1 | From 18fb84bb041072503b783ae03c5252f26d2216b8 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Khem Raj <raj.khem@gmail.com> | ||
| 3 | Date: Sun, 29 Jan 2023 21:42:08 -0800 | ||
| 4 | Subject: [PATCH] PythonAllocator: define missing 'rebind' type | ||
| 5 | |||
| 6 | `gcc-13` added an assert to standard headers to make sure custom | ||
| 7 | allocators have intended implementation of rebind type instead | ||
| 8 | of inherited rebind. gcc change: | ||
| 9 | https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=64c986b49558a7 | ||
| 10 | |||
| 11 | Without the fix build fails on this week's `gcc-13` as: | ||
| 12 | |||
| 13 | | In file included from ../recipe-sysroot/usr/include/c++/13.0.1/ext/alloc_traits.h:34, | ||
| 14 | | from ../recipe-sysroot/usr/include/c++/13.0.1/bits/basic_string.h:39, | ||
| 15 | | from ../recipe-sysroot/usr/include/c++/13.0.1/string:54, | ||
| 16 | | from src/greenlet/greenlet.cpp:10: | ||
| 17 | | ../recipe-sysroot/usr/include/c++/13.0.1/bits/alloc_traits.h: In instantiation of 'struct std::__allocator_traits_base::__rebind<greenlet::PythonAllocator<_greenlet*>, _greenlet*, void>': | ||
| 18 | | ../recipe-sysroot/usr/include/c++/13.0.1/bits/alloc_traits.h:94:11: required by substitution of 'template<class _Alloc, class _Up> using std::__alloc_rebind = typename std::__allocator_traits_base::__rebind<_Alloc, _Up>::type [with _Alloc = greenlet::PythonAllocator<_greenlet*>; _Up = _greenlet*]' | ||
| 19 | | ../recipe-sysroot/usr/include/c++/13.0.1/bits/alloc_traits.h:228:8: required by substitution of 'template<class _Alloc> template<class _Tp> using std::allocator_traits< <template-parameter-1-1> >::rebind_alloc = std::__alloc_rebind<_Alloc, _Tp> [with _Tp = _greenlet*; _Alloc = greenlet::PythonAllocator<_greenlet*>]' | ||
| 20 | | ../recipe-sysroot/usr/include/c++/13.0.1/ext/alloc_traits.h:126:65: required from 'struct __gnu_cxx::__alloc_traits<greenlet::PythonAllocator<_greenlet*>, _greenlet*>::rebind<_greenlet*>' | ||
| 21 | | ../recipe-sysroot/usr/include/c++/13.0.1/bits/stl_vector.h:88:21: required from 'struct std::_Vector_base<_greenlet*, greenlet::PythonAllocator<_greenlet*> >' | ||
| 22 | | ../recipe-sysroot/usr/include/c++/13.0.1/bits/stl_vector.h:423:11: required from 'class std::vector<_greenlet*, greenlet::PythonAllocator<_greenlet*> >' | ||
| 23 | | src/greenlet/greenlet_thread_state.hpp:115:16: required from here | ||
| 24 | | ../recipe-sysroot/usr/include/c++/13.0.1/bits/alloc_traits.h:70:31: error: static assertion failed: allocator_traits<A>::rebind_alloc<A::value_type> must be A | ||
| 25 | | 70 | _Tp>::value, | ||
| 26 | | | ^~~~~ | ||
| 27 | | ../recipe-sysroot/usr/include/c++/13.0.1/bits/alloc_traits.h:70:31: note: 'std::integral_constant<bool, false>::value' evaluates to false | ||
| 28 | |||
| 29 | The change adds trivial `rebind` definition with expected return type | ||
| 30 | and satisfies conversion requirements. | ||
| 31 | |||
| 32 | Upstream-Status: Submitted [https://github.com/python-greenlet/greenlet/pull/344] | ||
| 33 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 34 | --- | ||
| 35 | src/greenlet/greenlet_allocator.hpp | 5 +++++ | ||
| 36 | 1 file changed, 5 insertions(+) | ||
| 37 | |||
| 38 | diff --git a/src/greenlet/greenlet_allocator.hpp b/src/greenlet/greenlet_allocator.hpp | ||
| 39 | index 666307d..beaa7ed 100644 | ||
| 40 | --- a/src/greenlet/greenlet_allocator.hpp | ||
| 41 | +++ b/src/greenlet/greenlet_allocator.hpp | ||
| 42 | @@ -32,6 +32,11 @@ namespace greenlet | ||
| 43 | |||
| 44 | PythonAllocator() : std::allocator<T>() {} | ||
| 45 | |||
| 46 | + template <class U> struct rebind | ||
| 47 | + { | ||
| 48 | + typedef PythonAllocator<U> other; | ||
| 49 | + }; | ||
| 50 | + | ||
| 51 | T* allocate(size_t number_objects, const void* UNUSED(hint)=0) | ||
| 52 | { | ||
| 53 | void* p; | ||
| 54 | -- | ||
| 55 | 2.39.1 | ||
| 56 | |||
diff --git a/meta-python/recipes-devtools/python/python3-greenlet_2.0.1.bb b/meta-python/recipes-devtools/python/python3-greenlet_2.0.1.bb index 4a50a24184..90b5d140d5 100644 --- a/meta-python/recipes-devtools/python/python3-greenlet_2.0.1.bb +++ b/meta-python/recipes-devtools/python/python3-greenlet_2.0.1.bb | |||
| @@ -4,7 +4,8 @@ LICENSE = "MIT & PSF-2.0" | |||
| 4 | LIC_FILES_CHKSUM = "file://LICENSE;md5=e95668d68e4329085c7ab3535e6a7aee \ | 4 | LIC_FILES_CHKSUM = "file://LICENSE;md5=e95668d68e4329085c7ab3535e6a7aee \ |
| 5 | file://LICENSE.PSF;md5=c106931d9429eda0492617f037b8f69a" | 5 | file://LICENSE.PSF;md5=c106931d9429eda0492617f037b8f69a" |
| 6 | 6 | ||
| 7 | SRC_URI += "file://0001-greenlet-Drop-using-register-storage-class-keyword.patch" | 7 | SRC_URI += "file://0001-greenlet-Drop-using-register-storage-class-keyword.patch \ |
| 8 | file://0001-PythonAllocator-define-missing-rebind-type.patch" | ||
| 8 | 9 | ||
| 9 | SRC_URI[sha256sum] = "42e602564460da0e8ee67cb6d7236363ee5e131aa15943b6670e44e5c2ed0f67" | 10 | SRC_URI[sha256sum] = "42e602564460da0e8ee67cb6d7236363ee5e131aa15943b6670e44e5c2ed0f67" |
| 10 | 11 | ||
