From 74d1b2c03c08790a3ff431f1011883e6a5a2ebf8df84b316254a4ce3e5cc908d Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Tue, 25 Oct 2022 06:48:52 +0000 Subject: [PATCH] Accepting request 1030896 from home:Andreas_Schwab:Factory - Update to libffi 3.4.4 * Important aarch64 fixes, including support for linux builds with Link Time Optimization (-flto). * Fix x86 stdcall stack alignment. * Fix x86 Windows msvc assembler compatibility. * Fix moxie and or1k small structure args. - drop riscv64-handle-big-structures.patch - reenable LTO OBS-URL: https://build.opensuse.org/request/show/1030896 OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/libffi?expand=0&rev=30 --- libffi-3.4.3.tar.gz | 3 -- libffi-3.4.4.tar.gz | 3 ++ libffi.changes | 12 ++++++++ libffi.spec | 5 +--- riscv64-handle-big-structures.patch | 46 ----------------------------- 5 files changed, 16 insertions(+), 53 deletions(-) delete mode 100644 libffi-3.4.3.tar.gz create mode 100644 libffi-3.4.4.tar.gz delete mode 100644 riscv64-handle-big-structures.patch diff --git a/libffi-3.4.3.tar.gz b/libffi-3.4.3.tar.gz deleted file mode 100644 index a2666c4..0000000 --- a/libffi-3.4.3.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:4416dd92b6ae8fcb5b10421e711c4d3cb31203d77521a77d85d0102311e6c3b8 -size 1358634 diff --git a/libffi-3.4.4.tar.gz b/libffi-3.4.4.tar.gz new file mode 100644 index 0000000..ee001f2 --- /dev/null +++ b/libffi-3.4.4.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d66c56ad259a82cf2a9dfc408b32bf5da52371500b84745f7fb8b645712df676 +size 1362394 diff --git a/libffi.changes b/libffi.changes index abda6fa..7581dd3 100644 --- a/libffi.changes +++ b/libffi.changes @@ -1,3 +1,15 @@ +------------------------------------------------------------------- +Mon Oct 24 13:07:19 UTC 2022 - Andreas Schwab + +- Update to libffi 3.4.4 + * Important aarch64 fixes, including support for linux builds + with Link Time Optimization (-flto). + * Fix x86 stdcall stack alignment. + * Fix x86 Windows msvc assembler compatibility. + * Fix moxie and or1k small structure args. +- drop riscv64-handle-big-structures.patch +- reenable LTO + ------------------------------------------------------------------- Mon Oct 10 09:46:39 UTC 2022 - Dirk Müller diff --git a/libffi.spec b/libffi.spec index f6b600b..9c68deb 100644 --- a/libffi.spec +++ b/libffi.spec @@ -18,7 +18,7 @@ %define libffi_sover 8 Name: libffi -Version: 3.4.3 +Version: 3.4.4 Release: 0 Summary: Foreign Function Interface Library License: MIT @@ -26,7 +26,6 @@ Group: Development/Languages/C and C++ URL: https://sourceware.org/libffi/ Source: https://github.com/libffi/libffi/releases/download/v%{version}/libffi-%{version}.tar.gz Source99: baselibs.conf -Patch1: riscv64-handle-big-structures.patch # for make check BuildRequires: dejagnu BuildRequires: expect @@ -68,8 +67,6 @@ time. %autosetup -p1 %build -# https://github.com/libffi/libffi/issues/733 -%define _lto_cflags %{nil} # https://github.com/libffi/libffi/pull/647 %configure --disable-exec-static-tramp %make_build diff --git a/riscv64-handle-big-structures.patch b/riscv64-handle-big-structures.patch deleted file mode 100644 index b3b62f5..0000000 --- a/riscv64-handle-big-structures.patch +++ /dev/null @@ -1,46 +0,0 @@ ---- libffi-3.4.3.orig/src/riscv/ffi.c -+++ libffi-3.4.3/src/riscv/ffi.c -@@ -61,6 +61,7 @@ typedef struct call_builder - int used_integer; - int used_float; - size_t *used_stack; -+ void *struct_stack; - } call_builder; - - /* integer (not pointer) less than ABI XLEN */ -@@ -227,7 +228,9 @@ static void marshal(call_builder *cb, ff - #endif - - if (type->size > 2 * __SIZEOF_POINTER__) { -- /* pass by reference */ -+ /* copy to stack and pass by reference */ -+ data = memcpy (cb->struct_stack, data, type->size); -+ cb->struct_stack = (size_t *) FFI_ALIGN ((char *) cb->struct_stack + type->size, __SIZEOF_POINTER__); - marshal_atom(cb, FFI_TYPE_POINTER, &data); - } else if (IS_INT(type->type) || type->type == FFI_TYPE_POINTER) { - marshal_atom(cb, type->type, data); -@@ -335,10 +338,12 @@ ffi_call_int (ffi_cif *cif, void (*fn) ( - that all remaining arguments are long long / __int128 */ - size_t arg_bytes = cif->nargs <= 3 ? 0 : - FFI_ALIGN(2 * sizeof(size_t) * (cif->nargs - 3), STKALIGN); -+ /* Allocate space for copies of big structures. */ -+ size_t struct_bytes = FFI_ALIGN (cif->bytes, STKALIGN); - size_t rval_bytes = 0; - if (rvalue == NULL && cif->rtype->size > 2*__SIZEOF_POINTER__) - rval_bytes = FFI_ALIGN(cif->rtype->size, STKALIGN); -- size_t alloc_size = arg_bytes + rval_bytes + sizeof(call_context); -+ size_t alloc_size = arg_bytes + rval_bytes + struct_bytes + sizeof(call_context); - - /* the assembly code will deallocate all stack data at lower addresses - than the argument region, so we need to allocate the frame and the -@@ -358,8 +363,9 @@ ffi_call_int (ffi_cif *cif, void (*fn) ( - - call_builder cb; - cb.used_float = cb.used_integer = 0; -- cb.aregs = (call_context*)(alloc_base + arg_bytes + rval_bytes); -+ cb.aregs = (call_context*)(alloc_base + arg_bytes + rval_bytes + struct_bytes); - cb.used_stack = (void*)alloc_base; -+ cb.struct_stack = (void *) (alloc_base + arg_bytes + rval_bytes); - - int return_by_ref = passed_by_ref(&cb, cif->rtype, 0); - if (return_by_ref)