Compare commits
11 Commits
4edbe78de8
...
4808c8bb1f
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4808c8bb1f | ||
|
|
ad8bbdbd7e | ||
|
|
2246c9267e | ||
|
|
602768b157 | ||
|
|
9fe621b2cb | ||
|
|
00b681e956 | ||
|
|
03bce9f2f4 | ||
|
|
f871fd86b4 | ||
|
|
03f50aeefa | ||
|
|
a1d61868ab | ||
|
|
5acd9d4efd |
125
Add-gcc-bug-tests-back.patch
Normal file
125
Add-gcc-bug-tests-back.patch
Normal file
@ -0,0 +1,125 @@
|
||||
From 2e90bb5577ea1fe3bc1716954e790999bc3549f7 Mon Sep 17 00:00:00 2001
|
||||
From: Anthony Green <green@moxielogic.com>
|
||||
Date: Sun, 7 Jun 2020 14:31:06 -0400
|
||||
Subject: [PATCH] Add gcc bug tests back
|
||||
|
||||
---
|
||||
testsuite/lib/libffi.exp | 24 ++++++++++++++++++++++--
|
||||
testsuite/libffi.bhaible/test-call.c | 8 ++++----
|
||||
testsuite/libffi.bhaible/test-callback.c | 4 ++--
|
||||
3 files changed, 28 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/testsuite/lib/libffi.exp b/testsuite/lib/libffi.exp
|
||||
index c02adf9..d3c17db 100644
|
||||
--- a/testsuite/lib/libffi.exp
|
||||
+++ b/testsuite/lib/libffi.exp
|
||||
@@ -24,6 +24,11 @@ load_lib libgloss.exp
|
||||
load_gcc_lib target-libpath.exp
|
||||
load_gcc_lib wrapper.exp
|
||||
|
||||
+proc check_effective_target_gccbug { } {
|
||||
+ global has_gccbug
|
||||
+ return $has_gccbug
|
||||
+}
|
||||
+
|
||||
# Return 1 if the target matches the effective target 'arg', 0 otherwise.
|
||||
# This can be used with any check_* proc that takes no argument and
|
||||
# returns only 1 or 0. It could be used with check_* procs that take
|
||||
@@ -477,6 +482,7 @@ proc libffi-dg-runtest { testcases default-extra-flags } {
|
||||
|
||||
proc run-many-tests { testcases extra_flags } {
|
||||
global compiler_vendor
|
||||
+ global has_gccbug
|
||||
global env
|
||||
switch $compiler_vendor {
|
||||
"clang" {
|
||||
@@ -538,8 +544,22 @@ proc run-many-tests { testcases extra_flags } {
|
||||
foreach opt $optimizations {
|
||||
foreach abi $abis {
|
||||
set options [concat $common $opt $abi]
|
||||
- verbose "Testing $testname, $options" 1
|
||||
- dg-test $test $options ""
|
||||
+ set has_gccbug false;
|
||||
+ if { [string match $compiler_vendor "gnu"] \
|
||||
+ && [string match "*MSABI*" $abi] \
|
||||
+ && ( ( [string match "*DGTEST=57 *" $common] \
|
||||
+ && [string match "*call.c*" $testname] ) \
|
||||
+ || ( [string match "*DGTEST=54 *" $common] \
|
||||
+ && [string match "*callback*" $testname] ) \
|
||||
+ || [string match "*DGTEST=55 *" $common] \
|
||||
+ || [string match "*DGTEST=56 *" $common] ) } then {
|
||||
+ if [libffi_feature_test "#if (__GNUC__ < 9) || ((__GNUC__ == 9) && (__GNUC_MINOR__ < 3))"] {
|
||||
+ set has_gccbug true;
|
||||
+ }
|
||||
+ }
|
||||
+ verbose "Testing $testname, $options" 1
|
||||
+ verbose "has_gccbug = $has_gccbug" 1
|
||||
+ dg-test $test $options ""
|
||||
}
|
||||
}
|
||||
}
|
||||
diff --git a/testsuite/libffi.bhaible/test-call.c b/testsuite/libffi.bhaible/test-call.c
|
||||
index 01a8a21..cf9219e 100644
|
||||
--- a/testsuite/libffi.bhaible/test-call.c
|
||||
+++ b/testsuite/libffi.bhaible/test-call.c
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
- the Free Software Foundation; either version 2 of the License, or
|
||||
+ the Free Software Foundation; either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
@@ -16,7 +16,7 @@
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
**/
|
||||
|
||||
-/* { dg-do run } */
|
||||
+/* { dg-do run { xfail gccbug } } */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
@@ -1220,7 +1220,7 @@ void
|
||||
}
|
||||
fprintf(out,"->{%g}\n",Fr.x);
|
||||
fflush(out);
|
||||
-#endif
|
||||
+#endif
|
||||
#if (!defined(DGTEST)) || DGTEST == 56
|
||||
Dr = D_fDd(f1,D2,d3);
|
||||
fprintf(out,"->{%g}\n",Dr.x);
|
||||
@@ -1243,7 +1243,7 @@ void
|
||||
}
|
||||
fprintf(out,"->{%g}\n",Dr.x);
|
||||
fflush(out);
|
||||
-#endif
|
||||
+#endif
|
||||
#if (!defined(DGTEST)) || DGTEST == 57
|
||||
Dr = D_Dfd(D1,f2,d3);
|
||||
fprintf(out,"->{%g}\n",Dr.x);
|
||||
diff --git a/testsuite/libffi.bhaible/test-callback.c b/testsuite/libffi.bhaible/test-callback.c
|
||||
index c2633c7..0b16799 100644
|
||||
--- a/testsuite/libffi.bhaible/test-callback.c
|
||||
+++ b/testsuite/libffi.bhaible/test-callback.c
|
||||
@@ -4,7 +4,7 @@
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
- * the Free Software Foundation; either version 2 of the License, or
|
||||
+ * the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
@@ -16,7 +16,7 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
-/* { dg-do run } */
|
||||
+/* { dg-do run { xfail gccbug } } */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
--
|
||||
1.8.3.1
|
||||
|
||||
29
backport-Fix-signed-vs-unsigned-comparison.patch
Normal file
29
backport-Fix-signed-vs-unsigned-comparison.patch
Normal file
@ -0,0 +1,29 @@
|
||||
From 1cd845bffbe55a63ee985e7bf161a52d763f9c36 Mon Sep 17 00:00:00 2001
|
||||
From: serge-sans-paille <serge.guelton@telecom-bretagne.eu>
|
||||
Date: Sat, 22 Apr 2023 02:16:04 +0800
|
||||
Subject: [PATCH] Fix signed vs unsigned comparison (#765)
|
||||
|
||||
As reported by -Wsign-compare. In the case of getting the result of
|
||||
comparing the result of sysconf (_SC_PAGESIZE) to other value, this also
|
||||
correctly handles edge cases where the above fails and returns -1.
|
||||
|
||||
Signed-off-by: Wang Zhang <silver_code@hust.edu.cn>
|
||||
---
|
||||
src/closures.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/closures.c b/src/closures.c
|
||||
index 5120021..c02e818 100644
|
||||
--- a/src/closures.c
|
||||
+++ b/src/closures.c
|
||||
@@ -734,7 +734,7 @@ open_temp_exec_file (void)
|
||||
static int
|
||||
allocate_space (int fd, off_t offset, off_t len)
|
||||
{
|
||||
- static size_t page_size;
|
||||
+ static long page_size;
|
||||
|
||||
/* Obtain system page size. */
|
||||
if (!page_size)
|
||||
--
|
||||
2.34.1
|
||||
28
fix-AARCH64EB-support.patch
Normal file
28
fix-AARCH64EB-support.patch
Normal file
@ -0,0 +1,28 @@
|
||||
From 1c44db6dc55de3d3414d6a0da0c7f4df7a65320d Mon Sep 17 00:00:00 2001
|
||||
From: Xin Shi <shixin21@huawei.com>
|
||||
Date: Fri, 26 May 2023 12:07:10 +0800
|
||||
Subject: [PATCH] fix AARCH64EB support
|
||||
|
||||
Signed-off-by: Xin Shi <shixin21@huawei.com>
|
||||
---
|
||||
src/aarch64/ffi.c | 4 ++++
|
||||
1 file changed, 4 insertions(+)
|
||||
|
||||
diff --git a/src/aarch64/ffi.c b/src/aarch64/ffi.c
|
||||
index 1ebf43c..a8820a3 100644
|
||||
--- a/src/aarch64/ffi.c
|
||||
+++ b/src/aarch64/ffi.c
|
||||
@@ -690,6 +690,10 @@ ffi_call_int (ffi_cif *cif, void (*fn)(void), void *orig_rvalue,
|
||||
}
|
||||
state.nsrn = N_V_ARG_REG;
|
||||
dest = allocate_to_stack (&state, stack, ty->alignment, s);
|
||||
+#ifdef __AARCH64EB__
|
||||
+ if (t == FFI_TYPE_FLOAT)
|
||||
+ dest = dest +4;
|
||||
+#endif
|
||||
#ifdef _M_ARM64 /* for handling armasm calling convention */
|
||||
}
|
||||
#endif /* for handling armasm calling convention */
|
||||
--
|
||||
2.27.0
|
||||
|
||||
41
libffi.spec
41
libffi.spec
@ -1,12 +1,17 @@
|
||||
Name: libffi
|
||||
Version: 3.3
|
||||
Release: 6
|
||||
Release: 11
|
||||
Summary: A Portable Foreign Function Interface Library
|
||||
License: MIT
|
||||
URL: http://sourceware.org/libff
|
||||
Source0: ftp://sourceware.org/pub/libffi/%{name}-%{version}.tar.gz
|
||||
|
||||
BuildRequires: gcc
|
||||
Patch0: Add-gcc-bug-tests-back.patch
|
||||
Patch1: backport-Fix-signed-vs-unsigned-comparison.patch
|
||||
Patch2: fix-AARCH64EB-support.patch
|
||||
|
||||
BuildRequires: gcc gcc-c++ dejagnu
|
||||
BuildRequires: make
|
||||
|
||||
%description
|
||||
Compilers for high level languages generate code that follows certain conventions. These
|
||||
@ -47,7 +52,7 @@ BuildArch: noarch
|
||||
The help package contains man files.
|
||||
|
||||
%prep
|
||||
%autosetup -n %{name}-%{version}
|
||||
%autosetup -n %{name}-%{version} -p1
|
||||
|
||||
%build
|
||||
%configure --disable-static
|
||||
@ -86,6 +91,36 @@ fi
|
||||
%{_infodir}/libffi.info.gz
|
||||
|
||||
%changelog
|
||||
* Fri May 26 2023 shixin <shixin21@huawei.com> - 3.3-11
|
||||
- Type:bugfix
|
||||
- ID:NA
|
||||
- SUG:NA
|
||||
- DESC:Fix AARCH64EB support
|
||||
|
||||
* Sat Apr 22 2023 zhangwang<silver_code@hust.edu.cn> - 3.3-10
|
||||
- Type:bugfix
|
||||
- ID:NA
|
||||
- SUG:NA
|
||||
- DESC:backport patches from upstream
|
||||
|
||||
* Fri Dec 16 2022 wangjiang <wangjiang37@h-partners.com> - 3.3-9
|
||||
- Type:bugfix
|
||||
- ID:NA
|
||||
- SUG:NA
|
||||
- DESC:add BuildRequires make
|
||||
|
||||
* Mon Dec 6 2021 panxiaohe<panxiaohe@huawei.com> - 3.3-8
|
||||
- Type:enhancement
|
||||
- ID:NA
|
||||
- SUG:NA
|
||||
- DESC:enable test suite execution
|
||||
|
||||
* Sat Mar 21 2020 chengquan<chengquan3@huawei.com> - 3.3-7
|
||||
- Type:enhancement
|
||||
- ID:NA
|
||||
- SUG:NA
|
||||
- DESC:add necessary BuildRequires
|
||||
|
||||
* Mon Jan 20 2020 chengquan<chengquan3@huawei.com> - 3.3-6
|
||||
- Type:enhancement
|
||||
- ID:NA
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user