From db942f8a1d66b8a65cad20360036f3576e6cb596 Mon Sep 17 00:00:00 2001 From: 17764591921 Date: Thu, 7 Jan 2021 18:26:01 +0800 Subject: [PATCH 1/2] modify --- ...PE_LONGDOUBLE-in-the-jump-table-in-w.patch | 65 +++++++++++++++++++ libffi.spec | 13 +++- 2 files changed, 75 insertions(+), 3 deletions(-) create mode 100644 0001-Don-t-use-FFI_TYPE_LONGDOUBLE-in-the-jump-table-in-w.patch diff --git a/0001-Don-t-use-FFI_TYPE_LONGDOUBLE-in-the-jump-table-in-w.patch b/0001-Don-t-use-FFI_TYPE_LONGDOUBLE-in-the-jump-table-in-w.patch new file mode 100644 index 0000000..4a547a2 --- /dev/null +++ b/0001-Don-t-use-FFI_TYPE_LONGDOUBLE-in-the-jump-table-in-w.patch @@ -0,0 +1,65 @@ +From d817d0daa312c58548d7a081aa876027ca103766 Mon Sep 17 00:00:00 2001 +From: Mike Hommey +Date: Tue, 10 Nov 2020 20:39:25 +0900 +Subject: [PATCH 1/5] Don't use FFI_TYPE_LONGDOUBLE in the jump table in + win64*.S (#580) + +It may have the same value as FFI_TYPE_DOUBLE per ffi.h, which +possibly can make things go wrong with .org/ORG. + +For instance, GCC complains about "Error: attempt to move .org +backwards" +--- + src/x86/win64.S | 5 +++-- + src/x86/win64_intel.S | 5 +++-- + 2 files changed, 6 insertions(+), 4 deletions(-) + +diff --git a/src/x86/win64.S b/src/x86/win64.S +index 57c0e65..8315e8b 100644 +--- a/src/x86/win64.S ++++ b/src/x86/win64.S +@@ -30,7 +30,7 @@ + #if defined(__clang__) || defined(__APPLE__) || (defined (__sun__) && defined(__svr4__)) + # define E(BASE, X) .balign 8 + #else +-# define E(BASE, X) .balign 8; .org BASE + X * 8 ++# define E(BASE, X) .balign 8; .org BASE + (X) * 8 + #endif + + .text +@@ -108,7 +108,8 @@ E(0b, FFI_TYPE_FLOAT) + E(0b, FFI_TYPE_DOUBLE) + movsd %xmm0, (%r8) + epilogue +-E(0b, FFI_TYPE_LONGDOUBLE) ++// FFI_TYPE_LONGDOUBLE may be FFI_TYPE_DOUBLE but we need a different value here. ++E(0b, FFI_TYPE_DOUBLE + 1) + call PLT(C(abort)) + E(0b, FFI_TYPE_UINT8) + movzbl %al, %eax +diff --git a/src/x86/win64_intel.S b/src/x86/win64_intel.S +index 7df78b3..970a4f9 100644 +--- a/src/x86/win64_intel.S ++++ b/src/x86/win64_intel.S +@@ -29,7 +29,7 @@ + #if defined(__clang__) || defined(__APPLE__) || (defined (__sun__) && defined(__svr4__)) + # define E(BASE, X) ALIGN 8 + #else +-# define E(BASE, X) ALIGN 8; ORG BASE + X * 8 ++# define E(BASE, X) ALIGN 8; ORG BASE + (X) * 8 + #endif + + .CODE +@@ -107,7 +107,8 @@ E(0b, FFI_TYPE_FLOAT) + E(0b, FFI_TYPE_DOUBLE) + movsd qword ptr[r8], xmm0; movsd %xmm0, (%r8) + epilogue +-E(0b, FFI_TYPE_LONGDOUBLE) ++// FFI_TYPE_LONGDOUBLE may be FFI_TYPE_DOUBLE but we need a different value here. ++E(0b, FFI_TYPE_DOUBLE + 1) + call PLT(C(abort)) + E(0b, FFI_TYPE_UINT8) + movzx eax, al ;movzbl %al, %eax +-- +1.8.3.1 + diff --git a/libffi.spec b/libffi.spec index 735a438..329a4a8 100644 --- a/libffi.spec +++ b/libffi.spec @@ -1,11 +1,12 @@ Name: libffi Version: 3.3 -Release: 10 +Release: 11 Summary: A Portable Foreign Function Interface Library License: MIT URL: http://sourceware.org/libffi Source0: ftp://sourceware.org/pub/libffi/%{name}-%{version}.tar.gz -Patch6000: e70bf987daa7b7b5df2de7579d5c51a888e8bf7d.patch +Patch6000: e70bf987daa7b7b5df2de7579d5c51a888e8bf7d.patch +Patch6001: 0001-Don-t-use-FFI_TYPE_LONGDOUBLE-in-the-jump-table-in-w.patch BuildRequires: gcc gdb @@ -92,6 +93,12 @@ fi %{_infodir}/libffi.info.gz %changelog +* Thu Jun 7 2021 zhengruoyu - 3.3-11 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC:Don't use FFI_TYPE_LONGDOUBLE in the jump table in win64*.S + * 20201125083007628982 patch-tracking 3.3-10 - append patch file of upstream repository from to @@ -156,4 +163,4 @@ fi - DESC:update to 3.2.1 * Mon Sep 09 2019 openEuler Buildteam - 3.1-19 -- Package init \ No newline at end of file +- Package init -- Gitee From 99af95578eac6f5a4e6f26a2efeb89e68aa390fc Mon Sep 17 00:00:00 2001 From: 17764591921 Date: Thu, 7 Jan 2021 19:01:26 +0800 Subject: [PATCH 2/2] modify --- libffi.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libffi.spec b/libffi.spec index 329a4a8..29feff7 100644 --- a/libffi.spec +++ b/libffi.spec @@ -49,7 +49,7 @@ BuildArch: noarch The help package contains man files. %prep -%autosetup -n %{name}-%{version} +%autosetup -n %{name}-%{version} -p1 %build %configure \ -- Gitee