Remove duplicate patches. Patch only the src/ copy of the runtime.

Instead of extracting the runtime twice for src/ and base/ and then
haphazardly patching either or both copies, patch only one copy and
create the other *after* patching.

(better yet would be not to copy the thing at all, but I think there
are smlnj reasons you can't do that)
This commit is contained in:
dholland 2016-07-03 19:07:38 +00:00
parent d7a4da3526
commit 749110cfe5
6 changed files with 1 additions and 133 deletions

View file

@ -1,4 +1,4 @@
$NetBSD: distinfo,v 1.19 2016/04/14 22:10:31 dholland Exp $
$NetBSD: distinfo,v 1.20 2016/07/03 19:07:38 dholland Exp $
SHA1 (smlnj-110.73/MLRISC.tgz) = 59a38a4a1c63cecf97764a99577b3f929b5ccbc9
RMD160 (smlnj-110.73/MLRISC.tgz) = dd951776482f37421a17701d67c051741691c6cb
@ -96,11 +96,6 @@ SHA1 (patch-ao) = 1c66024c5949269291cbf6f815baf6162db47d31
SHA1 (patch-ap) = af8b50c0f21e969e036064f5c808eaccc79d5c4b
SHA1 (patch-aq) = 32d96ad2552d5ac914581686904e94a96e5ca059
SHA1 (patch-at) = 376b67d25ef428377b1686fcd6232628867d6eae
SHA1 (patch-base_runtime_gc_gc-stats.h) = 35e54cb66c47c636c5a9f450cff99dced4218dd2
SHA1 (patch-base_runtime_gc_init-gc.c) = f40e961089beab151290ffc8371a48bc9f846511
SHA1 (patch-base_runtime_kernel_unix-timers.c) = 42f1d2964d5de37fdc232139f74fb9a95f21da07
SHA1 (patch-base_runtime_mach-dep_unix-prof.c) = 1f28a05cfb271c569cfb9778e67076bbfb14d646
SHA1 (patch-base_runtime_objs_mk.x86-netbsd) = 7d716c17c0f6a29acca7b630a1526df4d58e18cf
SHA1 (patch-config___arch-n-opsys) = b0c952b0b9ed6312a115761fdbd4c30aaa208b4c
SHA1 (patch-src_runtime_gc_gc-stats.h) = af61db9d1f04e566d4c5c2bc5dcf4c6958f0ea78
SHA1 (patch-src_runtime_gc_init-gc.c) = 5d1d5a13a51d732590dd4f375824bbc389a0525d

View file

@ -1,44 +0,0 @@
$NetBSD: patch-base_runtime_gc_gc-stats.h,v 1.1 2016/04/14 21:58:22 dholland Exp $
Use struct timeval instead of blithely assuming that some private
struct declaration is always bit compatible with it. (Because it
isn't.) From PR 40954.
--- base/runtime/gc/gc-stats.h.orig 2009-03-03 18:23:38.000000000 -0500
+++ base/runtime/gc/gc-stats.h 2009-03-03 18:25:04.000000000 -0500
@@ -16,6 +16,7 @@ extern void ReportVM (ml_state_t *msp, i
#define START_GC_PAUSE(HEAP) { \
if (StatsOn) { \
+ struct timeval tv; \
heap_t *__heap = (HEAP); \
stat_rec_t *__p = &(StatsBuf[NStatsRecs]); \
Unsigned32_t __n = (Addr_t)(msp->ml_allocPtr) - \
@@ -23,7 +24,10 @@ extern void ReportVM (ml_state_t *msp, i
CNTR_INCR(&(__heap->numAlloc), __n); \
__p->allocCnt = __heap->numAlloc; \
__p->numGens = 0; \
- gettimeofday(&(__p->startTime), NIL(struct timezone *)); \
+ gettimeofday(&tv, NIL(struct timezone *)); \
+ /* XXX breaks in 2038 */ \
+ __p->startTime.seconds = tv.tv_sec; \
+ __p->startTime.uSeconds = tv.tv_usec; \
} \
}
@@ -34,8 +38,11 @@ extern void ReportVM (ml_state_t *msp, i
#define STOP_GC_PAUSE() { \
if (StatsOn) { \
- gettimeofday(&(StatsBuf[NStatsRecs].stopTime), \
- NIL(struct timezone *)); \
+ struct timeval tv; \
+ gettimeofday(&tv, NIL(struct timezone *)); \
+ /* XXX breaks in 2038 */ \
+ StatsBuf[NStatsRecs].stopTime.seconds = tv.tv_sec; \
+ StatsBuf[NStatsRecs].stopTime.uSeconds = tv.tv_usec; \
STATS_FINISH(); \
} \
}

View file

@ -1,27 +0,0 @@
$NetBSD: patch-base_runtime_gc_init-gc.c,v 1.1 2016/04/14 21:58:22 dholland Exp $
Use struct timeval instead of blithely assuming that some private
struct declaration is always bit compatible with it. (Because it
isn't.) From PR 40954.
--- base/runtime/gc/init-gc.c.orig 2009-03-03 18:15:36.000000000 -0500
+++ base/runtime/gc/init-gc.c 2009-03-03 18:17:03.000000000 -0500
@@ -218,12 +218,16 @@ void InitHeap (ml_state_t *msp, bool_t i
#if defined(COLLECT_STATS)
if (StatsFD > 0) {
stat_hdr_t hdr;
+ struct timeval tv;
CNTR_ZERO(&(heap->numAlloc));
hdr.mask = STATMASK_ALLOC|STATMASK_NGENS|STATMASK_START|STATMASK_STOP;
hdr.isNewRuntime = 1;
hdr.allocSzB = params->allocSz;
hdr.numGens = params->numGens;
- gettimeofday (&(hdr.startTime), NIL(struct timezone *));
+ gettimeofday (&tv, NIL(struct timezone *));
+ /* XXX breaks in 2038 */
+ hdr.startTime.seconds = tv.tv_sec;
+ hdr.startTime.uSeconds = tv.tv_usec;
write (StatsFD, (char *)&hdr, sizeof(stat_hdr_t));
}
#endif

View file

@ -1,17 +0,0 @@
$NetBSD: patch-base_runtime_kernel_unix-timers.c,v 1.1 2016/04/14 21:58:22 dholland Exp $
Don't blithely assume that some internal type has the same layout as a
system type. It doesn't. Same issue as PR 40954, but a new case that I
either didn't find at the time or has appeared since.
--- base/runtime/kernel/unix-timers.c~ 2000-06-01 18:34:03.000000000 +0000
+++ base/runtime/kernel/unix-timers.c
@@ -18,7 +18,7 @@ typedef struct rusage time_struct_t;
#define GET_TIME(t) getrusage(RUSAGE_SELF, &(t))
#define SYS_TIME(t) ((t).ru_stime)
#define USR_TIME(t) ((t).ru_utime)
-#define SET_TIME(tp, t) { *((struct timeval *)(tp)) = (t); }
+#define SET_TIME(tp, t) { (tp)->seconds = (t).tv_sec; (tp)->uSeconds = (t).tv_usec; }
#else /* !HAS_GETRUSAGE */

View file

@ -1,15 +0,0 @@
$NetBSD: patch-base_runtime_mach-dep_unix-prof.c,v 1.1 2016/04/14 21:58:22 dholland Exp $
Use own abstractions correctly.
--- base/runtime/mach-dep/unix-prof.c~ 2005-01-18 17:58:39.000000000 +0000
+++ base/runtime/mach-dep/unix-prof.c
@@ -34,7 +34,7 @@ void EnableProfSignals ()
*/
void DisableProfSignals ()
{
- SIG_SetHandler (SIGVTALRM, SIG_DFL);
+ SIG_SetDefault (SIGVTALRM);
} /* end of DisableProfSignals */

View file

@ -1,24 +0,0 @@
$NetBSD: patch-base_runtime_objs_mk.x86-netbsd,v 1.2 2016/04/14 22:10:31 dholland Exp $
Configure for pkgsrc. Build as 32-bit.
--- base/runtime/objs/mk.x86-netbsd.orig 2015-04-22 07:11:37.000000000 +0000
+++ base/runtime/objs/mk.x86-netbsd
@@ -7,9 +7,10 @@ SHELL = /bin/sh
MAKE = gmake
+AS = as --32
ARFLAGS = Trcv
CC = gcc -ansi
-CFLAGS = -O2
+CFLAGS = -O2 -m32
CPP = gcc -x assembler-with-cpp -E -P
#CPP = /usr/bin/cpp -P
@@ -23,4 +24,4 @@ VERSION = v-x86-netbsd
RUNTIME = run.x86-netbsd
all:
- ($(MAKE) RUNTIME="$(RUNTIME)" VERSION="$(VERSION)" MAKE="$(MAKE)" CC="$(CC)" CFLAGS="$(CFLAGS)" CPP="$(CPP)" TARGET=$(TARGET) DEFS="$(DEFS)" XOBJS="$(XOBJS)" XLIBS="$(XLIBS)" LD_LIBS="$(LD_LIBS)" $(RUNTIME))
+ ($(MAKE) RUNTIME="$(RUNTIME)" VERSION="$(VERSION)" MAKE="$(MAKE)" AS="$(AS)" CC="$(CC)" CFLAGS="$(CFLAGS)" CPP="$(CPP)" TARGET=$(TARGET) DEFS="$(DEFS)" XOBJS="$(XOBJS)" XLIBS="$(XLIBS)" LD_LIBS="$(LD_LIBS)" $(RUNTIME))