From 72425e3eb99b567eb7b84ee75c72d90ec8ec11a1 Mon Sep 17 00:00:00 2001 From: Carlos O'Donell Date: Dec 02 2020 19:06:28 +0000 Subject: Rebase to libffi-3.4. --- diff --git a/.gitignore b/.gitignore index 6d5a2a3..9f5bb88 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ libffi-3.0.9.tar.gz /libffi-3.0.11.tar.gz /libffi-3.0.13.tar.gz /libffi-3.1.tar.gz +/libffi-3.4.tar.gz diff --git a/libffi-3.1-aarch64-fix-exec-stack.patch b/libffi-3.1-aarch64-fix-exec-stack.patch deleted file mode 100644 index e20c920..0000000 --- a/libffi-3.1-aarch64-fix-exec-stack.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- 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 deleted file mode 100644 index 4c2a59f..0000000 --- a/libffi-3.1-fix-exec-stack.patch +++ /dev/null @@ -1,31 +0,0 @@ -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 deleted file mode 100644 index 5a3b7a5..0000000 --- a/libffi-3.1-fix-include-path.patch +++ /dev/null @@ -1,17 +0,0 @@ -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-3.1-libffi_tmpdir.patch b/libffi-3.1-libffi_tmpdir.patch deleted file mode 100644 index 960c328..0000000 --- a/libffi-3.1-libffi_tmpdir.patch +++ /dev/null @@ -1,17 +0,0 @@ -Most temp file directories need to be hardened against execution, but -libffi needs execute privileges. Add a libffi-specific temp directory -that can be set up by sysadmins as needed with suitable permissions. -This both ensures that libffi will have a valid temp directory to use -as well as preventing attempts to access other directories. - -diff -rup a/src/closures.c b/src/closures.c ---- a/src/closures.c 2014-05-11 09:54:19.000000000 -0400 -+++ b/src/closures.c 2020-04-29 20:50:00.454853909 -0400 -@@ -362,6 +362,7 @@ static struct - const char *arg; - int repeat; - } open_temp_exec_file_opts[] = { -+ { open_temp_exec_file_env, "LIBFFI_TMPDIR", 0 }, - { open_temp_exec_file_env, "TMPDIR", 0 }, - { open_temp_exec_file_dir, "/tmp", 0 }, - { open_temp_exec_file_dir, "/var/tmp", 0 }, diff --git a/libffi-aarch64-rhbz1174037.patch b/libffi-aarch64-rhbz1174037.patch deleted file mode 100644 index dbf6308..0000000 --- a/libffi-aarch64-rhbz1174037.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- 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/libffi.spec b/libffi.spec index 0328b12..3871721 100644 --- a/libffi.spec +++ b/libffi.spec @@ -1,10 +1,10 @@ %bcond_with bootstrap -%global multilib_arches %{ix86} ppc ppc64 ppc64p7 s390 s390x x86_64 +%global multilib_arches %{ix86} x86_64 Name: libffi -Version: 3.1 -Release: 27%{?dist} +Version: 3.4 +Release: 1%{?dist} Summary: A portable foreign function interface library License: MIT URL: http://sourceware.org/libffi @@ -12,11 +12,6 @@ URL: http://sourceware.org/libffi Source0: ftp://sourceware.org/pub/libffi/libffi-%{version}.tar.gz Source1: ffi-multilib.h Source2: ffitarget-multilib.h -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 -Patch4: libffi-3.1-libffi_tmpdir.patch BuildRequires: gcc %if %{without bootstrap} @@ -64,11 +59,11 @@ developing applications that use %{name}. %prep %setup -q -%patch0 -p1 -b .fixpath -%patch1 -p1 -b .execstack -%patch2 -p1 -b .aarch64 -%patch3 -p1 -b .aarch64execstack -%patch4 -p1 -b .libffitmpdir +#%patch0 -p1 -b .fixpath +#%patch1 -p1 -b .execstack +#%patch2 -p1 -b .aarch64 +#%patch3 -p1 -b .aarch64execstack +#%patch4 -p1 -b .libffitmpdir %build %configure --disable-static @@ -96,21 +91,17 @@ mkdir -p $RPM_BUILD_ROOT%{_includedir} # can have both a 32- and 64-bit version of the library, and they each need # their own correct-but-different versions of the headers to be usable. for i in ffi ffitarget; do - mv $RPM_BUILD_ROOT%{_libdir}/libffi-%{version}/include/$i.h $RPM_BUILD_ROOT%{_includedir}/$i-${basearch}.h + mv $RPM_BUILD_ROOT%{_includedir}/$i.h $RPM_BUILD_ROOT%{_includedir}/$i-${basearch}.h done install -m644 %{SOURCE1} $RPM_BUILD_ROOT%{_includedir}/ffi.h install -m644 %{SOURCE2} $RPM_BUILD_ROOT%{_includedir}/ffitarget.h -%else -mv $RPM_BUILD_ROOT%{_libdir}/libffi-%{version}/include/{ffi,ffitarget}.h $RPM_BUILD_ROOT%{_includedir} %endif -rm -rf $RPM_BUILD_ROOT%{_libdir}/libffi-%{version} - %ldconfig_scriptlets %files %license LICENSE -%doc README +%doc README.md %{_libdir}/*.so.* %files devel diff --git a/sources b/sources index f24e41b..2a2fd3c 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -f5898b29bbfd70502831a212d9249d10 libffi-3.1.tar.gz +SHA512 (libffi-3.4.tar.gz) = 07729ae451f4983becc4a9d00234e1445bc83b5efbe9f632d4fca380b46eaecb454058396fc2b799c472379b0e8deff184b48c6e4ee9f2c6e178319000072e1a