From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 6A58B158042 for ; Wed, 16 Oct 2024 04:34:50 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 78618E077F; Wed, 16 Oct 2024 04:34:49 +0000 (UTC) Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 59733E077F for ; Wed, 16 Oct 2024 04:34:49 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 88BF2342FF5 for ; Wed, 16 Oct 2024 04:34:48 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id DD26AAE7 for ; Wed, 16 Oct 2024 04:34:46 +0000 (UTC) From: "Sam James" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" Message-ID: <1729053199.1074f63fc8c1341b01c09c32c4855beb1a9dac67.sam@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: dev-libs/libffi/, dev-libs/libffi/files/ X-VCS-Repository: repo/gentoo X-VCS-Files: dev-libs/libffi/files/libffi-3.4.6-tests.patch dev-libs/libffi/libffi-3.4.6-r2.ebuild X-VCS-Directories: dev-libs/libffi/files/ dev-libs/libffi/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: 1074f63fc8c1341b01c09c32c4855beb1a9dac67 X-VCS-Branch: master Date: Wed, 16 Oct 2024 04:34:46 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 04ccf433-ae9b-4bde-a0a4-080858cfaa16 X-Archives-Hash: 745e9fb4084ef05d47202fda9e06433e commit: 1074f63fc8c1341b01c09c32c4855beb1a9dac67 Author: Sam James gentoo org> AuthorDate: Wed Oct 16 04:33:19 2024 +0000 Commit: Sam James gentoo org> CommitDate: Wed Oct 16 04:33:19 2024 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1074f63f dev-libs/libffi: backport test fixes This fixes some issues w/ the test added in 6521e1f5d4cceb00f082def621d7e28b7788b7f5. Signed-off-by: Sam James gentoo.org> dev-libs/libffi/files/libffi-3.4.6-tests.patch | 104 +++++++++++++++++++++++++ dev-libs/libffi/libffi-3.4.6-r2.ebuild | 1 + 2 files changed, 105 insertions(+) diff --git a/dev-libs/libffi/files/libffi-3.4.6-tests.patch b/dev-libs/libffi/files/libffi-3.4.6-tests.patch new file mode 100644 index 000000000000..e24d01f4c028 --- /dev/null +++ b/dev-libs/libffi/files/libffi-3.4.6-tests.patch @@ -0,0 +1,104 @@ +https://github.com/libffi/libffi/commit/efb98a72d8b9bdb71b4f972efced073bee3b30fc +https://github.com/libffi/libffi/commit/92d384df196a099fde384f9178864dbfe8c6b0fc + +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 + +--- + testsuite/libffi.call/struct_int_float.c | 24 ++++++++++++------------ + 1 file changed, 12 insertions(+), 12 deletions(-) + +diff --git a/testsuite/libffi.call/struct_int_float.c b/testsuite/libffi.call/struct_int_float.c +index dab1d1fed..82685814c 100644 +--- a/testsuite/libffi.call/struct_int_float.c ++++ b/testsuite/libffi.call/struct_int_float.c +@@ -54,35 +54,35 @@ int main (void) + values[4] = &ts_arg[4]; + args[5] = &ts_type; + values[5] = &ts_arg[5]; +- ++ + /* Initialize the cif */ + CHECK(ffi_prep_cif(&cif, ABI_NUM, 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); + 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); ++ ++ CHECK(fabs(rfloat - 11.11) < FLT_EPSILON); + + exit(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 + +--- + 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 82685814..66ef6c45 100644 +--- a/testsuite/libffi.call/struct_int_float.c ++++ b/testsuite/libffi.call/struct_int_float.c +@@ -14,11 +14,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; + } +@@ -82,7 +82,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); + } diff --git a/dev-libs/libffi/libffi-3.4.6-r2.ebuild b/dev-libs/libffi/libffi-3.4.6-r2.ebuild index bf85a9e552da..2235dc0d702f 100644 --- a/dev-libs/libffi/libffi-3.4.6-r2.ebuild +++ b/dev-libs/libffi/libffi-3.4.6-r2.ebuild @@ -42,6 +42,7 @@ PATCHES=( "${FILESDIR}"/${P}-x86-sse.patch "${FILESDIR}"/${P}-arm64-cfi.patch "${FILESDIR}"/${P}-asan.patch + "${FILESDIR}"/${P}-tests.patch "${FILESDIR}"/${P}-regenerate-autotools.patch )