diff options
author | alpine-mips-patches <info@mobile-stream.com> | 2019-02-11 13:18:22 +0000 |
---|---|---|
committer | Leonardo Arena <rnalrd@alpinelinux.org> | 2019-03-05 15:59:45 +0000 |
commit | a551bde04b190822fcace4d589677aac37613be9 (patch) | |
tree | d27b755cbe35bbc0766348ac845d3418c1349006 /community/py-augeas/dlopen-libc-explicitly.patch | |
parent | 7f90328d3f882f558e1a22830974308c31fef713 (diff) |
community/py-augeas: fix crash on mips*
On mips* dynamically imported symbol (here 'free') must be looked
up in its explicitly dlopen()ed module (here 'None' which means
the standard C library in cffi world). This change does not break
x86_64 at least and actually follows the cffi docs at
cdef.html#ffi-dlopen-loading-libraries-in-abi-mode
Diffstat (limited to 'community/py-augeas/dlopen-libc-explicitly.patch')
-rw-r--r-- | community/py-augeas/dlopen-libc-explicitly.patch | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/community/py-augeas/dlopen-libc-explicitly.patch b/community/py-augeas/dlopen-libc-explicitly.patch new file mode 100644 index 00000000000..c7aa05a2b80 --- /dev/null +++ b/community/py-augeas/dlopen-libc-explicitly.patch @@ -0,0 +1,32 @@ +--- a/augeas/__init__.py ++++ b/augeas/__init__.py +@@ -42,7 +42,7 @@ + + import cffi + import types +-from augeas.ffi import ffi, lib ++from augeas.ffi import ffi, lib, c89 + + PY3 = _pyver >= (3,) + AUGENC = 'utf8' +@@ -421,8 +421,8 @@ + # Create a python string and append it to our matches list + item = ffi.string(array[i]) + matches.append(dec(item)) +- lib.free(array[i]) +- lib.free(array) ++ c89.free(array[i]) ++ c89.free(array) + return matches + + def span(self, path): +--- a/augeas/ffi.py ++++ b/augeas/ffi.py +@@ -40,6 +40,7 @@ + """) + + lib = ffi.dlopen("augeas") ++c89 = ffi.dlopen(None) + + if __name__ == "__main__": + ffi.compile(verbose=True) |