pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/devel/libffi Add libffi support for VAX and m88k. Test...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/7a219eb37718
branches:  trunk
changeset: 626195:7a219eb37718
user:      jklos <jklos%pkgsrc.org@localhost>
date:      Sun Nov 03 23:51:51 2013 +0000

description:
Add libffi support for VAX and m88k. Tested with netbsd-6 on VAX.
>From Miod Vallat:

https://sourceware.org/ml/libffi-discuss/2013/msg00165.html

diffstat:

 devel/libffi/distinfo                           |   12 +-
 devel/libffi/patches/patch-Makefile.am          |   40 ++
 devel/libffi/patches/patch-aa                   |   66 +++-
 devel/libffi/patches/patch-configure.ac         |   42 ++
 devel/libffi/patches/patch-src_m88k_elfbsd.S    |  200 +++++++++++
 devel/libffi/patches/patch-src_m88k_ffi.c       |  405 ++++++++++++++++++++++++
 devel/libffi/patches/patch-src_m88k_ffitarget.h |   54 +++
 devel/libffi/patches/patch-src_vax_elfbsd.S     |  200 +++++++++++
 devel/libffi/patches/patch-src_vax_ffi.c        |  281 ++++++++++++++++
 devel/libffi/patches/patch-src_vax_ffitarget.h  |   54 +++
 10 files changed, 1340 insertions(+), 14 deletions(-)

diffs (truncated from 1456 to 300 lines):

diff -r 7c9e10a8c868 -r 7a219eb37718 devel/libffi/distinfo
--- a/devel/libffi/distinfo     Sun Nov 03 16:13:29 2013 +0000
+++ b/devel/libffi/distinfo     Sun Nov 03 23:51:51 2013 +0000
@@ -1,9 +1,10 @@
-$NetBSD: distinfo,v 1.29 2013/07/26 13:12:25 ryoon Exp $
+$NetBSD: distinfo,v 1.30 2013/11/03 23:51:51 jklos Exp $
 
 SHA1 (libffi-3.0.13.tar.gz) = f5230890dc0be42fb5c58fbf793da253155de106
 RMD160 (libffi-3.0.13.tar.gz) = 03f0627c0fcc800d38636258a2fab2d6bb8b6625
 Size (libffi-3.0.13.tar.gz) = 845747 bytes
-SHA1 (patch-aa) = 2f750e47e2911711da9a06153c8c10cf143d2c58
+SHA1 (patch-Makefile.am) = 01109a0d5708835162a2d007a26decac5bb0bbac
+SHA1 (patch-aa) = 0a5f894f989c51951e3b4ea6f45631466e183181
 SHA1 (patch-ac) = f3c6324f4334d23e684b4eca25173a13be5d37eb
 SHA1 (patch-ad) = 8901a00abe25422e3e35f321a5fb89311185fc0b
 SHA1 (patch-ae) = aa53d44c740806d54776530eeb7f7ff245d2022d
@@ -12,6 +13,13 @@
 SHA1 (patch-ah) = e9580069ede90cd616da7bc230b28acbf5d204a6
 SHA1 (patch-ai) = f85a6cb64d4a9d7c3e56b47b7092fce10a744b5b
 SHA1 (patch-aj) = d130b2b20b94ca26c70dcc46614e36c6d0ac9153
+SHA1 (patch-configure.ac) = 7fc7490a5b62b00afff31824c1d86cf973d549be
 SHA1 (patch-fficonfig.h.in) = fd85fa767bc057c843ff71cc61bedfcff84def43
+SHA1 (patch-src_m88k_elfbsd.S) = fae3e425dcff3e924ef195eab165f9bbc6ec4077
+SHA1 (patch-src_m88k_ffi.c) = e4b7382c3d6e253b8c1c6054150c530c21d018de
+SHA1 (patch-src_m88k_ffitarget.h) = e8479bc3aa876f5e6d52a4d578c5da88291c6646
+SHA1 (patch-src_vax_elfbsd.S) = abf284bd1db086a12608b7243344af30e4a314ca
+SHA1 (patch-src_vax_ffi.c) = f47ced03388e9744afa44d6bb5e14d5f4285cfbf
+SHA1 (patch-src_vax_ffitarget.h) = 388f3a58e37dd8af5c194b5be77a6ea6f9beef4b
 SHA1 (patch-src_x86_ffi.c) = b9ac64a53a92de663a339212e22c1286fa41c1d5
 SHA1 (patch-src_x86_win64.S) = 5b6836bae6c73743b925de4d11bc241c783bffd6
diff -r 7c9e10a8c868 -r 7a219eb37718 devel/libffi/patches/patch-Makefile.am
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/devel/libffi/patches/patch-Makefile.am    Sun Nov 03 23:51:51 2013 +0000
@@ -0,0 +1,40 @@
+$NetBSD: patch-Makefile.am,v 1.1 2013/11/03 23:51:51 jklos Exp $
+
+--- Makefile.am.orig   2013-03-16 11:52:11.000000000 +0000
++++ Makefile.am
+@@ -19,6 +19,7 @@ EXTRA_DIST = LICENSE ChangeLog.v1 Change
+        src/moxie/ffitarget.h src/moxie/eabi.S src/mips/ffitarget.h    \
+        src/m32r/ffi.c src/m32r/sysv.S src/m32r/ffitarget.h            \
+        src/m68k/ffi.c src/m68k/sysv.S src/m68k/ffitarget.h            \
++       src/m88k/ffi.c src/m88k/obsd.S src/m88k/ffitarget.h            \
+        src/microblaze/ffi.c src/microblaze/sysv.S                     \
+        src/microblaze/ffitarget.h src/powerpc/ffi.c                   \
+        src/powerpc/sysv.S src/powerpc/linux64.S                       \
+@@ -38,6 +39,7 @@ EXTRA_DIST = LICENSE ChangeLog.v1 Change
+        src/bfin/ffitarget.h src/bfin/sysv.S src/frv/eabi.S            \
+        src/frv/ffitarget.h src/dlmalloc.c src/tile/ffi.c              \
+        src/tile/ffitarget.h src/tile/tile.S libtool-version           \
++       src/vax/ffi.c src/vax/ffitarget.h src/vax/elfbsd.S             \
+        src/xtensa/ffitarget.h src/xtensa/ffi.c src/xtensa/sysv.S      \
+        ChangeLog.libffi m4/libtool.m4 m4/lt~obsolete.m4               \
+        m4/ltoptions.m4 m4/ltsugar.m4 m4/ltversion.m4                  \
+@@ -149,6 +151,9 @@ endif
+ if M68K
+ nodist_libffi_la_SOURCES += src/m68k/ffi.c src/m68k/sysv.S
+ endif
++if M88K
++nodist_libffi_la_SOURCES += src/m88k/ffi.c src/m88k/obsd.S
++endif
+ if MOXIE
+ nodist_libffi_la_SOURCES += src/moxie/ffi.c src/moxie/eabi.S
+ endif
+@@ -212,6 +217,9 @@ endif
+ if METAG
+ nodist_libffi_la_SOURCES += src/metag/sysv.S src/metag/ffi.c
+ endif
++if VAX
++nodist_libffi_la_SOURCES += src/vax/elfbsd.S src/vax/ffi.c
++endif
+ 
+ libffi_convenience_la_SOURCES = $(libffi_la_SOURCES)
+ nodist_libffi_convenience_la_SOURCES = $(nodist_libffi_la_SOURCES)
diff -r 7c9e10a8c868 -r 7a219eb37718 devel/libffi/patches/patch-aa
--- a/devel/libffi/patches/patch-aa     Sun Nov 03 16:13:29 2013 +0000
+++ b/devel/libffi/patches/patch-aa     Sun Nov 03 23:51:51 2013 +0000
@@ -1,12 +1,17 @@
-$NetBSD: patch-aa,v 1.17 2013/04/06 12:41:23 obache Exp $
-
-Extend which ports we accept to deal with.
-
-Disable multilib directories.
+$NetBSD: patch-aa,v 1.18 2013/11/03 23:51:51 jklos Exp $
 
 --- configure.orig     2013-03-17 22:36:19.000000000 +0000
 +++ configure
-@@ -13331,7 +13331,7 @@ case "$host" in
+@@ -651,6 +651,8 @@ XTENSA_FALSE
+ XTENSA_TRUE
+ TILE_FALSE
+ TILE_TRUE
++VAX_FALSE
++VAX_TRUE
+ PA64_HPUX_FALSE
+ PA64_HPUX_TRUE
+ PA_HPUX_FALSE
+@@ -13331,7 +13333,7 @@ case "$host" in
        TARGET=FRV; TARGETDIR=frv
        ;;
  
@@ -15,7 +20,7 @@
        TARGET=PA_LINUX; TARGETDIR=pa
        ;;
    hppa*64-*-hpux*)
-@@ -13428,7 +13428,7 @@ case "$host" in
+@@ -13428,7 +13430,7 @@ case "$host" in
    mips-sgi-irix5.* | mips-sgi-irix6.* | mips*-*-rtems*)
        TARGET=MIPS; TARGETDIR=mips
        ;;
@@ -24,7 +29,7 @@
        # Support 128-bit long double for NewABI.
        HAVE_LONG_DOUBLE='defined(__mips64)'
        TARGET=MIPS; TARGETDIR=mips
-@@ -13449,7 +13449,7 @@ case "$host" in
+@@ -13449,7 +13451,7 @@ case "$host" in
    powerpc-*-aix* | rs6000-*-aix*)
        TARGET=POWERPC_AIX; TARGETDIR=powerpc
        ;;
@@ -33,7 +38,7 @@
        TARGET=POWERPC_FREEBSD; TARGETDIR=powerpc
        ;;
    powerpc64-*-freebsd*)
-@@ -13463,7 +13463,7 @@ case "$host" in
+@@ -13463,7 +13465,7 @@ case "$host" in
        TARGET=S390; TARGETDIR=s390
        ;;
  
@@ -42,7 +47,33 @@
        TARGET=SH; TARGETDIR=sh
        ;;
    sh64-*-* | sh5*-*-*)
-@@ -14661,7 +14661,7 @@ case "$target" in
+@@ -13478,6 +13480,10 @@ case "$host" in
+         TARGET=TILE; TARGETDIR=tile
+         ;;
+ 
++  vax-*-*)
++      TARGET=VAX; TARGETDIR=vax
++      ;;
++
+   xtensa*-*)
+       TARGET=XTENSA; TARGETDIR=xtensa
+       ;;
+@@ -13747,6 +13753,14 @@ else
+   TILE_FALSE=
+ fi
+ 
++ if test x$TARGET = xVAX; then
++  VAX_TRUE=
++  VAX_FALSE='#'
++else
++  VAX_TRUE='#'
++  VAX_FALSE=
++fi
++
+  if test x$TARGET = xXTENSA; then
+   XTENSA_TRUE=
+   XTENSA_FALSE='#'
+@@ -14661,7 +14675,7 @@ case "$target" in
  $as_echo "#define FFI_EXEC_TRAMPOLINE_TABLE 1" >>confdefs.h
  
       ;;
@@ -51,7 +82,7 @@
  
  $as_echo "#define FFI_MMAP_EXEC_WRIT 1" >>confdefs.h
  
-@@ -14840,11 +14840,6 @@ if test "x$GCC" = "xyes"; then
+@@ -14840,11 +14854,6 @@ if test "x$GCC" = "xyes"; then
      toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
      toolexeclibdir='$(libdir)'
    fi
@@ -63,7 +94,18 @@
  
  else
    toolexeclibdir='$(libdir)'
-@@ -16734,13 +16729,13 @@ s/ [a-zA-Z0-9-]*-all [a-zA-Z0-9-]*-all-a
+@@ -15135,6 +15144,10 @@ if test -z "${TILE_TRUE}" && test -z "${
+   as_fn_error $? "conditional \"TILE\" was never defined.
+ Usually this means the macro was only invoked conditionally." "$LINENO" 5
+ fi
++if test -z "${VAX_TRUE}" && test -z "${VAX_FALSE}"; then
++  as_fn_error $? "conditional \"VAX\" was never defined.
++Usually this means the macro was only invoked conditionally." "$LINENO" 5
++fi
+ if test -z "${XTENSA_TRUE}" && test -z "${XTENSA_FALSE}"; then
+   as_fn_error $? "conditional \"XTENSA\" was never defined.
+ Usually this means the macro was only invoked conditionally." "$LINENO" 5
+@@ -16734,13 +16751,13 @@ s/ [a-zA-Z0-9-]*-all [a-zA-Z0-9-]*-all-a
  /-all-all/d
  a\\
        @ HOST="\$(HOST)\" \\\\\\
diff -r 7c9e10a8c868 -r 7a219eb37718 devel/libffi/patches/patch-configure.ac
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/devel/libffi/patches/patch-configure.ac   Sun Nov 03 23:51:51 2013 +0000
@@ -0,0 +1,42 @@
+$NetBSD: patch-configure.ac,v 1.1 2013/11/03 23:51:51 jklos Exp $
+
+--- configure.ac.orig  2013-03-17 22:36:15.000000000 +0000
++++ configure.ac
+@@ -191,6 +191,10 @@ case "$host" in
+       TARGET=M68K; TARGETDIR=m68k
+       ;;
+ 
++  m88k-*-*)
++      TARGET=M88K; TARGETDIR=m88k
++      ;;
++
+   microblaze*-*-*)
+       TARGET=MICROBLAZE; TARGETDIR=microblaze
+       ;;
+@@ -256,6 +260,10 @@ case "$host" in
+         TARGET=TILE; TARGETDIR=tile
+         ;;
+ 
++  vax-*-*)
++      TARGET=VAX; TARGETDIR=vax
++      ;;
++
+   xtensa*-*)
+       TARGET=XTENSA; TARGETDIR=xtensa
+       ;;
+@@ -281,6 +289,7 @@ AM_CONDITIONAL(ALPHA, test x$TARGET = xA
+ AM_CONDITIONAL(IA64, test x$TARGET = xIA64)
+ AM_CONDITIONAL(M32R, test x$TARGET = xM32R)
+ AM_CONDITIONAL(M68K, test x$TARGET = xM68K)
++AM_CONDITIONAL(M88K, test x$TARGET = xM88K)
+ AM_CONDITIONAL(MICROBLAZE, test x$TARGET = xMICROBLAZE)
+ AM_CONDITIONAL(METAG, test x$TARGET = xMETAG)
+ AM_CONDITIONAL(MOXIE, test x$TARGET = xMOXIE)
+@@ -301,6 +310,7 @@ AM_CONDITIONAL(PA_LINUX, test x$TARGET =
+ AM_CONDITIONAL(PA_HPUX, test x$TARGET = xPA_HPUX)
+ AM_CONDITIONAL(PA64_HPUX, test x$TARGET = xPA64_HPUX)
+ AM_CONDITIONAL(TILE, test x$TARGET = xTILE)
++AM_CONDITIONAL(VAX, test x$TARGET = xVAX)
+ AM_CONDITIONAL(XTENSA, test x$TARGET = xXTENSA)
+ 
+ AC_HEADER_STDC
diff -r 7c9e10a8c868 -r 7a219eb37718 devel/libffi/patches/patch-src_m88k_elfbsd.S
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/devel/libffi/patches/patch-src_m88k_elfbsd.S      Sun Nov 03 23:51:51 2013 +0000
@@ -0,0 +1,200 @@
+$NetBSD: patch-src_m88k_elfbsd.S,v 1.1 2013/11/03 23:51:51 jklos Exp $
+
+--- src/m88k/elfbsd.S.orig     2013-11-03 22:57:57.000000000 +0000
++++ src/m88k/elfbsd.S
+@@ -0,0 +1,195 @@
++/*
++ * Copyright (c) 2013 Miodrag Vallat.  <miod%openbsd.org@localhost>
++ *
++ * Permission is hereby granted, free of charge, to any person obtaining
++ * a copy of this software and associated documentation files (the
++ * ``Software''), to deal in the Software without restriction, including
++ * without limitation the rights to use, copy, modify, merge, publish,
++ * distribute, sublicense, and/or sell copies of the Software, and to
++ * permit persons to whom the Software is furnished to do so, subject to
++ * the following conditions:
++ * 
++ * The above copyright notice and this permission notice shall be included
++ * in all copies or substantial portions of the Software.
++ * 
++ * THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
++ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
++ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
++ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
++ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
++ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
++ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
++ */
++
++/*
++ * vax Foreign Function Interface
++ */
++
++#define LIBFFI_ASM    
++#include <fficonfig.h>
++#include <ffi.h>
++
++      .text
++
++/*
++ * void *                                     %r0
++ * ffi_call_elfbsd(extended_cif *ecif,                4(%ap)
++ *               unsigned bytes,              8(%ap)
++ *               unsigned flags,              12(%ap)
++ *               void *rvalue,                16(%ap)
++ *               void (*fn)());               20(%ap)
++ */
++      .globl  ffi_call_elfbsd
++      .type   ffi_call_elfbsd,@function
++      .align  2
++ffi_call_elfbsd:
++      .word   0x00c           # save R2 and R3
++
++      # Allocate stack space for the args
++      subl2   8(%ap), %sp
++
++      # Call ffi_prep_args
++      pushl   %sp
++      pushl   4(%ap)



Home | Main Index | Thread Index | Old Index