From f6214e6a626505becc39a48ec1cb6d84f4a1a64c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= Date: Wed, 14 Aug 2019 10:20:05 +0200 Subject: [PATCH] Add the same patches from its native counter part MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Resolves: rhbz#1740764 Signed-off-by: Fabiano FidĂȘncio --- libffi-3.1-aarch64-fix-exec-stack.patch | 11 +++++++++ libffi-3.1-fix-exec-stack.patch | 31 +++++++++++++++++++++++++ libffi-3.1-fix-include-path.patch | 17 ++++++++++++++ libffi-aarch64-rhbz1174037.patch | 11 +++++++++ mingw-libffi.spec | 15 ++++++++++-- 5 files changed, 83 insertions(+), 2 deletions(-) create mode 100644 libffi-3.1-aarch64-fix-exec-stack.patch create mode 100644 libffi-3.1-fix-exec-stack.patch create mode 100644 libffi-3.1-fix-include-path.patch create mode 100644 libffi-aarch64-rhbz1174037.patch diff --git a/libffi-3.1-aarch64-fix-exec-stack.patch b/libffi-3.1-aarch64-fix-exec-stack.patch new file mode 100644 index 0000000..e20c920 --- /dev/null +++ b/libffi-3.1-aarch64-fix-exec-stack.patch @@ -0,0 +1,11 @@ +--- a/src/aarch64/sysv.S ++++ b/src/aarch64/sysv.S +@@ -396,3 +396,8 @@ + #ifdef __ELF__ + .size CNAME(ffi_closure_SYSV), .-CNAME(ffi_closure_SYSV) + #endif ++ ++#if defined __ELF__ && defined __linux__ ++ .section .note.GNU-stack,"",%progbits ++#endif ++ diff --git a/libffi-3.1-fix-exec-stack.patch b/libffi-3.1-fix-exec-stack.patch new file mode 100644 index 0000000..4c2a59f --- /dev/null +++ b/libffi-3.1-fix-exec-stack.patch @@ -0,0 +1,31 @@ +From 978c9540154d320525488db1b7049277122f736d Mon Sep 17 00:00:00 2001 +From: Samuli Suominen +Date: Sat, 31 May 2014 08:53:10 -0400 +Subject: [PATCH] Add missing GNU stack markings in win32.S + +--- + src/x86/win32.S | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/src/x86/win32.S b/src/x86/win32.S +index daf0e79..e42baf2 100644 +--- a/src/x86/win32.S ++++ b/src/x86/win32.S +@@ -1,5 +1,6 @@ + /* ----------------------------------------------------------------------- +- win32.S - Copyright (c) 1996, 1998, 2001, 2002, 2009 Red Hat, Inc. ++ win32.S - Copyright (c) 2014 Anthony Green ++ Copyright (c) 1996, 1998, 2001, 2002, 2009 Red Hat, Inc. + Copyright (c) 2001 John Beniton + Copyright (c) 2002 Ranjit Mathew + Copyright (c) 2009 Daniel Witte +@@ -1304,3 +1305,6 @@ L_ffi_closure_SYSV_inner$stub: + + #endif /* !_MSC_VER */ + ++#if defined __ELF__ && defined __linux__ ++ .section .note.GNU-stack,"",@progbits ++#endif +-- +1.9.3 + diff --git a/libffi-3.1-fix-include-path.patch b/libffi-3.1-fix-include-path.patch new file mode 100644 index 0000000..5a3b7a5 --- /dev/null +++ b/libffi-3.1-fix-include-path.patch @@ -0,0 +1,17 @@ +diff -up libffi-3.1/libffi.pc.in.fixpath libffi-3.1/libffi.pc.in +--- libffi-3.1/libffi.pc.in.fixpath 2014-04-25 19:45:13.000000000 +0200 ++++ libffi-3.1/libffi.pc.in 2014-06-12 12:06:06.000000000 +0200 +@@ -1,11 +1,10 @@ + prefix=@prefix@ + exec_prefix=@exec_prefix@ + libdir=@libdir@ +-toolexeclibdir=@toolexeclibdir@ +-includedir=${libdir}/@PACKAGE_NAME@-@PACKAGE_VERSION@/include ++includedir=@includedir@ + + Name: @PACKAGE_NAME@ + Description: Library supporting Foreign Function Interfaces + Version: @PACKAGE_VERSION@ +-Libs: -L${toolexeclibdir} -lffi ++Libs: -L${libdir} -lffi + Cflags: -I${includedir} diff --git a/libffi-aarch64-rhbz1174037.patch b/libffi-aarch64-rhbz1174037.patch new file mode 100644 index 0000000..dbf6308 --- /dev/null +++ b/libffi-aarch64-rhbz1174037.patch @@ -0,0 +1,11 @@ +--- libffi-3.1/src/aarch64/ffi.c.orig 2014-04-25 18:45:13.000000000 +0100 ++++ libffi-3.1/src/aarch64/ffi.c 2015-01-15 02:36:56.314906455 +0000 +@@ -728,7 +728,7 @@ + state.ngrn = N_X_ARG_REG; + + memcpy (allocate_to_stack (&state, stack, ty->alignment, +- ty->size), ecif->avalue + i, ty->size); ++ ty->size), ecif->avalue[i], ty->size); + } + break; + diff --git a/mingw-libffi.spec b/mingw-libffi.spec index 31d8bb2..ab68dcf 100644 --- a/mingw-libffi.spec +++ b/mingw-libffi.spec @@ -2,13 +2,18 @@ Name: mingw-libffi Version: 3.1 -Release: 6%{?dist} +Release: 7%{?dist} Summary: A portable foreign function interface library for MinGW License: BSD URL: http://sourceware.org/libffi Source0: ftp://sourceware.org/pub/libffi/libffi-%{version}.tar.gz +Patch0: libffi-3.1-fix-include-path.patch +Patch1: libffi-3.1-fix-exec-stack.patch +Patch2: libffi-aarch64-rhbz1174037.patch +Patch3: libffi-3.1-aarch64-fix-exec-stack.patch + BuildArch: noarch BuildRequires: mingw32-filesystem >= 95 @@ -59,7 +64,10 @@ Foreign function interface static library for MinGW. %prep %setup -q -n libffi-%{version} - +%patch0 -p1 -b .fixpath +%patch1 -p1 -b .execstack +%patch2 -p1 -b .aarch64 +%patch3 -p1 -b .aarch64execstack %build %mingw_configure --enable-shared @@ -102,6 +110,9 @@ find $RPM_BUILD_ROOT -name "*.la" -delete %changelog +* Wed Aug 14 2019 Fabiano FidĂȘncio - 3.1-7 +- Add the same patches from its native counter part, rhbz#1740764 + * Thu Jul 25 2019 Fedora Release Engineering - 3.1-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild