From ad8bbdbd7e94781fb475a58e068452382c3574a3 Mon Sep 17 00:00:00 2001 From: Xin Shi Date: Fri, 26 May 2023 12:08:14 +0800 Subject: [PATCH] fix AARCH64EB support Signed-off-by: Xin Shi --- fix-AARCH64EB-support.patch | 28 ++++++++++++++++++++++++++++ libffi.spec | 9 ++++++++- 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 fix-AARCH64EB-support.patch diff --git a/fix-AARCH64EB-support.patch b/fix-AARCH64EB-support.patch new file mode 100644 index 0000000..d3fc24a --- /dev/null +++ b/fix-AARCH64EB-support.patch @@ -0,0 +1,28 @@ +From 1c44db6dc55de3d3414d6a0da0c7f4df7a65320d Mon Sep 17 00:00:00 2001 +From: Xin Shi +Date: Fri, 26 May 2023 12:07:10 +0800 +Subject: [PATCH] fix AARCH64EB support + +Signed-off-by: Xin Shi +--- + 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 + diff --git a/libffi.spec b/libffi.spec index b3b0dbc..4888b3f 100644 --- a/libffi.spec +++ b/libffi.spec @@ -1,6 +1,6 @@ Name: libffi Version: 3.3 -Release: 10 +Release: 11 Summary: A Portable Foreign Function Interface Library License: MIT URL: http://sourceware.org/libff @@ -8,6 +8,7 @@ Source0: ftp://sourceware.org/pub/libffi/%{name}-%{version}.tar.gz 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 @@ -90,6 +91,12 @@ fi %{_infodir}/libffi.info.gz %changelog +* Fri May 26 2023 shixin - 3.3-11 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC:Fix AARCH64EB support + * Sat Apr 22 2023 zhangwang - 3.3-10 - Type:bugfix - ID:NA -- Gitee