diff --git a/aarch64.patch b/aarch64.patch new file mode 100644 index 0000000..7a83568 --- /dev/null +++ b/aarch64.patch @@ -0,0 +1,25 @@ +diff -purN libffi-3.2.1.git505.orig/src/aarch64/ffi.c libffi-3.2.1.git505/src/aarch64/ffi.c +--- libffi-3.2.1.git505.orig/src/aarch64/ffi.c 2019-08-07 20:57:45.000000000 +0200 ++++ libffi-3.2.1.git505/src/aarch64/ffi.c 2019-10-11 08:45:42.702088832 +0200 +@@ -815,7 +815,8 @@ ffi_prep_closure_loc (ffi_closure *closu + #else + unsigned char *tramp_code = ffi_data_to_code_pointer (tramp); + #endif +- ffi_clear_cache (tramp_code, tramp_code + FFI_TRAMPOLINE_SIZE); ++ if (tramp_code != NULL) ++ ffi_clear_cache (tramp_code, tramp_code + FFI_TRAMPOLINE_SIZE); + #endif + + closure->cif = cif; +diff -purN libffi-3.2.1.git505.orig/src/closures.c libffi-3.2.1.git505/src/closures.c +--- libffi-3.2.1.git505.orig/src/closures.c 2019-08-07 20:57:45.000000000 +0200 ++++ libffi-3.2.1.git505/src/closures.c 2019-10-11 08:43:59.265151289 +0200 +@@ -925,6 +925,8 @@ void * + ffi_data_to_code_pointer (void *data) + { + msegmentptr seg = segment_holding (gm, data); ++ if (seg == NULL) ++ return NULL; + return add_segment_exec_offset (data, seg); + } + diff --git a/libffi.changes b/libffi.changes index 6a3f480..1e61423 100644 --- a/libffi.changes +++ b/libffi.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Fri Oct 11 07:27:45 UTC 2019 - Guillaume GARDET + +- Workaround aarch64 bug (boo#1153573) with upstream patch + https://github.com/libffi/libffi/pull/499 updated to apply + on current sources (upstream will probably rework this patch + so we need to monitor the issue for the proper fix): + * aarch64.patch + ------------------------------------------------------------------- Wed Sep 18 09:39:07 UTC 2019 - Andreas Schwab diff --git a/libffi.spec b/libffi.spec index afaaff4..368ef66 100644 --- a/libffi.spec +++ b/libffi.spec @@ -29,6 +29,8 @@ Source: %name-%version.tar.xz Source99: baselibs.conf Patch1: gccbug.patch Patch2: stdcall.patch +# Workaround from https://github.com/libffi/libffi/issues/498 +Patch3: aarch64.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: autoconf BuildRequires: automake @@ -82,6 +84,7 @@ time. %setup -q %patch1 -p1 %patch2 -p1 +%patch3 -p1 %build ./autogen.sh