SHA256
1
0
forked from pool/ffcall

Accepting request 506619 from devel:languages:misc

- Accordingly to Bruno Haible the define -DMAP_VARIABLE=MAP_PRIVATE
  should become removed

- Add some more debug code for build architecture 

- Update to (lib)fcall-1.13 release
  * The license has been changed from GPLv2 to GPLv2+.
  * Added support for the following platforms:
    (Previously, a build on these platforms failed.)
    - x86_64: Mac OS X 64-bit.
    - x86_64: Solaris 64-bit.
    - x86_64: Linux with x32 ABI: CC="gcc -mx32".
    - arm: Linux 32-bit, without hardware floats.
    - arm64: Linux 64-bit.
    - s390x: Linux 64-bit.
    - powerpc: AIX 64-bit.
    - mips: IRIX 6.5 with CC="cc -32".
    - sparc: Solaris 64-bit.
  * Fixed support for the following platforms:
    (Previously, a build on these platforms appeared to succeed but was buggy.)
    - x86_64: Linux.
    - arm: Linux 32-bit, with hardware floats.
    - powerpc: Linux 64-bit.
    - mips: Linux with CC="gcc -mabi=32".
    - mips: Linux with CC="gcc -mabi=n32".
    - mips: Linux with CC="gcc -mabi=64".
    - mips: IRIX 6.5 with CC="gcc -mabi=n32".
    - s390: Linux.
    - sparc: Linux 64-bit.
    - ia64: Linux.

OBS-URL: https://build.opensuse.org/request/show/506619
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/ffcall?expand=0&rev=7
This commit is contained in:
Dominique Leuenberger 2017-08-24 16:31:39 +00:00 committed by Git OBS Bridge
commit 4fd94ff600
6 changed files with 127 additions and 87 deletions

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:0c3325e99e24462ffc7276fb6c3dda0872e330d95454b81c575309c400cdb31f
size 1359026

View File

@ -1,18 +0,0 @@
--- callback/trampoline_r/trampoline.c
+++ callback/trampoline_r/trampoline.c 2013-05-08 11:43:26.793439676 +0000
@@ -183,15 +183,11 @@ extern RETGETPAGESIZETYPE getpagesize (v
#ifdef ultrix
#include <mips/cachectl.h>
#else
-#ifdef linux
-#include <asm/cachectl.h>
-#else
#ifdef HAVE_SYS_CACHECTL_H
#include <sys/cachectl.h>
#endif
#endif
#endif
-#endif
#ifdef __m88k__
#include <sys/syslocal.h>
#endif

View File

@ -1,42 +1,35 @@
--- ./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 <stdio.h> /* 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 <stdio.h> /* declares fprintf() */
---
callback/trampoline_r/trampoline.c | 6 ++++++
trampoline/trampoline.c | 6 ++++++
2 files changed, 12 insertions(+)
--- callback/trampoline_r/trampoline.c
+++ callback/trampoline_r/trampoline.c 2017-06-26 08:51:46.787267290 +0000
@@ -76,6 +76,12 @@ extern void (*tramp_r) (); /* trampoline
#define EXECUTABLE_VIA_MMAP_THEN_MPROTECT
#elif defined(HAVE_MMAP_SHARED_CAN_EXEC)
#define EXECUTABLE_VIA_MMAP_FILE_SHARED
+ #elif defined(HAVE_MMAP)
+ /* Use an mmap'ed page. */
+ #define EXECUTABLE_VIA_MMAP
+ #elif defined(HAVE_SHM)
+ /* Use an shmat'ed page. */
+ #define EXECUTABLE_VIA_SHM
#else
#error "Don't know how to make memory pages executable."
#endif
--- trampoline/trampoline.c
+++ trampoline/trampoline.c 2017-06-26 08:50:21.820815116 +0000
@@ -76,6 +76,12 @@ extern void (*tramp) (); /* trampoline p
#define EXECUTABLE_VIA_MMAP_THEN_MPROTECT
#elif defined(HAVE_MMAP_SHARED_CAN_EXEC)
#define EXECUTABLE_VIA_MMAP_FILE_SHARED
+ #elif defined(HAVE_MMAP)
+ /* Use an mmap'ed page. */
+ #define EXECUTABLE_VIA_MMAP
+ #elif defined(HAVE_SHM)
+ /* Use an shmat'ed page. */
+ #define EXECUTABLE_VIA_SHM
#else
#error "Don't know how to make memory pages executable."
#endif

View File

@ -1,3 +1,58 @@
-------------------------------------------------------------------
Wed Jun 28 06:07:53 UTC 2017 - werner@suse.de
- Accordingly to Bruno Haible the define -DMAP_VARIABLE=MAP_PRIVATE
should become removed
-------------------------------------------------------------------
Mon Jun 26 13:04:17 UTC 2017 - werner@suse.de
- Add some more debug code for build architecture
-------------------------------------------------------------------
Mon Jun 26 08:12:41 UTC 2017 - werner@suse.de
- Update to (lib)fcall-1.13 release
* The license has been changed from GPLv2 to GPLv2+.
* Added support for the following platforms:
(Previously, a build on these platforms failed.)
- x86_64: Mac OS X 64-bit.
- x86_64: Solaris 64-bit.
- x86_64: Linux with x32 ABI: CC="gcc -mx32".
- arm: Linux 32-bit, without hardware floats.
- arm64: Linux 64-bit.
- s390x: Linux 64-bit.
- powerpc: AIX 64-bit.
- mips: IRIX 6.5 with CC="cc -32".
- sparc: Solaris 64-bit.
* Fixed support for the following platforms:
(Previously, a build on these platforms appeared to succeed but was buggy.)
- x86_64: Linux.
- arm: Linux 32-bit, with hardware floats.
- powerpc: Linux 64-bit.
- mips: Linux with CC="gcc -mabi=32".
- mips: Linux with CC="gcc -mabi=n32".
- mips: Linux with CC="gcc -mabi=64".
- mips: IRIX 6.5 with CC="gcc -mabi=n32".
- s390: Linux.
- sparc: Linux 64-bit.
- ia64: Linux.
- hppa: HP-UX 32-bit.
* Verified support for the following platforms:
(A build on these platforms worked and still works.)
- i386: Linux, Solaris, Mac OS X.
- powerpc: Linux 32-bit.
- powerpc: AIX 32-bit.
- powerpc: MacOS X.
- mips: IRIX 6.5 with CC="cc -n32".
- sparc: Solaris 32-bit.
- sparc: Linux 32-bit: CC="gcc -m32".
- alpha: Linux.
* Support for a security feature: On Linux and FreeBSD platforms, linking with
the libffcall libraries no longer causes the stack to become executable.
- Remove the patch ffcall-asm_cachectl.patch
- Update the patch ffcall-trampoline.patch
-------------------------------------------------------------------
Sat Feb 13 21:32:55 UTC 2016 - schwab@linux-m68k.org

View File

@ -1,7 +1,7 @@
#
# spec file for package ffcall
#
# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -18,35 +18,25 @@
# Only a static library is provided, so no debug information can be extracted.
%global debug_package %{nil}
%global debug no
# 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 %alpha %arm parisc hppa1.0 hppa1.1 hppa1.2 hppa2.0 ia64 m68k mips mipsel ppc ppc64 ppc64le ppc8260 ppc8560 ppc32dy4 ppciseries ppcpseries s390 %sparc
%global ffcall_arches %ix86 x86_64 %alpha %arm aarch64 parisc hppa1.0 hppa1.1 hppa1.2 hppa2.0 ia64 m68k mips mipsel ppc ppc64 ppc64le ppc8260 ppc8560 ppc32dy4 ppciseries ppcpseries s390 s390x %sparc sparc64
Name: ffcall
Version: 1.12
Version: 1.13
Release: 0
Summary: Libraries for foreign function call interfaces
# As this package only provides a static library together with the header files
License: GPL-2.0+
Group: Development/Libraries/Other
# As this package only provides a static library together with the header files
Provides: %{name}-devel = %version-%release
Url: http://www.gnu.org/software/libffcall/
#
# There has been no official release for several years, and the project web
# site encourages use of a CVS snapshot. Make the tarball as follows:
# cvs -z3 -d:pserver:anonymous@cvs.savannah.gnu.org:/sources/libffcall
# export -D 2012-04-24 ffcall
# tar cJf ffcall-20120424cvs.tar.xz ffcall
#
Source0: https://github.com/libffcall/libffcall/archive/ffcall-%{version}.tar.gz
# PATCH-EXTEND-UPSTREAM --
# 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
# PATCH-FIX-OPENSUSE -- There is no <asm/cachectl.h>
Patch1: %{name}-asm_cachectl.patch
# https://git.savannah.gnu.org/cgit/libffcall.git/snapshot/libffcall-%{version}.tar.gz
Source0: https://ftp.gnu.org/gnu/libffcall/libffcall-%{version}.tar.gz
Patch0: ffcall-trampoline.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
ExclusiveArch: %{ffcall_arches}
@ -62,24 +52,44 @@ packages are:
%prep
%setup -q -n libffcall-ffcall-%{version}
%patch0
%patch1
%setup -q -n libffcall-%{version}
#%patch0
if ! test -e /usr/include/asm/cachectl.h
then
# FIX-OPENSUSE -- Remove this if there is no <asm/cachectl.h>
for c in callback/trampoline_r/trampoline.c trampoline/trampoline.c
do
echo 'No <asm/cachectl.h> on this architecture %arch'
sed -ri '/^#ifdef linux/,/^#else/{ \@#include <asm/cachectl.h>@d }' $c
done
fi
# Remove prebuilt object files
find . -name \*.o | xargs rm -f
%build
export CFLAGS="$RPM_OPT_FLAGS -fPIC -DMAP_VARIABLE=MAP_PRIVATE"
%configure
export CFLAGS="%{optflags} -fPIC"
%configure --disable-rpath --with-gnu-ld
if test -e /.build.log
then
grep -E '^#define (CODE|HAVE)' config.h
sed -rn '/checking whether code in malloc\(\)ed memory is executable/,/result: /p' config.log
fi
make # %{?_smp_mflags}
%install
mkdir -p %{buildroot}%{_libdir}
mkdir -p %{buildroot}%{_mandir}
mkdir -p %{buildroot}%{_defaultdocdir}/%{name}
make install DESTDIR=%{buildroot}
rm -fr %{buildroot}%{_datadir}/html
rm -f %{buildroot}%{_libdir}/*.la
if test %debug = yes ; then
install config.log %{buildroot}%{_defaultdocdir}/%{name}
echo %{_defaultdocdir}/%{name}/config.log > list
else
> list
fi
cd %{buildroot}%{_mandir}/man3
# Advertise supported architectures
@ -94,7 +104,7 @@ for page in *; do
mv $page %{name}-$page
done
%files
%files -f list
%defattr(-,root,root,-)
%doc README NEWS COPYING
%doc avcall/avcall.html

3
libffcall-1.13.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:1707ce707dbbf57f1bbe9aa56929c0da866046b0d5a26eb0d96d9f0bb29bbce7
size 985185