diff --git a/backport-Fix-floating-point-compare.patch b/backport-Fix-floating-point-compare.patch deleted file mode 100644 index a06fd2a83290f251b7b7e549d12e09ff38600753..0000000000000000000000000000000000000000 --- a/backport-Fix-floating-point-compare.patch +++ /dev/null @@ -1,44 +0,0 @@ -From 92d384df196a099fde384f9178864dbfe8c6b0fc Mon Sep 17 00:00:00 2001 -From: Anthony Green -Date: Sun, 15 Sep 2024 12:32:29 -0400 -Subject: [PATCH] Fix floating point compare - -Conflict:NA -Reference:https://github.com/libffi/libffi/commit/92d384df196a099fde384f9178864dbfe8c6b0fc ---- - testsuite/libffi.call/struct_int_float.c | 12 ++++++------ - 1 file changed, 6 insertions(+), 6 deletions(-) - -diff --git a/testsuite/libffi.call/struct_int_float.c b/testsuite/libffi.call/struct_int_float.c -index 079634e..13fef64 100644 ---- a/testsuite/libffi.call/struct_int_float.c -+++ b/testsuite/libffi.call/struct_int_float.c -@@ -16,11 +16,11 @@ typedef struct - } test_structure_int_float; - - static float ABI_ATTR struct_int_float(test_structure_int_float ts1, -- test_structure_int_float ts2, -- test_structure_int_float ts3, -- test_structure_int_float ts4, -- test_structure_int_float ts5, -- test_structure_int_float ts6) -+ test_structure_int_float ts2 __UNUSED__, -+ test_structure_int_float ts3 __UNUSED__, -+ test_structure_int_float ts4 __UNUSED__, -+ test_structure_int_float ts5 __UNUSED__, -+ test_structure_int_float ts6 __UNUSED__) - { - return ts1.f; - } -@@ -84,7 +84,7 @@ int main (void) - - printf ("%g\n", rfloat); - -- CHECK(fabs(rfloat - 11.11) < FLT_EPSILON); -+ CHECK(fabs(rfloat - 11.11) < 3 * FLT_EPSILON); - - exit(0); - } --- -2.27.0 - diff --git a/backport-Robustify-floating-point-comparison-in-test.patch b/backport-Robustify-floating-point-comparison-in-test.patch deleted file mode 100644 index 795c76522101860d5f384adc23cdbff68326773f..0000000000000000000000000000000000000000 --- a/backport-Robustify-floating-point-comparison-in-test.patch +++ /dev/null @@ -1,51 +0,0 @@ -From efb98a72d8b9bdb71b4f972efced073bee3b30fc Mon Sep 17 00:00:00 2001 -From: Anthony Green -Date: Sun, 15 Sep 2024 07:31:33 -0400 -Subject: [PATCH] Robustify floating point comparison in test - -Conflict:NA -Reference:https://github.com/libffi/libffi/commit/efb98a72d8b9bdb71b4f972efced073bee3b30fc ---- - testsuite/libffi.call/struct_int_float.c | 14 +++++++------- - 1 file changed, 7 insertions(+), 7 deletions(-) - -diff --git a/testsuite/libffi.call/struct_int_float.c b/testsuite/libffi.call/struct_int_float.c -index 7014f13..079634e 100644 ---- a/testsuite/libffi.call/struct_int_float.c -+++ b/testsuite/libffi.call/struct_int_float.c -@@ -61,17 +61,17 @@ int main (void) - CHECK(ffi_prep_cif(&cif, 2, 6, &ffi_type_float, args) == FFI_OK); - - ts_arg[0].i = 1; -- ts_arg[0].f = 1.11f; -+ ts_arg[0].f = 11.11f; - ts_arg[1].i = 2; -- ts_arg[1].f = 2.22f; -+ ts_arg[1].f = 22.22f; - ts_arg[2].i = 3; -- ts_arg[2].f = 3.33f; -+ ts_arg[2].f = 33.33f; - ts_arg[3].i = 4; -- ts_arg[3].f = 4.44f; -+ ts_arg[3].f = 44.44f; - ts_arg[4].i = 5; -- ts_arg[4].f = 5.55f; -+ ts_arg[4].f = 55.55f; - ts_arg[5].i = 6; -- ts_arg[5].f = 6.66f; -+ ts_arg[5].f = 66.66f; - - printf ("%g\n", ts_arg[0].f); - printf ("%g\n", ts_arg[1].f); -@@ -84,7 +84,7 @@ int main (void) - - printf ("%g\n", rfloat); - -- CHECK(rfloat == 1.11f); -+ CHECK(fabs(rfloat - 11.11) < FLT_EPSILON); - - exit(0); - } --- -2.27.0 - diff --git a/backport-fix-x86-ffi64-calls-with-6-gp-and-some-sse-registers.patch b/backport-fix-x86-ffi64-calls-with-6-gp-and-some-sse-registers.patch deleted file mode 100644 index 68fa4c2dedf0bd6fa76f0d4ef6cdaacccf112652..0000000000000000000000000000000000000000 --- a/backport-fix-x86-ffi64-calls-with-6-gp-and-some-sse-registers.patch +++ /dev/null @@ -1,129 +0,0 @@ -From d21881f55ed4a44d464c9091871e69b0bb47611a Mon Sep 17 00:00:00 2001 -From: kellda <59569234+kellda@users.noreply.github.com> -Date: Sun, 15 Sep 2024 13:29:42 +0200 -Subject: [PATCH] Fix x86/ffi64 calls with 6 gp and some sse registers (#848) - -Conflict:(1)add two header files. -(2)modify the incorrect parameters passed in. -Reference:https://github.com/libffi/libffi/commit/d21881f55ed4a44d464c9091871e69b0bb47611a -* Fix x86/ffi64 calls with 6 gp and some sse registers - -* Add test demonstating issue when mixing gp and sse registers ---- - src/x86/ffi64.c | 2 +- - testsuite/libffi.call/struct_int_float.c | 90 ++++++++++++++++++++++++ - 2 files changed, 91 insertions(+), 1 deletion(-) - create mode 100644 testsuite/libffi.call/struct_int_float.c - -diff --git a/src/x86/ffi64.c b/src/x86/ffi64.c -index 6a8e37f..39f0bfd 100644 ---- a/src/x86/ffi64.c -+++ b/src/x86/ffi64.c -@@ -651,7 +651,7 @@ ffi_call_int (ffi_cif *cif, void (*fn)(void), void *rvalue, - break; - default: - reg_args->gpr[gprcount] = 0; -- memcpy (®_args->gpr[gprcount], a, size); -+ memcpy (®_args->gpr[gprcount], a, sizeof(UINT64)); - } - gprcount++; - break; -diff --git a/testsuite/libffi.call/struct_int_float.c b/testsuite/libffi.call/struct_int_float.c -new file mode 100644 -index 0000000..7014f13 ---- /dev/null -+++ b/testsuite/libffi.call/struct_int_float.c -@@ -0,0 +1,90 @@ -+/* Area: ffi_call -+ Purpose: Demonstrate structures with integers corrupting earlier floats -+ Limitations: none. -+ PR: #848 -+ Originator: kellda */ -+ -+/* { dg-do run } */ -+#include "ffitest.h" -+#include -+#include -+ -+typedef struct -+{ -+ unsigned long i; -+ float f; -+} test_structure_int_float; -+ -+static float ABI_ATTR struct_int_float(test_structure_int_float ts1, -+ test_structure_int_float ts2, -+ test_structure_int_float ts3, -+ test_structure_int_float ts4, -+ test_structure_int_float ts5, -+ test_structure_int_float ts6) -+{ -+ return ts1.f; -+} -+ -+int main (void) -+{ -+ ffi_cif cif; -+ ffi_type *args[MAX_ARGS]; -+ void *values[MAX_ARGS]; -+ ffi_type ts_type; -+ ffi_type *ts_type_elements[3]; -+ float rfloat; -+ -+ test_structure_int_float ts_arg[6]; -+ -+ ts_type.size = 0; -+ ts_type.alignment = 0; -+ ts_type.type = FFI_TYPE_STRUCT; -+ ts_type.elements = ts_type_elements; -+ ts_type_elements[0] = &ffi_type_ulong; -+ ts_type_elements[1] = &ffi_type_float; -+ ts_type_elements[2] = NULL; -+ -+ args[0] = &ts_type; -+ values[0] = &ts_arg[0]; -+ args[1] = &ts_type; -+ values[1] = &ts_arg[1]; -+ args[2] = &ts_type; -+ values[2] = &ts_arg[2]; -+ args[3] = &ts_type; -+ values[3] = &ts_arg[3]; -+ args[4] = &ts_type; -+ values[4] = &ts_arg[4]; -+ args[5] = &ts_type; -+ values[5] = &ts_arg[5]; -+ -+ /* Initialize the cif */ -+ CHECK(ffi_prep_cif(&cif, 2, 6, &ffi_type_float, args) == FFI_OK); -+ -+ ts_arg[0].i = 1; -+ ts_arg[0].f = 1.11f; -+ ts_arg[1].i = 2; -+ ts_arg[1].f = 2.22f; -+ ts_arg[2].i = 3; -+ ts_arg[2].f = 3.33f; -+ ts_arg[3].i = 4; -+ ts_arg[3].f = 4.44f; -+ ts_arg[4].i = 5; -+ ts_arg[4].f = 5.55f; -+ ts_arg[5].i = 6; -+ ts_arg[5].f = 6.66f; -+ -+ printf ("%g\n", ts_arg[0].f); -+ printf ("%g\n", ts_arg[1].f); -+ printf ("%g\n", ts_arg[2].f); -+ printf ("%g\n", ts_arg[3].f); -+ printf ("%g\n", ts_arg[4].f); -+ printf ("%g\n", ts_arg[5].f); -+ -+ ffi_call(&cif, FFI_FN(struct_int_float), &rfloat, values); -+ -+ printf ("%g\n", rfloat); -+ -+ CHECK(rfloat == 1.11f); -+ -+ exit(0); -+} --- -2.27.0 - diff --git a/libffi-3.4.6.tar.gz b/libffi-3.4.6.tar.gz deleted file mode 100644 index 34e81ccb9801ca67c0b3800ece7559da75293947..0000000000000000000000000000000000000000 Binary files a/libffi-3.4.6.tar.gz and /dev/null differ diff --git a/libffi-3.4.7.tar.gz b/libffi-3.4.7.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..5c012072b92205f05c429423f1eebed7cb7bc5fa Binary files /dev/null and b/libffi-3.4.7.tar.gz differ diff --git a/libffi.spec b/libffi.spec index e9dd93bee3e159d9581535d2611141d0fc0ef827..508159637ed2f27086cb66b71459970db3d6cc10 100644 --- a/libffi.spec +++ b/libffi.spec @@ -1,17 +1,14 @@ Name: libffi -Version: 3.4.6 -Release: 2 +Version: 3.4.7 +Release: 1 Summary: A Portable Foreign Function Interface Library License: MIT -URL: http://sourceware.org/libffi +URL: https://sourceware.org/libffi Source0: https://github.com/libffi/libffi/releases/download/v%{version}/%{name}-%{version}.tar.gz Source1: ffi-multilib.h Source2: ffitarget-multilib.h Patch1: fix-AARCH64EB-support.patch -Patch2: backport-fix-x86-ffi64-calls-with-6-gp-and-some-sse-registers.patch -Patch3: backport-Robustify-floating-point-comparison-in-test.patch -Patch4: backport-Fix-floating-point-compare.patch BuildRequires: gcc gcc-c++ dejagnu BuildRequires: make @@ -41,18 +38,11 @@ conversions for values passed between the two languages. %package devel Summary: Development files for libffi Requires: %{name} = %{version}-%{release} -Requires: pkgconfig %description devel The devel package with header files and libraries is for developing apps which needs libffi. -%package help -Summary: libffi help -Requires: info -BuildArch: noarch - -%description help -The help package contains man files. +%package_help %prep %autosetup -p1 -n %{name}-%{version} @@ -72,19 +62,9 @@ The help package contains man files. rm -f $RPM_BUILD_ROOT%{_infodir}/dir -%ldconfig_scriptlets - %check %make_build check -%post help -/sbin/install-info --info-dir=%{_infodir} %{_infodir}/libffi.info.gz || : - -%preun help -if [ $1 = 0 ] ;then - /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/libffi.info.gz || : -fi - %files %license LICENSE %{_libdir}/*.so.* @@ -95,10 +75,13 @@ fi %{_libdir}/*.so %files help -%{_mandir}/man3/*.gz -%{_infodir}/libffi.info.gz +%{_mandir}/man3/* +%{_infodir}/libffi.info* %changelog +* Sat Feb 22 2025 Funda Wang - 3.4.7-1 +- update to version 3.4.7 + * Tue Jan 14 2025 shixuantong - 3.4.6-2 - Type:bugfix - CVE:NA diff --git a/libffi.yaml b/libffi.yaml index 4230a09eb207ad42e62e40217d33da31baca9a6f..be201f0c4fad5a7890c3cf6d1d0ae161a0504da9 100644 --- a/libffi.yaml +++ b/libffi.yaml @@ -1,4 +1,4 @@ version_control: github src_repo: libffi/libffi tag_prefix: ^v -seperator: . +separator: .