diff --git a/.gitignore b/.gitignore index 07af012..0136588 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /ffcall-20120424cvs.tar.xz /ffcall-1.12.tar.gz +/ffcall-1.13.tar.xz diff --git a/ffcall-arm.patch b/ffcall-arm.patch deleted file mode 100644 index 8e8509b..0000000 --- a/ffcall-arm.patch +++ /dev/null @@ -1,93 +0,0 @@ ---- ./callback/trampoline_r/cache-armel.c.orig 2009-04-27 10:44:13.000000000 -0600 -+++ ./callback/trampoline_r/cache-armel.c 2013-09-06 11:00:00.000000000 -0600 -@@ -12,8 +12,9 @@ - - void __TR_clear_cache (char *first_addr, char *last_addr) - { -- register unsigned long _beg __asm ("a1") = first_addr; -- register unsigned long _end __asm ("a2") = last_addr; -+ register unsigned long _beg __asm ("a1") = (unsigned long) first_addr; -+ register unsigned long _end __asm ("a2") = (unsigned long) last_addr; - register unsigned long _flg __asm ("a3") = 0; -- __asm __volatile__ ("swi 0x9f0002" : : "r" (_beg), "r" (_end), "r" (_flg)); -+ register unsigned long _sys __asm ("r7") = __ARM_NR_cacheflush; -+ __asm __volatile__ ("swi 0x0" : "=r" (_beg) : "0" (_beg), "r" (_end), "r" (_flg), "r" (_sys)); - } ---- ./callback/trampoline_r/cache-armel.s.orig 2009-04-27 10:44:13.000000000 -0600 -+++ ./callback/trampoline_r/cache-armel.s 2013-09-06 13:00:00.000000000 -0600 -@@ -1,5 +1,5 @@ -- .cpu arm10tdmi -- .fpu softvfp -+ .arch armv7-a -+ .fpu vfpv3-d16 - .file "cache-armel.c" - .text - .align 2 -@@ -9,10 +9,13 @@ __TR_clear_cache: - @ args = 0, pretend = 0, frame = 0 - @ frame_needed = 0, uses_anonymous_args = 0 - @ link register save eliminated. -- @ lr needed for prologue -+ str r7, [sp, #-4]! - mov r2, #0 -+ mov r7, #2 -+ movt r7, 15 - #APP -- swi 0x9f0002 -+ swi 0x0 -+ ldr r7, [sp], #4 - bx lr - .size __TR_clear_cache, .-__TR_clear_cache -- .ident "GCC: (GNU) 3.4.4 (release) (CodeSourcery ARM 2005q3-2)" -+ .ident "GCC: (GNU) 4.8.1 20130829 (Red Hat 4.8.1-7)" ---- ./trampoline/cache-armel.c.orig 2009-04-27 10:44:14.000000000 -0600 -+++ ./trampoline/cache-armel.c 2013-09-06 11:00:00.000000000 -0600 -@@ -12,8 +12,9 @@ - - void __TR_clear_cache (char *first_addr, char *last_addr) - { -- register unsigned long _beg __asm ("a1") = first_addr; -- register unsigned long _end __asm ("a2") = last_addr; -+ register unsigned long _beg __asm ("a1") = (unsigned long) first_addr; -+ register unsigned long _end __asm ("a2") = (unsigned long) last_addr; - register unsigned long _flg __asm ("a3") = 0; -- __asm __volatile__ ("swi 0x9f0002" : : "r" (_beg), "r" (_end), "r" (_flg)); -+ register unsigned long _sys __asm ("r7") = __ARM_NR_cacheflush; -+ __asm __volatile__ ("swi 0x0" : "=r" (_beg) : "0" (_beg), "r" (_end), "r" (_flg), "r" (_sys)); - } ---- ./trampoline/cache-armel.s.orig 2009-04-27 10:44:14.000000000 -0600 -+++ ./trampoline/cache-armel.s 2013-09-06 13:00:00.000000000 -0600 -@@ -1,24 +1,21 @@ -- .cpu arm10tdmi -- .fpu softvfp -+ .arch armv7-a -+ .fpu vfpv3-d16 - .file "cache-armel.c" - .text - .align 2 - .global __TR_clear_cache - .type __TR_clear_cache, %function - __TR_clear_cache: -- @ args = 0, pretend = 0, frame = 8 -+ @ args = 0, pretend = 0, frame = 0 - @ frame_needed = 0, uses_anonymous_args = 0 - @ link register save eliminated. -- sub sp, sp, #8 -- @ lr needed for prologue -- str r0, [sp, #4] -- str r1, [sp, #0] -- ldr r0, [sp, #4] -- ldr r1, [sp, #0] -+ str r7, [sp, #-4]! - mov r2, #0 -+ mov r7, #2 -+ movt r7, 15 - #APP -- swi 0x9f0002 -- add sp, sp, #8 -+ swi 0x0 -+ ldr r7, [sp], #4 - bx lr - .size __TR_clear_cache, .-__TR_clear_cache -- .ident "GCC: (GNU) 3.4.4 (release) (CodeSourcery ARM 2005q3-2)" -+ .ident "GCC: (GNU) 4.8.1 20130829 (Red Hat 4.8.1-7)" diff --git a/ffcall-trampoline.patch b/ffcall-trampoline.patch deleted file mode 100644 index d014f78..0000000 --- a/ffcall-trampoline.patch +++ /dev/null @@ -1,42 +0,0 @@ ---- ./callback/trampoline_r/trampoline.c.orig 2009-04-27 09:24:05.000000000 -0600 -+++ ./callback/trampoline_r/trampoline.c 2012-01-10 12:03:02.752466354 -0700 -@@ -67,10 +67,6 @@ extern void (*tramp_r) (); /* trampoline - - #ifndef CODE_EXECUTABLE - /* How do we make the trampoline's code executable? */ --#if defined(HAVE_MACH_VM) || defined(__convex__) || defined(HAVE_WORKING_MPROTECT) || defined(HAVE_SYS_M88KBCS_H) --/* mprotect() [or equivalent] the malloc'ed area. */ --#define EXECUTABLE_VIA_MPROTECT --#else - #ifdef HAVE_MMAP - /* Use an mmap'ed page. */ - #define EXECUTABLE_VIA_MMAP -@@ -90,7 +86,6 @@ extern void (*tramp_r) (); /* trampoline - #endif - #endif - #endif --#endif - - #include /* declares fprintf() */ - ---- ./trampoline/trampoline.c.orig 2008-09-26 14:19:37.000000000 -0600 -+++ ./trampoline/trampoline.c 2012-01-10 12:02:33.027731322 -0700 -@@ -67,10 +67,6 @@ extern void (*tramp) (); /* trampoline p - - #ifndef CODE_EXECUTABLE - /* How do we make the trampoline's code executable? */ --#if defined(HAVE_MACH_VM) || defined(__convex__) || defined(HAVE_WORKING_MPROTECT) || defined(HAVE_SYS_M88KBCS_H) --/* mprotect() [or equivalent] the malloc'ed area. */ --#define EXECUTABLE_VIA_MPROTECT --#else - #ifdef HAVE_MMAP - /* Use an mmap'ed page. */ - #define EXECUTABLE_VIA_MMAP -@@ -90,7 +86,6 @@ extern void (*tramp) (); /* trampoline p - #endif - #endif - #endif --#endif - - #include /* declares fprintf() */ - diff --git a/ffcall.spec b/ffcall.spec index 3f3dee0..472a87b 100644 --- a/ffcall.spec +++ b/ffcall.spec @@ -4,24 +4,27 @@ # This package uses assembly to do its work. This is the entire list of # supported architectures understood by RPM, even those not currently supported # by Fedora. RPM hasn't heard about line continuations, hence the mess. -%global ffcall_arches %{ix86} x86_64 amd64 %{alpha} armv3l armv4b armv4l armv4tl armv5tel armv5tejl armv6l armv7l armv7hl armv7hnl parisc hppa1.0 hppa1.1 hppa1.2 hppa2.0 ia64 m68k mips mipsel ppc ppc8260 ppc8560 ppc32dy4 ppciseries ppcpseries %{power64} s390 s390x %{sparc} +%global ffcall_arches %{ix86} x86_64 amd64 %{alpha} %{arm} parisc hppa1.0 hppa1.1 hppa1.2 hppa2.0 ia64 m68k %{mips32} ppc ppc8260 ppc8560 ppc32dy4 ppciseries ppcpseries %{power64} s390 s390x %{sparc} Name: ffcall -Version: 1.12 -Release: 3%{?dist} +Version: 1.13 +Release: 1%{?dist} Summary: Libraries for foreign function call interfaces License: GPLv2+ URL: http://www.gnu.org/software/libffcall/ -Source0: https://github.com/libffcall/libffcall/archive/%{name}-%{version}.tar.gz -# This patch will not be sent upstream. It removes the possibility of using -# mprotect() to make memory executable, as that runs afoul of SELinux. -Patch0: %{name}-trampoline.patch -# Upstream is dead, so this patch will not be sent. Update some uses of OABI -# on ARM to their EABI equivalents. -Patch1: %{name}-arm.patch +# Upstream no longer provides tarballs. To generate the tarball: +# git clone git://git.savannah.gnu.org/libffcall.git +# cd libffcall +# git reset --hard 0455e86c9c24f7bc2bd7ed036b5815223254a965 +# rm -fr .git* +# cd .. +# tar cJf ffcall-%%{version}.tar.xz libfcall +Source0: %{name}-%{version}.tar.xz BuildRequires: gcc +BuildRequires: gnulib-devel +BuildRequires: libtool Provides: %{name}-static = %{version}-%{release} @@ -39,16 +42,71 @@ packages are: %prep -%setup -q -n libffcall-%{name}-%{version} -%patch0 -%patch1 +%setup -q -n libffcall -# Remove prebuilt object files -find . -name \*.o | xargs rm -f +# Preserve timestamps +for fil in $(find . -name Makefile\*); do + sed -i 's/^[[:blank:]]*cp[[:blank:]]/&-p /' $fil +done + +# Upstream does not ship a configure script, and autogen.sh wants to download +make -f Makefile.maint \ + gnulib-clean glm4/gnulib-cache.m4 gnulib-imported-files \ + GNULIB_TOOL="%{_bindir}/gnulib-tool" +make -C callback/vacall_r -f Makefile.maint copied-files +make -C callback/trampoline_r -f Makefile.maint copied-files +make -f Makefile.maint totally-clean +autoreconf -fi -I $PWD/m4 -I $PWD/glm4 + +# Throw away OS X code that causes a syntax error on Linux +sed -i '\%/EH_FRAME_SECTION%,/EOF/d;/Likewise/aEOF' common/asm-x86_64.sh + +# On ARM, the script throws away .file directives, but not .loc directives, +# leading to a compilation error. Keep both for better debuginfo. +sed -i '/\.file/d' common/asm-arm.sh + +# We are not AIX. We are Linux. +sed -i 's, $(srcdir)/avcall-powerpc64-aix\.s,,' avcall/Makefile.in +sed -i 's, $(srcdir)/vacall-powerpc64-aix\.s,,' vacall/Makefile.in +sed -i 's, $(srcdir)/vacall-powerpc64-aix\.s,,' callback/vacall_r/Makefile.in + +# Endianness comparisons always fail, but we don't care because we only want to +# build for the host architecture. +sed -i '/^\([[:blank:]]*\)cmp[[:blank:]]/d' avcall/Makefile.devel \ + vacall/Makefile.devel callback/vacall_r/Makefile.devel + +# We are not really cross-compiling, even though the Makefile thinks so +cat > cross << EOF +#!/bin/sh +shift 2 +if [ "\$1" = "-V" ]; then + shift 2 +fi +gcc $CFLAGS \$@ +EOF +chmod a+x cross %build -export CFLAGS="$RPM_OPT_FLAGS -fPIC -DMAP_VARIABLE=2" +# Use our fake cross-compilation script +PATH=$PATH:$PWD +export CFLAGS="$RPM_OPT_FLAGS -fPIC" +%ifarch %{arm} +CFLAGS="$CFLAGS -fno-strict-aliasing" +%endif %configure + +# Find out what ffcall thinks the arch name is +FFARCH=$(sed -n "s/HOST_CPU_C_ABI='\(.*\)'/\1/p" config.log) + +# Construct files needed for the build; failure is not necessarily fatal +make -C avcall -f Makefile.devel avcall-$FFARCH-linux.s || : +make -C avcall -f Makefile.devel avcall-$FFARCH-macro.S || : +make -C vacall -f Makefile.devel vacall-$FFARCH-linux.s || : +make -C vacall -f Makefile.devel vacall-$FFARCH-macro.S || : +make -C callback/vacall_r -f Makefile.devel vacall-$FFARCH-linux.s || : +make -C callback/vacall_r -f Makefile.devel vacall-$FFARCH-macro.S || : + +# Build the actual library make # %{?_smp_mflags} %install @@ -86,6 +144,9 @@ done %changelog +* Fri Feb 24 2017 Jerry James - 1.13-1 +- New upstream release + * Fri Feb 10 2017 Fedora Release Engineering - 1.12-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild diff --git a/sources b/sources index 0346a52..7a6d29e 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -ad458ffa2bfdd1bca9d7f706d68a814d ffcall-1.12.tar.gz +SHA512 (ffcall-1.13.tar.xz) = d63bd798e274fad68451c396767fc5c23083d89dbfc257c18ccad8ea78622c2331f713b03afc862953373ab60d0605fad3251e653ef654a7e6a4656a95ff6651