summaryrefslogtreecommitdiff
blob: cbe73edf70f4b084f978d36e3af53dbac62d21b6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
--- ctcs/runin/src/chartst.c
+++ ctcs/runin/src/chartst.c
@@ -9,6 +9,7 @@
 #include <unistd.h>
 #include <stdlib.h>
 #include <signal.h>
+#include <string.h>
 
 void handler(int i) {
 	exit (0);
--- ctcs/runin/src/memtst.src/memtst.c
+++ ctcs/runin/src/memtst.src/memtst.c
@@ -4,7 +4,8 @@
 #include <sys/types.h>
 #include <unistd.h>
 #include <math.h>
-#include <malloc.h>
+#include <stdint.h>
+#include <string.h>
 #include "memtst.h"
 #include "memory.h"
 
@@ -347,7 +347,7 @@
 
 	/* Now compute the offset (in chars) of the error from the page
 	   boundary. */
-	fail_page_offset = ((int) (&nbuf[offset])) % PAGE_SIZE;
+	fail_page_offset = ((uintptr_t) (&nbuf[offset])) % PAGE_SIZE;
 
 	kmem_file = open("/proc/kcore",0);
 	if (kmem_file < 0) {
--- ctcs/runin/src/memtst.src/sizeofint.c
+++ ctcs/runin/src/memtst.src/sizeofint.c
@@ -1,6 +1,7 @@
 /* Jason continues to not use autoconf despite the fact he should. */
 
 #include <stdio.h>
+#include <stdlib.h>
 
 main ()
 {
--- ctcs/runin/src/Makefile
+++ ctcs/runin/src/Makefile
@@ -43,16 +43,16 @@
 	make -C memtst.src
 
 flushb: flushb.o ;
-	$(CC) $(CFLAGS) -o flushb flushb.o -lm
+	$(CC) $(CFLAGS) $(LDFLAGS) -o flushb flushb.o -lm
 
 random: random.o ;
-	$(CC) $(CFLAGS) -o random random.o -lm
+	$(CC) $(CFLAGS) $(LDFLAGS) -o random random.o -lm
 
 prandom: prandom.o ;
-	$(CC) $(CFLAGS) -o prandom prandom.o -lm
+	$(CC) $(CFLAGS) $(LDFLAGS) -o prandom prandom.o -lm
 
 chartst: chartst.o ;
-	$(CC) $(CFLAGS) -o chartst chartst.o -lm
+	$(CC) $(CFLAGS) $(LDFLAGS) -o chartst chartst.o -lm
 
 #kconfig: kconfig.o ;
 #	$(CC) $(CFLAGS) -o kconfig kconfig.o -lm
--- ctcs/runin/src/memtst.src/Makefile
+++ ctcs/runin/src/memtst.src/Makefile
@@ -8,18 +8,18 @@
 memtst_main: memtst;
 
 sizeofint: ;
-	$(CC) sizeofint.c -o sizeofint
+	$(CC) $(CFLAGS) $(LDFLAGS) sizeofint.c -o sizeofint
 
 sizeofint.h: sizeofint ;
 	sh -c "./sizeofint > sizeofint.h"
 
 maxalloc: sizeofint.h ;
-	$(CC) -Wall maxalloc.c -o maxalloc
+	$(CC) -Wall $(CFLAGS) $(LDFLAGS) maxalloc.c -o maxalloc
 
 memtst: sizeofint.h ;
 	$(CC) $(MEMTST_CFLAGS) -c memory.c -o memory.o
 	$(CC) $(MEMTST_CFLAGS) -c memtst.c -o memtst.o
-	$(CC) $(MEMTST_CFLAGS)  memtst_main.c memory.o memtst.o -o memtst
+	$(CC) $(MEMTST_CFLAGS) $(LDFLAGS) memtst_main.c memory.o memtst.o -o memtst
 
 clean:
 	rm -f *.o memtst maxalloc sizeofint.h sizeofint