pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/lang/sr Modernize this so that it builds again (after ...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/7b6a16b25792
branches:  trunk
changeset: 378980:7b6a16b25792
user:      he <he%pkgsrc.org@localhost>
date:      Wed Apr 18 08:42:16 2018 +0000

description:
Modernize this so that it builds again (after SSP), and
do the context-shifting in a non-MI manner so it may work
on other ports than i386.
Bump PKGREVISION.

diffstat:

 lang/sr/Makefile                   |    4 +-
 lang/sr/distinfo                   |    6 +-
 lang/sr/patches/patch-au           |  117 -------------------------------------
 lang/sr/patches/patch-bl           |   16 -----
 lang/sr/patches/patch-csw_netbsd.c |  106 +++++++++++++++++++++++++++++++++
 lang/sr/patches/patch-gen.h        |   35 +++++++++++
 6 files changed, 146 insertions(+), 138 deletions(-)

diffs (truncated from 333 to 300 lines):

diff -r 7c54c6b061b3 -r 7b6a16b25792 lang/sr/Makefile
--- a/lang/sr/Makefile  Wed Apr 18 08:26:42 2018 +0000
+++ b/lang/sr/Makefile  Wed Apr 18 08:42:16 2018 +0000
@@ -1,9 +1,9 @@
-# $NetBSD: Makefile,v 1.24 2012/10/21 20:56:54 cheusov Exp $
+# $NetBSD: Makefile,v 1.25 2018/04/18 08:42:16 he Exp $
 #
 
 DISTNAME=              sr233
 PKGNAME=               sr-2.3.3
-PKGREVISION=           9
+PKGREVISION=           10
 CATEGORIES=            lang parallel
 MASTER_SITES=          ftp://ftp.cs.arizona.edu/sr/
 EXTRACT_SUFX=          .tar.Z
diff -r 7c54c6b061b3 -r 7b6a16b25792 lang/sr/distinfo
--- a/lang/sr/distinfo  Wed Apr 18 08:26:42 2018 +0000
+++ b/lang/sr/distinfo  Wed Apr 18 08:42:16 2018 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.22 2015/11/03 22:50:45 agc Exp $
+$NetBSD: distinfo,v 1.23 2018/04/18 08:42:16 he Exp $
 
 SHA1 (sr233.tar.Z) = 0354987527ed1e84c32d3b1fc6bacb65d647f337
 RMD160 (sr233.tar.Z) = 58c90c06abede7a15ca8a68f53b6fdfa575c79df
@@ -10,7 +10,6 @@
 SHA1 (patch-ar) = 9a331cdb90959d0cc7475d2fc203d2c302d4bf5c
 SHA1 (patch-as) = db45b9cbc7adf8fccc207e91041a544e427c7a2a
 SHA1 (patch-at) = 989ea8ecf79a9f5d0567c53a2c9580b4ecc634c9
-SHA1 (patch-au) = 701c53883b3661c578dc5b192a9779e7fdc503f5
 SHA1 (patch-av) = 1beabb719e6f4a1d1872bd66c73d0d1169686770
 SHA1 (patch-aw) = 1bf4f69379229c7493b057a0445959b16cc36ca7
 SHA1 (patch-ax) = a834a65f2574be388bb420fdf883a9ac74f00ec9
@@ -27,8 +26,9 @@
 SHA1 (patch-bi) = ad6706295ff164fe6df257d325a06f9b157175d1
 SHA1 (patch-bj) = cd46d268fc173fe02efa8338ebf3f664ff2e5b94
 SHA1 (patch-bk) = 7ec4207ea173377fd6de9dc6272ab20e48ef0780
-SHA1 (patch-bl) = 7386a25df3223892fb841af3fa13eee3a17505b3
 SHA1 (patch-bm) = 52ebd86cda2d354bf5d580c0f2cf25f80350cd2c
 SHA1 (patch-bn) = fb8ebeb57956c094aee652c183a2fe1abbc45bb1
 SHA1 (patch-bo) = 55dcc14458fcb817c605eb7b8c4240e87e1cd25a
 SHA1 (patch-bp) = e0b553628fc2711ba2abe2b01999a0f84a5fbb7b
+SHA1 (patch-csw_netbsd.c) = e6a1dfe43a2c64317287cc4676d264b195fc29b5
+SHA1 (patch-gen.h) = cf024274a1c7866e103bcaf3355f5565a1612e2d
diff -r 7c54c6b061b3 -r 7b6a16b25792 lang/sr/patches/patch-au
--- a/lang/sr/patches/patch-au  Wed Apr 18 08:26:42 2018 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,117 +0,0 @@
-$NetBSD: patch-au,v 1.3 2005/03/02 13:21:34 is Exp $
-
---- csw/netbsd.c.orig  2005-03-02 13:00:06.000000000 +0000
-+++ csw/netbsd.c
-@@ -0,0 +1,112 @@
-+/*
-+ *  netbsd.c -- context switch code for NetBSD 2.
-+ *
-+ *  Some Makefile changes are needed to use this code.
-+ */
-+
-+#include <ucontext.h>
-+
-+void sr_stk_underflow(void);
-+void sr_stk_corrupted(void);
-+
-+static void startup(void (*)(void), unsigned long, unsigned long, unsigned long, unsigned long);
-+
-+#ifdef __i386__
-+void pthread__i386_init(void);
-+
-+#define _setcontext_u(uc)     (*_md_setcontext_u)(uc)
-+#define _swapcontext_u(oc,nc) (*_md_swapcontext_u)(oc,nc)
-+
-+static void sr_setcontext_u(ucontext_t *);
-+static void sr_swapcontext_u(ucontext_t *, ucontext_t *);
-+
-+void (*_md_getcontext_u) (ucontext_t *);
-+void (*_md_setcontext_u) (ucontext_t *)                       = sr_setcontext_u;
-+void (*_md_swapcontext_u)(ucontext_t *, ucontext_t *) = sr_swapcontext_u;
-+
-+static void
-+sr_setcontext_u(ucontext_t *uc) {
-+      pthread__i386_init();
-+      _setcontext_u(uc);
-+}
-+
-+static void
-+sr_swapcontext_u(ucontext_t *oldc, ucontext_t *newc) {
-+      pthread__i386_init();
-+      _swapcontext_u(oldc, newc);
-+}
-+#endif
-+
-+
-+/*
-+ *  sr_build_context (func, buf, bufsize, arg1, arg2, arg3, arg4)
-+ *
-+ *  Build a context that will call func(arg1,arg2,arg3,arg4) when activated
-+ *  and will catch an underflow error if func returns.  We use an intermediary
-+ *  in order to catch that return.
-+ */
-+void
-+sr_build_context (func, buf, bufsize, arg1, arg2, arg3, arg4)
-+void (*func)();
-+char *buf;
-+int bufsize;
-+unsigned long arg1, arg2, arg3, arg4;
-+{
-+    ucontext_t *uc = (ucontext_t *) buf;      /* put header at front of buf */
-+
-+    if (0 != getcontext(uc)) {                        /* initialize context */
-+      sr_stk_corrupted();
-+    }
-+
-+    uc->uc_stack.ss_sp = buf + sizeof (ucontext_t);
-+    uc->uc_stack.ss_size = bufsize - sizeof (ucontext_t);
-+
-+    makecontext (uc, startup, 5, func, arg1, arg2, arg3, arg4);
-+    uc->uc_stack.ss_flags = 0;
-+}
-+
-+/*
-+ *  startup (func, a,b,c,d) -- intermediary for startup and underflow detection.
-+ */
-+static void
-+startup (func, arg1, arg2, arg3, arg4)
-+void (*func)();
-+unsigned long arg1, arg2, arg3, arg4;
-+{
-+    (*func) (arg1, arg2, arg3, arg4);
-+    sr_stk_underflow();
-+}
-+
-+
-+
-+/*
-+ *  sr_chg_context (newctx, oldctx) -- change contexts.
-+ */
-+void
-+sr_chg_context (new, old)
-+char *new, *old;
-+{
-+    ucontext_t *oldu, *newu;
-+    newu = (ucontext_t *)new;
-+
-+    if (old) {
-+      oldu = (ucontext_t *)old;
-+      _swapcontext_u(oldu, newu);
-+    } else {
-+      _setcontext_u(newu);
-+    }
-+}
-+
-+
-+
-+/*
-+ *  sr_check_stk (stk) -- check for stack overflow.
-+ *
-+ *  We have no idea of how to do that, so we do nothing.
-+ */
-+void
-+sr_check_stk(stk)
-+char *stk;
-+{
-+    /* nothing */
-+}
diff -r 7c54c6b061b3 -r 7b6a16b25792 lang/sr/patches/patch-bl
--- a/lang/sr/patches/patch-bl  Wed Apr 18 08:26:42 2018 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,16 +0,0 @@
-$NetBSD: patch-bl,v 1.1 2010/03/03 15:24:19 is Exp $
-
---- gen.h.orig 1999-07-28 22:42:21.000000000 +0200
-+++ gen.h
-@@ -43,8 +43,9 @@ void exit();
- double fmod();        /* not in Sequent <math.h> */
- 
- #if defined(__STDC__) || defined(__sgi) || defined(_AIX) || defined(__alpha)
--void *malloc(), *realloc();
--void *memset(), *memcpy();
-+#include <unistd.h>
-+#include <string.h>
-+#include <stdlib.h>
- #else
- char *malloc(), *realloc();
- char *memset(), *memcpy();
diff -r 7c54c6b061b3 -r 7b6a16b25792 lang/sr/patches/patch-csw_netbsd.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/sr/patches/patch-csw_netbsd.c        Wed Apr 18 08:42:16 2018 +0000
@@ -0,0 +1,106 @@
+$NetBSD: patch-csw_netbsd.c,v 1.1 2018/04/18 08:42:16 he Exp $
+
+Implement context switching for NetBSD.
+
+--- csw/netbsd.c.orig  2018-04-18 07:36:39.000000000 +0000
++++ csw/netbsd.c
+@@ -0,0 +1,99 @@
++/*
++ *  netbsd.c -- context switch code for NetBSD 2.
++ *
++ *  Some Makefile changes are needed to use this code.
++ */
++
++#include <ucontext.h>
++
++void sr_stk_underflow(void);
++void sr_stk_corrupted(void);
++
++static void startup(void (*)(void), unsigned long, unsigned long, unsigned long, unsigned long);
++
++static void sr_setcontext_u(ucontext_t *);
++static void sr_swapcontext_u(ucontext_t *, ucontext_t *);
++
++static void
++sr_setcontext_u(ucontext_t *uc) {
++      setcontext(uc);
++}
++
++static void
++sr_swapcontext_u(ucontext_t *oldc, ucontext_t *newc) {
++      swapcontext(oldc, newc);
++}
++
++
++/*
++ *  sr_build_context (func, buf, bufsize, arg1, arg2, arg3, arg4)
++ *
++ *  Build a context that will call func(arg1,arg2,arg3,arg4) when activated
++ *  and will catch an underflow error if func returns.  We use an intermediary
++ *  in order to catch that return.
++ */
++void
++sr_build_context (func, buf, bufsize, arg1, arg2, arg3, arg4)
++void (*func)();
++char *buf;
++int bufsize;
++unsigned long arg1, arg2, arg3, arg4;
++{
++    ucontext_t *uc = (ucontext_t *) buf;      /* put header at front of buf */
++
++    if (0 != getcontext(uc)) {                        /* initialize context */
++      sr_stk_corrupted();
++    }
++
++    uc->uc_stack.ss_sp = buf + sizeof (ucontext_t);
++    uc->uc_stack.ss_size = bufsize - sizeof (ucontext_t);
++
++    makecontext (uc, startup, 5, func, arg1, arg2, arg3, arg4);
++    uc->uc_stack.ss_flags = 0;
++}
++
++/*
++ *  startup (func, a,b,c,d) -- intermediary for startup and underflow detection.
++ */
++static void
++startup (func, arg1, arg2, arg3, arg4)
++void (*func)();
++unsigned long arg1, arg2, arg3, arg4;
++{
++    (*func) (arg1, arg2, arg3, arg4);
++    sr_stk_underflow();
++}
++
++
++
++/*
++ *  sr_chg_context (newctx, oldctx) -- change contexts.
++ */
++void
++sr_chg_context (new, old)
++char *new, *old;
++{
++    ucontext_t *oldu, *newu;
++    newu = (ucontext_t *)new;
++
++    if (old) {
++      oldu = (ucontext_t *)old;
++      swapcontext(oldu, newu);
++    } else {
++      setcontext(newu);
++    }
++}
++
++
++
++/*
++ *  sr_check_stk (stk) -- check for stack overflow.
++ *
++ *  We have no idea of how to do that, so we do nothing.
++ */
++void
++sr_check_stk(stk)
++char *stk;
++{
++    /* nothing */
++}
diff -r 7c54c6b061b3 -r 7b6a16b25792 lang/sr/patches/patch-gen.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/sr/patches/patch-gen.h       Wed Apr 18 08:42:16 2018 +0000
@@ -0,0 +1,35 @@
+$NetBSD: patch-gen.h,v 1.1 2018/04/18 08:42:16 he Exp $
+



Home | Main Index | Thread Index | Old Index