Make size, strip, checksys use libcross, move strip back to bin, back out changes...
authorNick Downing <downing.nick@gmail.com>
Wed, 11 Jan 2017 14:09:56 +0000 (01:09 +1100)
committerNick Downing <downing.nick@gmail.com>
Wed, 11 Jan 2017 14:10:14 +0000 (01:10 +1100)
66 files changed:
.gitignore
bin/Makefile
bin/as/n.sh
bin/cc/n.sh
bin/include/a.out.h [deleted symlink]
bin/include/nlist.h [deleted symlink]
bin/include/sys/exec.h [deleted symlink]
bin/ld/ld.c
bin/n.sh
bin/nm/nm.c
bin/size.c
bin/strip.c [new file with mode: 0644]
bin/strip/Makefile [deleted file]
bin/strip/include/a.out.h [deleted symlink]
bin/strip/include/nlist.h [deleted symlink]
bin/strip/include/sys/exec.h [deleted symlink]
bin/strip/krcompat.h [deleted file]
bin/strip/n.sh [deleted file]
bin/strip/strip.c [deleted file]
include/a.out.h
include/nlist.h
include/ranlib.h
lib/c2/n.sh
lib/ccom/n.sh
lib/cpp/n.sh
lib/libc/gen/Makefile
lib/libc/gen/nlist.c
lib/libc/pdp/gen/nsym.c
n.sh
o.sh
p.sh
sys/GENERIC/Makefile
sys/GENERIC/include/a.out.h [deleted symlink]
sys/GENERIC/include/machine/machparam.h [deleted symlink]
sys/GENERIC/include/nlist.h [deleted symlink]
sys/GENERIC/include/sys/exec.h [deleted symlink]
sys/conf/checksys.c
sys/h/exec.h
sys/h/param.h
ucb/Makefile
ucb/krcompat.h [deleted file]
ucb/mkstr.c
ucb/pascal/eyacc/n.sh
ucb/pascal/pi/o.sh
ucb/pascal/pxp/o.sh
ucb/strcompact.c
ucb/symcompact.c
ucb/symdump.c
ucb/symorder.c
ucb/unifdef.c
ucb/xstr.c
usr.bin/lex/n.sh
usr.bin/ranlib/build.c
usr.bin/yacc/n.sh
usr.lib/libF77/Version.c
usr.lib/libcross/Makefile
usr.lib/libcross/copy.sed
usr.lib/libcross/n.sh
usr.lib/libcross/nsym.c
usr.lib/libcross/subset_sys_pdp/machparam.h [new file with mode: 0644]
usr.lib/libvmf/Makefile
usr.lib/libvmf/include/vmf.h [deleted symlink]
usr.lib/libvmf/n.sh
usr.sbin/named/named/version
usr.sbin/pstat/Makefile
usr.sbin/pstat/pstat.c

index ab0bf32..1a235f8 100644 (file)
@@ -62,7 +62,7 @@ bin/rmdir
 bin/sed/sed
 bin/sh/sh
 bin/size
-bin/strip/strip
+bin/strip
 bin/stty/stty
 bin/su
 bin/sync
index 048da98..38534b3 100644 (file)
@@ -13,7 +13,7 @@ SEPFLAG= -i
 # Programs that live in subdirectories, and have makefiles of their own.
 #
 AAASUBDIR=     adb ar as awk cc chflags chpass csh diff disklabel hostname ld login \
-       ls make nm passwd ping sed sh strip stty sysctl tcsh test tp
+       ls make nm passwd ping sed sh stty sysctl tcsh test tp
 
 # Shell scripts that need only be installed and are never removed.
 #
@@ -24,11 +24,11 @@ AAASCRIPT=  false true
 #
 AAASTD=        cat chgrp chmod cmp cp date dd du echo ed grep hostid \
        kill ln mkdir mt mv nice od pagesize pr \
-       pwd rm rmail rmdir size sync tar tee time who
+       pwd rm rmail rmdir sync tar tee time who
 
 # C programs that live in the current directory and need explicit make lines.
 #
-AAANSTD=       expr
+AAANSTD=       expr size strip
 
 # Programs that must run setuid to root
 #
@@ -105,6 +105,12 @@ depend:
 expr: expr.o
        ${CC} ${CFLAGS} ${SEPFLAG} -o expr expr.o
 
+size: size.o
+       ${CC} ${CFLAGS} ${SEPFLAG} -o size size.o ${LIBCROSS}
+
+strip: strip.o
+       ${CC} ${CFLAGS} ${SEPFLAG} -o strip strip.o ${LIBCROSS}
+
 # DO NOT DELETE THIS LINE -- make depend uses it
 
 cat.o: cat.c /home/nick/src/211bsd.git/stage/usr/include/stdio.h
@@ -331,16 +337,6 @@ rmail.o: /home/nick/src/211bsd.git/stage/usr/include/sys/types.h
 rmail.o: /home/nick/src/211bsd.git/stage/usr/include/sysexits.h
 rmail.o: /home/nick/src/211bsd.git/stage/usr/include/paths.h
 rmdir.o: rmdir.c /home/nick/src/211bsd.git/stage/usr/include/stdio.h
-size.o: size.c /home/nick/src/211bsd.git/stage/usr/include/a.out.h
-size.o: /home/nick/src/211bsd.git/stage/usr/include/sys/exec.h
-size.o: /home/nick/src/211bsd.git/stage/usr/include/sys/types.h
-size.o: /home/nick/src/211bsd.git/stage/usr/include/sys/select.h
-size.o: /home/nick/src/211bsd.git/stage/usr/include/sys/types.h
-size.o: /home/nick/src/211bsd.git/stage/usr/include/nlist.h
-size.o: /home/nick/src/211bsd.git/stage/usr/include/sys/types.h
-size.o: /home/nick/src/211bsd.git/stage/usr/include/stdio.h
-size.o: /home/nick/src/211bsd.git/stage/usr/include/stdlib.h
-size.o: /home/nick/src/211bsd.git/stage/usr/include/sys/types.h
 sync.o: sync.c
 tar.o: tar.c /home/nick/src/211bsd.git/stage/usr/include/stdio.h
 tar.o: /home/nick/src/211bsd.git/stage/usr/include/sys/param.h
@@ -402,6 +398,32 @@ who.o: /home/nick/src/211bsd.git/stage/usr/include/sys/types.h
 who.o: /home/nick/src/211bsd.git/stage/usr/include/unistd.h
 who.o: /home/nick/src/211bsd.git/stage/usr/include/sys/types.h
 
+size.o: size.c /home/nick/src/211bsd.git/stage/usr/include/stdio.h
+size.o: /home/nick/src/211bsd.git/stage/usr/include/stdlib.h
+size.o: /home/nick/src/211bsd.git/stage/usr/include/a.out.h
+size.o: /home/nick/src/211bsd.git/stage/usr/include/sys/exec.h
+size.o: /home/nick/src/211bsd.git/stage/usr/include/sys/types.h
+size.o: /home/nick/src/211bsd.git/stage/usr/include/sys/select.h
+size.o: /home/nick/src/211bsd.git/stage/usr/include/sys/types.h
+size.o: /home/nick/src/211bsd.git/stage/usr/include/nlist.h
+size.o: /home/nick/src/211bsd.git/stage/usr/include/sys/types.h
+size.o: /home/nick/src/211bsd.git/stage/usr/include/sys/types.h
+strip.o: strip.c /home/nick/src/211bsd.git/stage/usr/include/signal.h
+strip.o: /home/nick/src/211bsd.git/stage/usr/include/stdio.h
+strip.o: /home/nick/src/211bsd.git/stage/usr/include/stdlib.h
+strip.o: /home/nick/src/211bsd.git/stage/usr/include/sys/file.h
+strip.o: /home/nick/src/211bsd.git/stage/usr/include/fcntl.h
+strip.o: /home/nick/src/211bsd.git/stage/usr/include/sys/types.h
+strip.o: /home/nick/src/211bsd.git/stage/usr/include/sys/select.h
+strip.o: /home/nick/src/211bsd.git/stage/usr/include/sys/types.h
+strip.o: /home/nick/src/211bsd.git/stage/usr/include/unistd.h
+strip.o: /home/nick/src/211bsd.git/stage/usr/include/sys/types.h
+strip.o: /home/nick/src/211bsd.git/stage/usr/include/a.out.h
+strip.o: /home/nick/src/211bsd.git/stage/usr/include/sys/exec.h
+strip.o: /home/nick/src/211bsd.git/stage/usr/include/sys/types.h
+strip.o: /home/nick/src/211bsd.git/stage/usr/include/nlist.h
+strip.o: /home/nick/src/211bsd.git/stage/usr/include/sys/types.h
+strip.o: /home/nick/src/211bsd.git/stage/usr/include/sys/types.h
 mail.o: mail.c /home/nick/src/211bsd.git/stage/usr/include/sys/param.h
 mail.o: /home/nick/src/211bsd.git/stage/usr/include/sys/localopts.h
 mail.o: /home/nick/src/211bsd.git/stage/usr/include/sys/stddef.h
index cfb16d4..5bb6a61 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 ROOT="`pwd |sed -e 's/\/bin\/as$//'`"
-HOSTCC="cc -g -Iinclude -Wall -Wno-char-subscripts -Wno-deprecated-declarations -Wno-format -Wno-maybe-uninitialized -Wno-parentheses -Wno-unused-result"
+HOSTCC="cc -g -I$ROOT/cross/usr/include -L$ROOT/cross/usr/lib/ -Wall -Wno-char-subscripts -Wno-deprecated-declarations -Wno-format -Wno-maybe-uninitialized -Wno-parentheses -Wno-unused-result"
 INSTALL="$ROOT/scripts/install.sh --strip-program=/bin/true"
 MANROFF="nroff -man"
 mkdir --parents "$ROOT/cross/bin"
index d92442b..00cb42b 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 ROOT="`pwd |sed -e 's/\/bin\/cc$//'`"
-HOSTCC="cc -g -Iinclude -Wall -Wno-char-subscripts -Wno-deprecated-declarations -Wno-format -Wno-maybe-uninitialized -Wno-parentheses -Wno-unused-result"
+HOSTCC="cc -g -I$ROOT/cross/usr/include -L$ROOT/cross/usr/lib/ -Wall -Wno-char-subscripts -Wno-deprecated-declarations -Wno-format -Wno-maybe-uninitialized -Wno-parentheses -Wno-unused-result"
 INSTALL="$ROOT/scripts/install.sh --strip-program=/bin/true"
 MANROFF="nroff -man"
 mkdir --parents "$ROOT/cross/bin"
diff --git a/bin/include/a.out.h b/bin/include/a.out.h
deleted file mode 120000 (symlink)
index 7cb9895..0000000
+++ /dev/null
@@ -1 +0,0 @@
-../../include/a.out.h
\ No newline at end of file
diff --git a/bin/include/nlist.h b/bin/include/nlist.h
deleted file mode 120000 (symlink)
index 1148fd2..0000000
+++ /dev/null
@@ -1 +0,0 @@
-../../include/nlist.h
\ No newline at end of file
diff --git a/bin/include/sys/exec.h b/bin/include/sys/exec.h
deleted file mode 120000 (symlink)
index 01bc5c7..0000000
+++ /dev/null
@@ -1 +0,0 @@
-../../../sys/h/exec.h
\ No newline at end of file
index b64a91c..0a6cffb 100644 (file)
@@ -77,7 +77,6 @@ static char *sccsid = "@(#)ld.c       4.6 1998/01/19";
 #include <sys/types.h> /* work around bug in original 2.11BSD ranlib.h */
 #include <ranlib.h>
 #define cross_ar_hdr ar_hdr
-#define cross_exec exec
 #define cross_int_t int
 #define cross_nlist nlist
 #define cross_off_t off_t
index 67bd9b2..34db510 100755 (executable)
--- a/bin/n.sh
+++ b/bin/n.sh
@@ -1,8 +1,9 @@
 #!/bin/sh
 ROOT="`pwd |sed -e 's/\/bin$//'`"
-HOSTCC="cc -g -Iinclude -Wall -Wno-char-subscripts -Wno-deprecated-declarations -Wno-format -Wno-maybe-uninitialized -Wno-parentheses -Wno-unused-result"
+HOSTCC="cc -I$ROOT/cross/usr/include -L$ROOT/cross/usr/lib -DCROSS -Wall -Wno-char-subscripts -Wno-deprecated-declarations -Wno-format -Wno-maybe-uninitialized -Wno-parentheses -Wno-unused-result"
+HOSTLIBCROSS="-lcross"
 INSTALL="$ROOT/scripts/install.sh --strip-program=/bin/true"
 MANROFF="nroff -man"
 mkdir --parents "$ROOT/cross/bin"
-make CC="$HOSTCC" MANROFF="$MANROFF" SEPFLAG= size && \
-install -s size -m 755 "$ROOT/cross/bin"
+make CC="$HOSTCC" LIBCROSS="$HOSTLIBCROSS" MANROFF="$MANROFF" SEPFLAG= size strip && \
+install -s size strip -m 755 "$ROOT/cross/bin"
index c70d197..d5ab32f 100755 (executable)
@@ -22,7 +22,6 @@ static        char sccsid[] = "@(#)nm.c 2.11BSD 1/22/94";
 #include <ar.h>
 #include <sys/types.h>
 #define cross_ar_hdr ar_hdr
-#define cross_exec exec
 #define cross_nlist nlist
 #define cross_off_t off_t
 #define cross_xexec xexec
index fe4efab..c823931 100644 (file)
@@ -6,33 +6,31 @@ static        char *sccsid = "@(#)size.c      4.4.1 (2.11BSD GTE) 1/1/94";
  * size
  */
 
-#include <a.out.h>
 #include <stdio.h>
 #include <stdlib.h>
 
-#ifdef pdp11
-#include <sys/types.h>
-#define OFF_T off_t
+#ifdef CROSS
+#include "cross/a.out.h"
+#include "cross/sys/types.h"
 #else
-#include <stdint.h>
-#define OFF_T int32_t
+#include <a.out.h>
+#include <sys/types.h>
+#define cross_exec exec
+#define cross_off_t off_t
+#define cross_ovlhdr ovlhdr
 #endif
 
 int    header;
 
 int main(argc, argv) int argc; char **argv; {
-#ifndef pdp11
-       /* note: must be at least as large as struct exec */
-       char temp[sizeof(struct ovlhdr)];
-#endif
-       struct exec buf;
-       OFF_T sum;
+       struct cross_exec buf;
+       cross_off_t sum;
        int gorp,i;
        int err = 0;
        FILE *f;
 #if 1 /*def pdp11 for cross compilation always assume target is pdp11 */
-       struct ovlhdr   ovlbuf;         /* overlay structure */
-       OFF_T   coresize;               /* total text size */
+       struct cross_ovlhdr     ovlbuf;         /* overlay structure */
+       cross_off_t     coresize;               /* total text size */
        short   skip;                   /* skip over overlay sizes of 0 */
 #endif
 
@@ -49,23 +47,20 @@ int main(argc, argv) int argc; char **argv; {
                        err++;
                        continue;
                }
-#ifdef pdp11
-               if (fread((char *)&buf, sizeof(buf), 1, f) != 1 ||
-                   N_BADMAG(buf)) {
-#else
-               if (fread(temp, sizeof(buf), 1, f) != 1)
+               if (fread((char *)&buf, sizeof(buf), 1, f) != 1)
                        goto bad_read;
-               buf.a_magic = (temp[0] & 0xff) | ((temp[1] & 0xff) << 8);
-               buf.a_text = (temp[2] & 0xff) | ((temp[3] & 0xff) << 8);
-               buf.a_data = (temp[4] & 0xff) | ((temp[5] & 0xff) << 8);
-               buf.a_bss = (temp[6] & 0xff) | ((temp[7] & 0xff) << 8);
-               buf.a_syms = (temp[8] & 0xff) | ((temp[9] & 0xff) << 8);
-               buf.a_entry = (temp[10] & 0xff) | ((temp[11] & 0xff) << 8);
-               buf.a_unused = (temp[12] & 0xff) | ((temp[13] & 0xff) << 8);
-               buf.a_flag = (temp[14] & 0xff) | ((temp[15] & 0xff) << 8);
+#ifdef CROSS
+               buf.a_magic = cross_read_int((char *)&buf.a_magic);
+               buf.a_text = cross_read_uint((char *)&buf.a_text);
+               buf.a_data = cross_read_uint((char *)&buf.a_data);
+               buf.a_bss = cross_read_uint((char *)&buf.a_bss);
+               buf.a_syms = cross_read_uint((char *)&buf.a_syms);
+               buf.a_entry = cross_read_uint((char *)&buf.a_entry);
+               buf.a_unused = cross_read_uint((char *)&buf.a_unused);
+               buf.a_flag = cross_read_uint((char *)&buf.a_flag);
+#endif
                if (N_BADMAG(buf)) {
                bad_read:
-#endif
                        printf("size: %s not an object file\n", *argv);
                        fclose(f);
                        err++;
@@ -76,26 +71,22 @@ int main(argc, argv) int argc; char **argv; {
                        header = 1;
                }
                printf("%u\t%u\t%u\t", buf.a_text,buf.a_data,buf.a_bss);
-               sum = (OFF_T) buf.a_text + (OFF_T) buf.a_data + (OFF_T) buf.a_bss;
+               sum = (cross_off_t) buf.a_text + (cross_off_t) buf.a_data + (cross_off_t) buf.a_bss;
                printf("%ld\t%lx", sum, sum);
                if (gorp>2)
                        printf("\t%s", *argv);
 #if 1 /*def pdp11 for cross compilation always assume target is pdp11 */
                if (buf.a_magic == A_MAGIC5 || buf.a_magic == A_MAGIC6) {
-#ifdef pdp11
                        if (fread(&ovlbuf,sizeof(ovlbuf),1,f) != 1)
-#else
-                       if (fread(temp,sizeof(ovlbuf),1,f) != 1)
-#endif
                        {
                                printf("size: %s not an overlay file\n", *argv);
                                err++;
                                continue;
                        }
-#ifndef pdp11
-                       ovlbuf.max_ovl = (temp[0] & 0xff) | ((temp[1] & 0xff) << 8);
+#ifdef CROSS
+                       ovlbuf.max_ovl = cross_read_int((char *)&ovlbuf.max_ovl);
                        for (i = 0; i < NOVL; ++i)
-                               ovlbuf.ov_siz[i] = (temp[i * 2 + 2] & 0xff) | ((temp[i * 2 + 3] & 0xff) << 8);
+                               ovlbuf.ov_siz[i] = cross_read_uint((char *)(ovlbuf.ov_siz + i));
 #endif
                        coresize = buf.a_text;
                        for (i = 0; i < NOVL; i++)
diff --git a/bin/strip.c b/bin/strip.c
new file mode 100644 (file)
index 0000000..aa099cd
--- /dev/null
@@ -0,0 +1,118 @@
+/*
+ * Copyright (c) 1983 Regents of the University of California.
+ * All rights reserved.  The Berkeley software License Agreement
+ * specifies the terms and conditions for redistribution.
+ */
+
+#if    defined(DOSCCS) && !defined(lint)
+char copyright[] =
+"@(#) Copyright (c) 1983 Regents of the University of California.\n\
+ All rights reserved.\n";
+
+static char sccsid[] = "@(#)strip.c    5.1.1 (2.11BSD GTE) 1/1/94";
+#endif
+
+#include <signal.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/file.h>
+#include <unistd.h>
+
+#ifdef CROSS
+#include "cross/a.out.h"
+#include "cross/sys/types.h"
+#else
+#include <a.out.h>
+#include <sys/types.h>
+#define cross_off_t off_t
+#define cross_xexec xexec
+#endif
+
+struct cross_xexec head;
+int    status;
+
+#ifndef __P
+#ifdef __STDC__
+#define __P(params) params
+#else
+#define __P(params) ()
+#endif
+#endif
+
+int main __P((int argc, char *argv[]));
+void strip __P((char *name));
+
+int main(argc, argv) int argc; char *argv[]; {
+       register int i;
+
+       signal(SIGHUP, SIG_IGN);
+       signal(SIGINT, SIG_IGN);
+       signal(SIGQUIT, SIG_IGN);
+       for (i = 1; i < argc; i++) {
+               strip(argv[i]);
+               if (status > 1)
+                       break;
+       }
+       exit(status);
+}
+
+void strip(name) char *name; {
+       register int f;
+#ifdef CROSS
+       int i;
+#endif
+       cross_off_t size;
+
+       f = open(name, O_RDWR);
+       if (f < 0) {
+               fprintf(stderr, "strip: "); perror(name);
+               status = 1;
+               goto out;
+       }
+       if (read(f, (char *)&head, sizeof (head)) < 0)
+               goto bad_read;
+#ifdef CROSS
+       head.e.a_magic = cross_read_int((char *)&head.e.a_magic);
+       head.e.a_text = cross_read_uint((char *)&head.e.a_text);
+       head.e.a_data = cross_read_uint((char *)&head.e.a_data);
+       head.e.a_bss = cross_read_uint((char *)&head.e.a_bss);
+       head.e.a_syms = cross_read_uint((char *)&head.e.a_syms);
+       head.e.a_entry = cross_read_uint((char *)&head.e.a_entry);
+       head.e.a_unused = cross_read_uint((char *)&head.e.a_unused);
+       head.e.a_flag = cross_read_uint((char *)&head.e.a_flag);
+       head.o.max_ovl = cross_read_int((char *)&head.o.max_ovl);
+       for (i = 0; i < NOVL; ++i)
+               head.o.ov_siz[i] = cross_read_uint((char *)(head.o.ov_siz + i));
+#endif
+       if (N_BADMAG(head.e)) {
+       bad_read:
+               printf("strip: %s not in a.out format\n", name);
+               status = 1;
+               goto out;
+       }
+       if ((head.e.a_syms == 0) && ((head.e.a_flag & 1) != 0))
+               goto out;
+
+       size = N_DATOFF(head) + head.e.a_data;
+       head.e.a_syms = 0;
+       head.e.a_flag |= 1;
+       if (ftruncate(f, (off_t)size) < 0) {
+               fprintf(stderr, "strip: "); perror(name);
+               status = 1;
+               goto out;
+       }
+       (void) lseek(f, (off_t)0, L_SET);
+#ifdef CROSS
+       cross_write_int((char *)&head.e.a_magic, head.e.a_magic);
+       cross_write_uint((char *)&head.e.a_text, head.e.a_text);
+       cross_write_uint((char *)&head.e.a_data, head.e.a_data);
+       cross_write_uint((char *)&head.e.a_bss, head.e.a_bss);
+       cross_write_uint((char *)&head.e.a_syms, head.e.a_syms);
+       cross_write_uint((char *)&head.e.a_entry, head.e.a_entry);
+       cross_write_uint((char *)&head.e.a_unused, head.e.a_unused);
+       cross_write_uint((char *)&head.e.a_flag, head.e.a_flag);
+#endif
+       (void) write(f, (char *)&head.e, sizeof (head.e));
+out:
+       close(f);
+}
diff --git a/bin/strip/Makefile b/bin/strip/Makefile
deleted file mode 100644 (file)
index b2a3d01..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-INSTALL=install
-# using VPATH to compile ./nsym.o from ../../lib/libc/pdp/gen/nsym.c does not
-# work if there is a ../../lib/libc.pdp/gen/nsym.o leftover from building libc
-#VPATH=../../lib/libc/pdp/gen
-SRCS=strip.c ../../lib/libc/pdp/gen/nsym.c
-OBJS=strip.o ../../lib/libc/pdp/gen/nsym.o
-
-CFLAGS=-O
-SEPFLAG=-i
-
-all:   strip
-
-strip: ${OBJS}
-       ${CC} ${SEPFLAG} -o strip ${OBJS}
-
-# 'strip' is handled specially because '${INSTALL} -s' now uses 'strip' and
-# thus we can't do a '${INSTALL} -s strip /bin/strip' without an error.
-#
-install: all
-       -${INSTALL} -s -m 751 -g staff strip ${DESTDIR}/bin/xstrip
-       -mv ${DESTDIR}/bin/xstrip ${DESTDIR}/bin/strip
-
-lint:
-       lint -havx -I../ar ${SRCS}
-
-clean:
-       rm -f ${OBJS} *.0 strip
diff --git a/bin/strip/include/a.out.h b/bin/strip/include/a.out.h
deleted file mode 120000 (symlink)
index 9dd9aa8..0000000
+++ /dev/null
@@ -1 +0,0 @@
-../../../include/a.out.h
\ No newline at end of file
diff --git a/bin/strip/include/nlist.h b/bin/strip/include/nlist.h
deleted file mode 120000 (symlink)
index 0c27973..0000000
+++ /dev/null
@@ -1 +0,0 @@
-../../../include/nlist.h
\ No newline at end of file
diff --git a/bin/strip/include/sys/exec.h b/bin/strip/include/sys/exec.h
deleted file mode 120000 (symlink)
index 0f3c005..0000000
+++ /dev/null
@@ -1 +0,0 @@
-../../../../sys/h/exec.h
\ No newline at end of file
diff --git a/bin/strip/krcompat.h b/bin/strip/krcompat.h
deleted file mode 100644 (file)
index b5c0b7d..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-#ifndef _KRCOMPAT_H
-#define _KRCOMPAT_H 1
-
-#undef PARAMS
-#ifdef __STDC__
-#include <stdarg.h>
-#define VA_START(ap, arg) va_start(ap, arg)
-#define PARAMS(args) args
-#else
-#include <varargs.h>
-#define VA_START(ap, arg) va_start(ap)
-#define PARAMS(args) ()
-#endif
-
-#ifdef __GNUC__
-#define NORETURN __attribute__ ((noreturn))
-#else
-#define NORETURN
-#endif
-
-#endif
diff --git a/bin/strip/n.sh b/bin/strip/n.sh
deleted file mode 100755 (executable)
index 252c4f0..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/sh
-ROOT="`pwd |sed -e 's/\/bin\/strip$//'`"
-HOSTCC="cc -g -Iinclude -Wall -Wno-char-subscripts -Wno-deprecated-declarations -Wno-format -Wno-maybe-uninitialized -Wno-parentheses -Wno-unused-result"
-INSTALL="$ROOT/scripts/install.sh --strip-program=/bin/true"
-MANROFF="nroff -man"
-mkdir --parents "$ROOT/cross/bin"
-make CC="$HOSTCC" MANROFF="$MANROFF" SEPFLAG= && \
-make INSTALL="$INSTALL" DESTDIR="$ROOT/cross" install
diff --git a/bin/strip/strip.c b/bin/strip/strip.c
deleted file mode 100644 (file)
index da649bb..0000000
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * Copyright (c) 1983 Regents of the University of California.
- * All rights reserved.  The Berkeley software License Agreement
- * specifies the terms and conditions for redistribution.
- */
-
-#if    defined(DOSCCS) && !defined(lint)
-char copyright[] =
-"@(#) Copyright (c) 1983 Regents of the University of California.\n\
- All rights reserved.\n";
-
-static char sccsid[] = "@(#)strip.c    5.1.1 (2.11BSD GTE) 1/1/94";
-#endif
-
-#include <a.out.h>
-#include <signal.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <sys/file.h>
-#include <unistd.h>
-#include "krcompat.h"
-
-#ifdef pdp11
-#include <sys/types.h>
-#define OFF_T off_t
-#else
-#include <stdint.h>
-#define OFF_T int32_t
-#endif
-
-struct xexec head;
-int    status;
-
-int main PARAMS((int argc, char *argv[]));
-void strip PARAMS((char *name));
-
-int main(argc, argv) int argc; char *argv[]; {
-       register int i;
-
-       signal(SIGHUP, SIG_IGN);
-       signal(SIGINT, SIG_IGN);
-       signal(SIGQUIT, SIG_IGN);
-       for (i = 1; i < argc; i++) {
-               strip(argv[i]);
-               if (status > 1)
-                       break;
-       }
-       exit(status);
-}
-
-void strip(name) char *name; {
-       register int f;
-#ifndef pdp11
-       char temp[sizeof (struct xexec)];
-       int i;
-#endif
-       OFF_T size;
-
-       f = open(name, O_RDWR);
-       if (f < 0) {
-               fprintf(stderr, "strip: "); perror(name);
-               status = 1;
-               goto out;
-       }
-#ifdef pdp11
-       if (read(f, (char *)&head, sizeof (head)) < 0)
-#else
-       if (read(f, temp, sizeof (head)) < 0)
-#endif
-               goto bad_read;
-#ifndef pdp11
-       head.e.a_magic = (temp[0] & 0xff) | ((temp[1] & 0xff) << 8);
-       head.e.a_text = (temp[2] & 0xff) | ((temp[3] & 0xff) << 8);
-       head.e.a_data = (temp[4] & 0xff) | ((temp[5] & 0xff) << 8);
-       head.e.a_bss = (temp[6] & 0xff) | ((temp[7] & 0xff) << 8);
-       head.e.a_syms = (temp[8] & 0xff) | ((temp[9] & 0xff) << 8);
-       head.e.a_entry = (temp[10] & 0xff) | ((temp[11] & 0xff) << 8);
-       head.e.a_unused = (temp[12] & 0xff) | ((temp[13] & 0xff) << 8);
-       head.e.a_flag = (temp[14] & 0xff) | ((temp[15] & 0xff) << 8);
-       head.o.max_ovl = (temp[16] & 0xff) | ((temp[17] & 0xff) << 8);
-       for (i = 0; i < NOVL; ++i)
-               head.o.ov_siz[i] = (temp[i * 2 + 18] & 0xff) | ((temp[i * 2 + 19] & 0xff) << 8);
-#endif
-       if (N_BADMAG(head.e)) {
-       bad_read:
-               printf("strip: %s not in a.out format\n", name);
-               status = 1;
-               goto out;
-       }
-       if ((head.e.a_syms == 0) && ((head.e.a_flag & 1) != 0))
-               goto out;
-
-       size = N_DATOFF(head) + head.e.a_data;
-       head.e.a_syms = 0;
-       head.e.a_flag |= 1;
-       if (ftruncate(f, (off_t)size) < 0) {
-               fprintf(stderr, "strip: "); perror(name);
-               status = 1;
-               goto out;
-       }
-       (void) lseek(f, (off_t)0, L_SET);
-#ifdef pdp11
-       (void) write(f, (char *)&head.e, sizeof (head.e));
-#else
-       /*temp[0] = head.e.a_magic & 0xff;
-       temp[1] = (head.e.a_magic >> 8) & 0xff;
-       temp[2] = head.e.a_text & 0xff;
-       temp[3] = (head.e.a_text >> 8) & 0xff;
-       temp[4] = head.e.a_data & 0xff;
-       temp[5] = (head.e.a_data >> 8) & 0xff;
-       temp[6] = head.e.a_bss & 0xff;
-       temp[7] = (head.e.a_bss >> 8) & 0xff;*/
-       temp[8] = head.e.a_syms & 0xff;
-       temp[9] = (head.e.a_syms >> 8) & 0xff;
-       /*temp[10] = head.e.a_entry & 0xff;
-       temp[11] = (head.e.a_entry >> 8) & 0xff;
-       temp[12] = head.e.a_unused & 0xff;
-       temp[13] = (head.e.a_unused >> 8) & 0xff;*/
-       temp[14] = head.e.a_flag & 0xff;
-       temp[15] = (head.e.a_flag >> 8) & 0xff;
-       (void) write(f, temp, sizeof (head.e));
-#endif
-out:
-       close(f);
-}
index 0f25a91..50f1754 100644 (file)
 
 #include <sys/exec.h>
 
-#ifdef pdp11
-#include <sys/types.h>
-#define _OFF_T off_t
-#else
-#include <stdint.h>
-#define _OFF_T int32_t
-#endif
-
 #define        N_BADMAG(x) \
        (((x).a_magic)!=A_MAGIC1 && ((x).a_magic)!=A_MAGIC2 && \
        ((x).a_magic)!=A_MAGIC3 && ((x).a_magic)!=A_MAGIC4 && \
  * must pass an extended header ('xexec') as the argument.
 */
 
-#undef PARAMS
-#ifdef __STDC__
-#define PARAMS(args) args
-#else
-#define PARAMS(args) ()
-#endif
-
-_OFF_T n_stroff PARAMS((register struct xexec *ep));
-_OFF_T n_datoff PARAMS((register struct xexec *ep));
-_OFF_T n_dreloc PARAMS((register struct xexec *ep));
-_OFF_T n_treloc PARAMS((register struct xexec *ep));
-_OFF_T n_symoff PARAMS((register struct xexec *ep));
+#include <sys/types.h>
 
-#define        N_STROFF(e) (n_stroff((struct xexec *)&e))
-#define        N_SYMOFF(e) (n_symoff((struct xexec *)&e))
-#define        N_DATOFF(e) (n_datoff((struct xexec *)&e))
-#define        N_DRELOC(e) (n_dreloc((struct xexec *)&e))
-#define        N_TRELOC(e) (n_treloc((struct xexec *)&e))
+off_t  n_stroff(), n_symoff(), n_datoff(), n_dreloc(), n_treloc();
 
-#undef _OFF_T
+#define        N_STROFF(e) (n_stroff(&e))
+#define        N_SYMOFF(e) (n_symoff(&e))
+#define        N_DATOFF(e) (n_datoff(&e))
+#define        N_DRELOC(e) (n_dreloc(&e))
+#define        N_TRELOC(e) (n_treloc(&e))
 
-/* is nlist.h ever used without _AOUT_INCLUDE_? if so it's broken on 64-bit */
-/*#define      _AOUT_INCLUDE_*/
+#define        _AOUT_INCLUDE_
 #include <nlist.h>
 
 #endif /* !_AOUT_H_ */
index a99f6c9..0d7019c 100644 (file)
@@ -24,7 +24,7 @@
  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS _INTERRUPTION)
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 
 #ifndef        _NLIST_H_
 #define        _NLIST_H_
-
-/* note u_int was never standardized and should be changed to unsigned int */
 #include <sys/types.h>
-#ifdef pdp11
-#define _OFF_T off_t
-#define _INT int
-#define _UNSIGNED_INT unsigned int
-#define _U_INT u_int
-#else
-#include <stdint.h>
-#define _OFF_T int32_t
-#define _INT int16_t
-#define _UNSIGNED_INT uint16_t
-#define _U_INT uint16_t
-#endif
 
 /*
  * Symbol table entry format.  The #ifdef's are so that programs including
 
 struct oldnlist {              /* XXX - compatibility/conversion aid */
        char    n_name[8];      /* symbol name */
-       _INT    n_type;         /* type flag */
-_UNSIGNED_INT  n_value;        /* value */
+       int     n_type;         /* type flag */
+unsigned int   n_value;        /* value */
 };
 
 struct nlist {
-/* is nlist.h ever used without _AOUT_INCLUDE_? if so it's broken on 64-bit */
-#if 1 /*def    _AOUT_INCLUDE_*/
+#ifdef _AOUT_INCLUDE_
        union {
-/* we do not support n_name when cross compiling, it breaks on 64-bit hosts */
-#ifdef pdp11
                char *n_name;   /* In memory address of symbol name */
-#endif
-               _OFF_T n_strx;  /* String table offset (file) */
+               off_t n_strx;   /* String table offset (file) */
        } n_un;
 #else
        char    *n_name;        /* symbol name (in memory) */
@@ -78,7 +60,7 @@ struct        nlist {
 #endif
        u_char  n_type;         /* Type of symbol - see below */
        char    n_ovly;         /* Overlay number */
-       _U_INT  n_value;        /* Symbol value */
+       u_int   n_value;        /* Symbol value */
 };
 
 /*
@@ -96,10 +78,4 @@ struct       nlist {
 #define        N_TYPE  0x1f            /* mask for all the type bits */
 
 #define        N_FORMAT        "%06o"  /* namelist value format; XXX */
-
-#undef _OFF_T
-#undef _INT
-#undef _UNSIGNED_INT
-#undef _U_INT
-
 #endif /* !_NLIST_H_ */
index 2e4224a..d05873f 100644 (file)
 #ifndef _RANLIB_H_
 #define        _RANLIB_H_
 
-#ifdef pdp11
-#include <sys/types.h>
-#define _OFF_T off_t
-#else
-#include <stdint.h>
-#define _OFF_T int32_t
-#endif
-
 #define        RANLIBMAG       "__.SYMDEF"     /* archive file name */
 #define        RANLIBSKEW      3               /* creation time offset */
 
 struct ranlib {
        union {
-               _OFF_T ran_strx;                /* string table index */
-/* we do not support ran_name when cross compiling, it breaks on 64-bit hosts */
-#ifdef pdp11
+               off_t ran_strx;         /* string table index */
                char *ran_name;         /* in memory symbol name */
-#endif
        } ran_un;
-       _OFF_T ran_off;                 /* archive file offset */
+       off_t ran_off;                  /* archive file offset */
 };
 
-#undef _OFF_T
-
 #endif /* !_RANLIB_H_ */
index 745ae73..a48355e 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 ROOT="`pwd |sed -e 's/\/lib\/c2$//'`"
-HOSTCC="cc -g -Iinclude -Wall -Wno-char-subscripts -Wno-deprecated-declarations -Wno-format -Wno-maybe-uninitialized -Wno-parentheses -Wno-unused-result"
+HOSTCC="cc -g -I$ROOT/cross/usr/include -L$ROOT/cross/usr/lib/ -Wall -Wno-char-subscripts -Wno-deprecated-declarations -Wno-format -Wno-maybe-uninitialized -Wno-parentheses -Wno-unused-result"
 INSTALL="$ROOT/scripts/install.sh --strip-program=/bin/true"
 MANROFF="nroff -man"
 mkdir --parents "$ROOT/cross/lib"
index 40cd006..5575176 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 ROOT="`pwd |sed -e 's/\/lib\/ccom$//'`"
-HOSTCC="cc -g -Iinclude -Wall -Wno-char-subscripts -Wno-deprecated-declarations -Wno-format -Wno-maybe-uninitialized -Wno-parentheses -Wno-unused-result"
+HOSTCC="cc -g -I$ROOT/cross/usr/include -L$ROOT/cross/usr/lib/ -Wall -Wno-char-subscripts -Wno-deprecated-declarations -Wno-format -Wno-maybe-uninitialized -Wno-parentheses -Wno-unused-result"
 INSTALL="$ROOT/scripts/install.sh --strip-program=/bin/true"
 MANROFF="nroff -man"
 mkdir --parents "$ROOT/cross/lib"
index ac3f1d6..314f3cf 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 ROOT="`pwd |sed -e 's/\/lib\/cpp$//'`"
-HOSTCC="cc -g -Iinclude -Wall -Wno-char-subscripts -Wno-deprecated-declarations -Wno-format -Wno-maybe-uninitialized -Wno-parentheses -Wno-unused-result"
+HOSTCC="cc -g -I$ROOT/cross/usr/include -L$ROOT/cross/usr/lib/ -Wall -Wno-char-subscripts -Wno-deprecated-declarations -Wno-format -Wno-maybe-uninitialized -Wno-parentheses -Wno-unused-result"
 INSTALL="$ROOT/scripts/install.sh --strip-program=/bin/true"
 MANROFF="nroff -man"
 mkdir --parents "$ROOT/cross/lib"
index a217983..35c63a2 100644 (file)
@@ -422,9 +422,6 @@ nlist.o: /home/nick/src/211bsd.git/stage/usr/include/sys/types.h
 nlist.o: /home/nick/src/211bsd.git/stage/usr/include/nlist.h
 nlist.o: /home/nick/src/211bsd.git/stage/usr/include/sys/types.h
 nlist.o: /home/nick/src/211bsd.git/stage/usr/include/stdio.h
-nlist.o: /home/nick/src/211bsd.git/stage/usr/include/string.h
-nlist.o: /home/nick/src/211bsd.git/stage/usr/include/sys/types.h
-nlist.o: /home/nick/src/211bsd.git/stage/usr/include/sys/types.h
 opendir.o: opendir.c /home/nick/src/211bsd.git/stage/usr/include/sys/param.h
 opendir.o: /home/nick/src/211bsd.git/stage/usr/include/sys/localopts.h
 opendir.o: /home/nick/src/211bsd.git/stage/usr/include/sys/stddef.h
index a4443f0..e733f47 100644 (file)
@@ -25,40 +25,21 @@ static char sccsid[] = "@(#)nlist.c 5.7.1 (2.11BSD GTE) 12/31/93";
 #include <sys/file.h>
 #include <a.out.h>
 #include <stdio.h>
-#include <string.h>
 
-#ifdef pdp11
-#include <sys/types.h>
-#define OFF_T off_t
-#else
-#include <stdint.h>
-#define OFF_T int32_t
-#endif
-
-#ifdef pdp11
-#define N_NAME(sp) ((sp)->n_un.n_name)
-#define ISVALID(sp) ((sp)->n_un.n_name && (sp)->n_un.n_name[0])
-#else
-#define N_NAME(sp) (strtab + (sp)->n_un.n_strx)
-#define ISVALID(sp) ((sp)->n_un.n_strx >= 0 && strtab[(sp)->n_un.n_strx])
-#endif
+typedef struct nlist NLIST;
+#define        _strx   n_un.n_strx
+#define        _name   n_un.n_name
+#define        ISVALID(p)      (p->_name && p->_name[0])
 
-#ifdef pdp11
-int nlist(name, list) char *name; struct nlist *list;
-#else
-int nlist(name, list, strtab) char *name; struct nlist *list; char *strtab;
-#endif
+nlist(name, list)
+       char *name;
+       NLIST *list;
 {
-       register struct nlist *p, *s;
-#ifndef pdp11
-       /* note: must be at least as large as struct nlist */
-       char temp[sizeof(struct xexec)];
-       int i;
-#endif
+       register NLIST *p, *s;
        struct xexec ebuf;
        FILE *fstr, *fsym;
-       struct nlist nbuf;
-       OFF_T strings_offset, symbol_offset, symbol_size, lseek();
+       NLIST nbuf;
+       off_t strings_offset, symbol_offset, symbol_size, lseek();
        int entries, len, maxlen;
        char sbuf[128];
 
@@ -66,32 +47,14 @@ int nlist(name, list, strtab) char *name; struct nlist *list; char *strtab;
 
        if (!(fsym = fopen(name, "r")))
                return(-1);
-#ifdef pdp11
-       if (fread((char *)&ebuf, sizeof(ebuf), 1, fsym) != 1)
-#else
-       if (fread(temp, sizeof(ebuf), 1, fsym) != 1)
-#endif
-               goto done1;
-#ifndef pdp11
-       ebuf.e.a_magic = (temp[0] & 0xff) | ((temp[1] & 0xff) << 8);
-       ebuf.e.a_text = (temp[2] & 0xff) | ((temp[3] & 0xff) << 8);
-       ebuf.e.a_data = (temp[4] & 0xff) | ((temp[5] & 0xff) << 8);
-       ebuf.e.a_bss = (temp[6] & 0xff) | ((temp[7] & 0xff) << 8);
-       ebuf.e.a_syms = (temp[8] & 0xff) | ((temp[9] & 0xff) << 8);
-       ebuf.e.a_entry = (temp[10] & 0xff) | ((temp[11] & 0xff) << 8);
-       ebuf.e.a_unused = (temp[12] & 0xff) | ((temp[13] & 0xff) << 8);
-       ebuf.e.a_flag = (temp[14] & 0xff) | ((temp[15] & 0xff) << 8);
-       ebuf.o.max_ovl = (temp[16] & 0xff) | ((temp[17] & 0xff) << 8);
-       for (i = 0; i < NOVL; ++i)
-               ebuf.o.ov_siz[i] = (temp[i * 2 + 18] & 0xff) | ((temp[i * 2 + 19] & 0xff) << 8);
-#endif
-       if (N_BADMAG(ebuf.e))
+       if (fread((char *)&ebuf, 1, sizeof(ebuf), fsym) < sizeof (ebuf.e) ||
+           N_BADMAG(ebuf.e))
                goto done1;
 
        symbol_offset = N_SYMOFF(ebuf);
        symbol_size = ebuf.e.a_syms;
        strings_offset = N_STROFF(ebuf);
-       if (fseek(fsym, (off_t)symbol_offset, L_SET))
+       if (fseek(fsym, symbol_offset, L_SET))
                goto done1;
 
        if (!(fstr = fopen(name, "r")))
@@ -108,7 +71,7 @@ int nlist(name, list, strtab) char *name; struct nlist *list; char *strtab;
                p->n_type = 0;
                p->n_ovly = 0;
                p->n_value = 0;
-               if ((len = strlen(N_NAME(p))) > maxlen)
+               if ((len = strlen(p->_name)) > maxlen)
                        maxlen = len;
        }
        if (++maxlen > sizeof(sbuf)) {          /* for the NULL */
@@ -117,28 +80,16 @@ int nlist(name, list, strtab) char *name; struct nlist *list; char *strtab;
                goto done2;
        }
 
-       for (s = &nbuf; symbol_size; symbol_size -= sizeof(struct nlist)) {
-#if pdp11
-               if (fread((char *)s, sizeof(struct nlist), 1, fsym) != 1)
-#else
-               if (fread(temp, sizeof(struct nlist), 1, fsym) != 1)
-#endif
+       for (s = &nbuf; symbol_size; symbol_size -= sizeof(NLIST)) {
+               if (fread((char *)s, sizeof(NLIST), 1, fsym) != 1)
                        goto done2;
-#ifndef pdp11
-               s->n_un.n_strx = ((temp[0] & 0xffL) << 16) | ((temp[1] & 0xffL) << 24) |
-                   (temp[2] & 0xffL) | ((temp[3] & 0xffL) << 8);
-               s->n_type = temp[4] & 0xff;
-               s->n_ovly = temp[5] & 0xff;
-               s->n_value = (temp[6] & 0xff) | ((temp[7] & 0xff) << 8);
-#endif
-               if (!s->n_un.n_strx)
+               if (!s->_strx)
                        continue;
-               if (fseek(fstr, (off_t)strings_offset + s->n_un.n_strx, L_SET))
+               if (fseek(fstr, strings_offset + s->_strx, L_SET))
                        goto done2;
                (void)fread(sbuf, sizeof(sbuf[0]), maxlen, fstr);
- /*fprintf(stderr, "%s %02x %02x %04x\n", sbuf, s->n_type, s->n_ovly, s->n_value);*/
                for (p = list; ISVALID(p); p++)
-                       if (!strcmp(N_NAME(p), sbuf)) {
+                       if (!strcmp(p->_name, sbuf)) {
                                p->n_value = s->n_value;
                                p->n_type = s->n_type;
                                p->n_ovly = s->n_ovly;
index d17ac79..48f12e7 100644 (file)
 
 #include <a.out.h>
 
-#ifdef pdp11
-#define OFF_T off_t
-#else
-#define OFF_T int32_t
-#endif
-
-OFF_T
+off_t
 n_stroff(ep)
        register struct xexec *ep;
        {
-       OFF_T   l;
+       off_t   l;
 
        l = n_symoff(ep);
        l += ep->e.a_syms;
        return(l);
        }
 
-OFF_T
+off_t
 n_datoff(ep)
        register struct xexec *ep;
        {
-       OFF_T   l;
+       off_t   l;
 
        l = n_treloc(ep);
        l -= ep->e.a_data;
@@ -51,15 +45,15 @@ n_datoff(ep)
  * called.
 */
 
-OFF_T
+off_t
 n_dreloc(ep)
        register struct xexec *ep;
        {
-       OFF_T   l;
+       off_t   l;
        register u_short *ov = ep->o.ov_siz;
        register int    i;
 
-       l = (OFF_T)sizeof (struct exec) + ep->e.a_text + ep->e.a_data;
+       l = (off_t)sizeof (struct exec) + ep->e.a_text + ep->e.a_data;
        if      (ep->e.a_magic == A_MAGIC5 || ep->e.a_magic == A_MAGIC6)
                {
                for     (i = 0; i < NOVL; i++)
@@ -70,27 +64,27 @@ n_dreloc(ep)
        return(l);
        }
 
-OFF_T
+off_t
 n_treloc(ep)
        register struct xexec *ep;
        {
-       OFF_T   l;
+       off_t   l;
 
        l = n_dreloc(ep);
        l -= ep->e.a_text;
        return(l);
        }
 
-OFF_T
+off_t
 n_symoff(ep)
        register struct xexec *ep;
        {
        register int    i;
        register u_short *ov;
-       OFF_T   sum, l;
+       off_t   sum, l;
 
-       l = (OFF_T) N_TXTOFF(ep->e);
-       sum = (OFF_T)ep->e.a_text + ep->e.a_data;
+       l = (off_t) N_TXTOFF(ep->e);
+       sum = (off_t)ep->e.a_text + ep->e.a_data;
        if      (ep->e.a_magic == A_MAGIC5 || ep->e.a_magic == A_MAGIC6)
                {
                for     (ov = ep->o.ov_siz, i = 0; i < NOVL; i++)
diff --git a/n.sh b/n.sh
index 2f3f17d..9b9c692 100755 (executable)
--- a/n.sh
+++ b/n.sh
@@ -2,8 +2,7 @@
 
 ROOT="`pwd`"
 
-# note that -Iinclude will go away when everything converted to use libcross
-HOSTCC="cc -Iinclude -I$ROOT/cross/usr/include -L$ROOT/cross/usr/lib -DCROSS -Wall -Wno-char-subscripts -Wno-deprecated-declarations -Wno-format -Wno-maybe-uninitialized -Wno-parentheses -Wno-unused-result"
+HOSTCC="cc -I$ROOT/cross/usr/include -L$ROOT/cross/usr/lib -DCROSS -Wall -Wno-char-subscripts -Wno-deprecated-declarations -Wno-format -Wno-maybe-uninitialized -Wno-parentheses -Wno-unused-result"
 HOSTLIBCROSS="-lcross"
 INSTALL="$ROOT/scripts/install.sh"
 MANROFF="nroff -man"
@@ -31,7 +30,7 @@ echo
 echo "making depend"
 echo
 
-make -C bin MKDEP="$MKDEP" AAASUBDIR="ar as cc ld nm strip" AAASCRIPT= AAASTD="size" AAANSTD= AAASETUID= AAAOPERATOR= AAAKMEM= AAATTY= depend
+make -C bin MKDEP="$MKDEP" AAASUBDIR="ar as cc ld nm" AAASCRIPT= AAASTD= AAANSTD="size strip" AAASETUID= AAAOPERATOR= AAAKMEM= AAATTY= depend
 #make -C lib/c2 MKDEP="$MKDEP" depend
 #make -C lib/ccom MKDEP="$MKDEP" depend
 #make -C lib/cpp MKDEP="$MKDEP" depend
@@ -59,7 +58,7 @@ echo
 echo "making"
 echo
 
-make -C bin CC="$HOSTCC" LIBCROSS="$HOSTLIBCROSS" MANROFF="$MANROFF" CROSSPREFIX="\\\"$ROOT/cross\\\"" STAGEPREFIX="\\\"$ROOT/stage\\\"" SEPFLAG= LDFLAGS="-L$ROOT/cross/usr/lib" AAASUBDIR="ar as cc ld nm strip" AAASCRIPT= AAASTD="size" AAANSTD= AAASETUID= AAAOPERATOR= AAAKMEM= AAATTY=
+make -C bin CC="$HOSTCC" LIBCROSS="$HOSTLIBCROSS" MANROFF="$MANROFF" CROSSPREFIX="\\\"$ROOT/cross\\\"" STAGEPREFIX="\\\"$ROOT/stage\\\"" SEPFLAG= LDFLAGS="-L$ROOT/cross/usr/lib" AAASUBDIR="ar as cc ld nm" AAASCRIPT= AAASTD= AAANSTD="size strip" AAASETUID= AAAOPERATOR= AAAKMEM= AAATTY=
 make -C lib/c2 CC="$HOSTCC" LIBCROSS="$HOSTLIBCROSS" MANROFF="$MANROFF" SEPFLAG=
 make -C lib/ccom CC="$HOSTCC" LIBCROSS="$HOSTLIBCROSS" HOSTCC="$HOSTCC" LIBCROSS="$HOSTLIBCROSS" HOSTLIBCROSS="$HOSTLIBCROSS" HOSTSEPFLAG= MANROFF="$MANROFF" LDC0FLAGS= LDC1FLAGS=
 make -C lib/cpp CC="$HOSTCC" LIBCROSS="$HOSTLIBCROSS" MANROFF="$MANROFF" STAGEPREFIX="\\\"$ROOT/stage\\\"" SEPFLAG=
@@ -70,7 +69,7 @@ echo
 echo "installing"
 echo
 
-make -C bin INSTALL="$INSTALL" DESTDIR="$ROOT/cross" AAASUBDIR="ar as cc ld nm strip" AAASCRIPT= AAASTD="size" AAANSTD= AAASETUID= AAAOPERATOR= AAAKMEM= AAATTY= install
+make -C bin INSTALL="$INSTALL" DESTDIR="$ROOT/cross" AAASUBDIR="ar as cc ld nm" AAASCRIPT= AAASTD= AAANSTD="size strip" AAASETUID= AAAOPERATOR= AAAKMEM= AAATTY= install
 make -C lib/c2 INSTALL="$INSTALL" DESTDIR="$ROOT/cross" install
 make -C lib/ccom INSTALL="$INSTALL" DESTDIR="$ROOT/cross" install
 make -C lib/cpp INSTALL="$INSTALL" DESTDIR="$ROOT/cross" install
diff --git a/o.sh b/o.sh
index 1a80f7e..a24aaea 100755 (executable)
--- a/o.sh
+++ b/o.sh
@@ -17,8 +17,7 @@ MANROFF="nroff -man"
 MKDEP="$ROOT/cross/usr/bin/mkdep"
 MKSTR="$ROOT/cross/usr/ucb/mkstr"
 INSTALL="$ROOT/scripts/install.sh --strip-program=\"$ROOT/cross/bin/strip\""
-# note that -Iinclude will go away when everything converted to use libcross
-HOSTCC="cc -Iinclude -I$ROOT/cross/usr/include -L$ROOT/cross/usr/lib -DCROSS -Wall -Wno-char-subscripts -Wno-deprecated-declarations -Wno-format -Wno-maybe-uninitialized -Wno-parentheses -Wno-unused-result"
+HOSTCC="cc -I$ROOT/cross/usr/include -L$ROOT/cross/usr/lib -DCROSS -Wall -Wno-char-subscripts -Wno-deprecated-declarations -Wno-format -Wno-maybe-uninitialized -Wno-parentheses -Wno-unused-result"
 HOSTLIBCROSS="-lcross"
 RANLIB="$ROOT/cross/usr/bin/ranlib"
 UNIFDEF="$ROOT/cross/usr/ucb/unifdef"
diff --git a/p.sh b/p.sh
index 7d509bd..531e439 100755 (executable)
--- a/p.sh
+++ b/p.sh
@@ -9,8 +9,7 @@ CHGRP="$ROOT/scripts/chgrp.sh"
 CHMOD="$ROOT/scripts/chmod.sh"
 CHOWN="$ROOT/scripts/chown.sh"
 CPP="$ROOT/cross/lib/cpp"
-# note that -Iinclude will go away when everything converted to use libcross
-HOSTCC="cc -Iinclude -I$ROOT/cross/usr/include -L$ROOT/cross/usr/lib -DCROSS -Wall -Wno-char-subscripts -Wno-deprecated-declarations -Wno-format -Wno-maybe-uninitialized -Wno-parentheses -Wno-unused-result"
+HOSTCC="cc -I$ROOT/cross/usr/include -L$ROOT/cross/usr/lib -DCROSS -Wall -Wno-char-subscripts -Wno-deprecated-declarations -Wno-format -Wno-maybe-uninitialized -Wno-parentheses -Wno-unused-result"
 HOSTLIBCROSS="-lcross"
 INSTALL="$ROOT/scripts/install.sh --strip-program=\"$ROOT/cross/bin/strip\""
 LD="$ROOT/cross/bin/ld"
index b41136c..c8626ed 100644 (file)
@@ -119,8 +119,8 @@ sys pdp pdpuba pdpmba:
            AS="${AS}" CPP="${CPP}" CC="${CC}" LD="${LD}" SED="${SED}" \
            DEFS="${DEFS}" CFLAGS="${CFLAGS}"
 
-checksys: ../conf/checksys.c ../../lib/libc/gen/nlist.c ../../lib/libc/pdp/gen/nsym.c
-       ${HOSTCC} -I. -Iinclude -o $@ ../conf/checksys.c ../../lib/libc/gen/nlist.c ../../lib/libc/pdp/gen/nsym.c
+checksys: ../conf/checksys.c
+       ${HOSTCC} -I. -o $@ ../conf/checksys.c ${HOSTLIBCROSS}
 
 clean:
        rm -f unix core mklog *.o assym.h csym.h genassym gencsym checksys
@@ -175,24 +175,23 @@ ioconf.o: /home/nick/src/211bsd.git/stage/usr/include/sys/select.h
 ioconf.o: /home/nick/src/211bsd.git/stage/usr/include/sys/types.h ../h/signal.h
 ioconf.o: /home/nick/src/211bsd.git/stage/usr/include/sys/types.h ../h/systm.h
 checksys.o: ../conf/checksys.c
-checksys.o: /home/nick/src/211bsd.git/stage/usr/include/a.out.h
-checksys.o: /home/nick/src/211bsd.git/stage/usr/include/sys/exec.h
-checksys.o: /home/nick/src/211bsd.git/stage/usr/include/sys/types.h
-checksys.o: /home/nick/src/211bsd.git/stage/usr/include/sys/select.h
-checksys.o: /home/nick/src/211bsd.git/stage/usr/include/sys/types.h
-checksys.o: /home/nick/src/211bsd.git/stage/usr/include/nlist.h
-checksys.o: /home/nick/src/211bsd.git/stage/usr/include/sys/types.h
 checksys.o: /home/nick/src/211bsd.git/stage/usr/include/fcntl.h
-checksys.o: /home/nick/src/211bsd.git/stage/usr/include/nlist.h
 checksys.o: /home/nick/src/211bsd.git/stage/usr/include/stdio.h
 checksys.o: /home/nick/src/211bsd.git/stage/usr/include/stdlib.h
 checksys.o: /home/nick/src/211bsd.git/stage/usr/include/string.h
 checksys.o: /home/nick/src/211bsd.git/stage/usr/include/sys/types.h
+checksys.o: /home/nick/src/211bsd.git/stage/usr/include/sys/select.h
+checksys.o: /home/nick/src/211bsd.git/stage/usr/include/sys/types.h
 checksys.o: /home/nick/src/211bsd.git/stage/usr/include/unistd.h
 checksys.o: /home/nick/src/211bsd.git/stage/usr/include/sys/types.h
+checksys.o: /home/nick/src/211bsd.git/stage/usr/include/a.out.h
+checksys.o: /home/nick/src/211bsd.git/stage/usr/include/sys/exec.h
+checksys.o: /home/nick/src/211bsd.git/stage/usr/include/sys/types.h
+checksys.o: /home/nick/src/211bsd.git/stage/usr/include/nlist.h
+checksys.o: /home/nick/src/211bsd.git/stage/usr/include/sys/types.h
 checksys.o: /home/nick/src/211bsd.git/stage/usr/include/machine/machparam.h
 checksys.o: /home/nick/src/211bsd.git/stage/usr/include/sys/types.h
+checksys.o: /home/nick/src/211bsd.git/stage/usr/include/nlist.h
 checksys.o: /home/nick/src/211bsd.git/stage/usr/include/sys/types.h
-checksys.o: /home/nick/src/211bsd.git/stage/usr/include/varargs.h
 
 # IF YOU PUT ANYTHING HERE IT WILL GO AWAY
diff --git a/sys/GENERIC/include/a.out.h b/sys/GENERIC/include/a.out.h
deleted file mode 120000 (symlink)
index 9dd9aa8..0000000
+++ /dev/null
@@ -1 +0,0 @@
-../../../include/a.out.h
\ No newline at end of file
diff --git a/sys/GENERIC/include/machine/machparam.h b/sys/GENERIC/include/machine/machparam.h
deleted file mode 120000 (symlink)
index 6997c19..0000000
+++ /dev/null
@@ -1 +0,0 @@
-../../../pdp/machparam.h
\ No newline at end of file
diff --git a/sys/GENERIC/include/nlist.h b/sys/GENERIC/include/nlist.h
deleted file mode 120000 (symlink)
index 0c27973..0000000
+++ /dev/null
@@ -1 +0,0 @@
-../../../include/nlist.h
\ No newline at end of file
diff --git a/sys/GENERIC/include/sys/exec.h b/sys/GENERIC/include/sys/exec.h
deleted file mode 120000 (symlink)
index cb6c115..0000000
+++ /dev/null
@@ -1 +0,0 @@
-../../../h/exec.h
\ No newline at end of file
index e4ad109..29a4663 100644 (file)
  *     checks the system size and reports any limits exceeded.
  */
 
-#include <a.out.h>
 #include <fcntl.h>
-#include <nlist.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
-
-/* take ctob(), btoc(), stob(), btos() from machine/machparam.h */
-/* defines USIZE by relying on a previously included "user.h", don't use it */
-#include <machine/machparam.h>
-#undef USIZE
-
-/* take USIZE etc from gencsym.s compiled from gencsym.c on PDP-11 compiler */
 #include "csym.h"
 
-#ifdef pdp11
-#include <sys/types.h>
-#define OFF_T off_t
+#ifdef CROSS
+#include "cross/a.out.h"
+#include "cross/machine/machparam.h"
+#include "cross/nlist.h"
+#include "cross/sys/types.h"
 #else
-#include <stdint.h>
-#define OFF_T int32_t
+#include <a.out.h>
+#include <machine/machparam.h>
+#include <nlist.h>
+#include <sys/types.h>
+#define cross_exec exec
+#define cross_nlist nlist
+#define cross_off_t off_t
+#define cross_ovlhdr ovlhdr
+#define cross_u_int u_int
 #endif
 
 /* Round up to a click boundary. */
@@ -54,9 +54,9 @@
 #define        N_NLOG          20
 #define        N_NUMSYMS       21
 
-       struct  nlist   nl[N_NUMSYMS+1];
+       struct  cross_nlist     nl[N_NUMSYMS+1];
 
-char   strtab[] =
+char   strtab[] = "XXXX"               /* for notional string table length */
        "_end\0"                        /*  0 */
        "_nbuf\0"                       /*  1 */
        "_buf\0"                        /*  2 */
@@ -79,37 +79,30 @@ char        strtab[] =
        "__iosize\0"                    /* 19 */
        "_nlog";                        /* 20 */
 
-static struct exec obj;
-static struct ovlhdr ovlhdr;
+static struct cross_exec obj;
+static struct cross_ovlhdr ovlhdr;
 static int fi;
 
-#undef PARAMS
-#ifdef __STDC__
-#include <stdarg.h>
-#define PARAMS(args) args
+#ifdef CROSS
+#define N_NAME(sp) (strtab + (int)(sp)->n_un.n_strx)
 #else
-#include <varargs.h>
-#define PARAMS(args) ()
+#define N_NAME(sp) ((sp)->n_un.n_name)
 #endif
 
-#ifdef pdp11
-#define N_NAME(sp) ((sp)->n_un.n_name)
-int nlist PARAMS((char *name, struct nlist *list));
+#ifndef __P
+#ifdef __STDC__
+#define __P(params) params
 #else
-#define N_NAME(sp) (strtab + (sp)->n_un.n_strx)
-int nlist PARAMS((char *name, struct nlist *list, char *strtab));
+#define __P(params) ()
+#endif
 #endif
 
-int main PARAMS((int argc, char **argv));
-static long getval PARAMS((int indx));
+int main __P((int argc, char **argv));
+static long getval __P((int indx));
        
 int main(argc, argv) int argc; char **argv; {
        register int i, j;
-#ifndef pdp11
-       /* note: this must be at least as large as struct exec */
-       unsigned char temp[sizeof(struct ovlhdr)];
-#endif
-       long size, totsize, getval();
+       cross_off_t size, totsize;
        int errs = 0, texterrs = 0, ninode;
 
        if (argc != 2) {
@@ -119,50 +112,39 @@ int main(argc, argv) int argc; char **argv; {
 /*
  * Can't (portably) initialize unions, so we do it at run time
 */
-       for (i = 0, j = 0; i < N_NUMSYMS; i++, j += strlen(strtab + j) + 1)
-#ifdef pdp11
-               nl[i].n_un.n_name = strtab + j;
-#else
+       for (i = 0, j = 4; i < N_NUMSYMS; i++, j += strlen(strtab + j) + 1)
+#ifdef CROSS
                nl[i].n_un.n_strx = j;
-       nl[N_NUMSYMS].n_un.n_strx = -1L;
+#else
+               nl[i].n_un.n_name = strtab + j;
 #endif
        if ((fi = open(argv[1], O_RDONLY)) < 0) {
                perror(argv[1]);
                exit(-1);
        }
-#ifdef pdp11
-       if (read(fi, &obj, sizeof(obj)) != sizeof(obj))
-#else
-       if (read(fi, temp, sizeof(obj)) != sizeof(obj))
-#endif
-       {
+       if (read(fi, &obj, sizeof(obj)) != sizeof(obj)) {
                fputs("checksys: can't read object header.\n", stderr);
                exit(-1);
        }
-#ifndef pdp11
-       obj.a_magic = temp[0] | (temp[1] << 8);
-       obj.a_text = temp[2] | (temp[3] << 8);
-       obj.a_data = temp[4] | (temp[5] << 8);
-       obj.a_bss = temp[6] | (temp[7] << 8);
-       obj.a_syms = temp[8] | (temp[9] << 8);
-       obj.a_entry = temp[10] | (temp[11] << 8);
-       obj.a_unused = temp[12] | (temp[13] << 8);
-       obj.a_flag = temp[14] | (temp[15] << 8);
+#ifdef CROSS
+       obj.a_magic = cross_read_int((char *)&obj.a_magic);
+       obj.a_text = cross_read_uint((char *)&obj.a_text);
+       obj.a_data = cross_read_uint((char *)&obj.a_data);
+       obj.a_bss = cross_read_uint((char *)&obj.a_bss);
+       obj.a_syms = cross_read_uint((char *)&obj.a_syms);
+       obj.a_entry = cross_read_uint((char *)&obj.a_entry);
+       obj.a_unused = cross_read_uint((char *)&obj.a_unused);
+       obj.a_flag = cross_read_uint((char *)&obj.a_flag);
 #endif
        if (obj.a_magic == A_MAGIC5 || obj.a_magic == A_MAGIC6) {
-#ifdef pdp11
-               if (read(fi, &ovlhdr, sizeof(ovlhdr)) != sizeof(ovlhdr))
-#else
-               if (read(fi, temp, sizeof(ovlhdr)) != sizeof(ovlhdr))
-#endif
-               {
+               if (read(fi, &ovlhdr, sizeof(ovlhdr)) != sizeof(ovlhdr)) {
                        fputs("checksys: can't read overlay header.\n", stderr);
                        exit(-1);
                }
-#ifndef pdp11
-               ovlhdr.max_ovl = temp[0] | (temp[1] << 8);
+#ifdef CROSS
+               ovlhdr.max_ovl = cross_read_int((char *)&ovlhdr.max_ovl);
                for (i = 0; i < NOVL; ++i)
-                       ovlhdr.ov_siz[i] = temp[2 + i * 2] | (temp[3 + i * 2] << 8);
+                       ovlhdr.ov_siz[i] = cross_read_uint((char *)(ovlhdr.ov_siz + i));
 #endif
        }
        switch(obj.a_magic) {
@@ -270,10 +252,10 @@ checkov:
                exit(-1);
        }
 
-#ifdef pdp11
-       (void)nlist(argv[1], nl);
+#ifdef CROSS
+       (void)cross_nlist(argv[1], nl, strtab);
 #else
-       (void)nlist(argv[1], nl, strtab);
+       (void)cross_nlist(argv[1], nl);
 #endif
 
        if (!nl[N_NINODE].n_type) {
@@ -321,12 +303,8 @@ checkov:
  */
 static long getval(indx) int indx; {
        register int novl;
-#ifdef pdp11
-       u_int ret;
-#else
-       char temp[2];
-#endif
-       OFF_T offst;
+       cross_u_int ret;
+       cross_off_t offst;
 
        if ((nl[indx].n_type&N_TYPE) == N_BSS)
                return((long)0);
@@ -334,20 +312,19 @@ static long getval(indx) int indx; {
        offst += obj.a_text;
        offst += sizeof(obj);
        if (obj.a_magic == A_MAGIC2 || obj.a_magic == A_MAGIC5)
-               offst -= (OFF_T)round(obj.a_text);
+               offst -= (cross_off_t)round(obj.a_text);
        if (obj.a_magic == A_MAGIC5 || obj.a_magic == A_MAGIC6) {
                offst += sizeof ovlhdr;
                if (obj.a_magic == A_MAGIC5)
-                       offst -= (OFF_T)round(ovlhdr.max_ovl);
+                       offst -= (cross_off_t)round(ovlhdr.max_ovl);
                for (novl = 0;novl < NOVL;novl++)
-                       offst += (OFF_T)ovlhdr.ov_siz[novl];
+                       offst += (cross_off_t)ovlhdr.ov_siz[novl];
        }
        (void)lseek(fi, (off_t)offst, L_SET);
-#ifdef pdp11
        read(fi, &ret, sizeof(ret));
-       return((long)ret);
+#ifdef CROSS
+       return((long)cross_read_uint((char *)&ret));
 #else
-       read(fi, temp, 2);
-       return((long)(temp[0] + (temp[1] << 8)));
+       return((long)ret);
 #endif
 }
index 9e907a5..139e838 100644 (file)
@@ -8,34 +8,24 @@
 
 #ifndef _EXEC_
 #define _EXEC_
-
-#ifdef pdp11
-#define _INT int
-#define _UNSIGNED_INT unsigned int
-#else
-#include <stdint.h>
-#define _INT int16_t
-#define _UNSIGNED_INT uint16_t
-#endif
-
 /*
  * Header prepended to each a.out file.
  */
 struct exec {
-       _INT    a_magic;        /* magic number */
-_UNSIGNED_INT  a_text;         /* size of text segment */
-_UNSIGNED_INT  a_data;         /* size of initialized data */
-_UNSIGNED_INT  a_bss;          /* size of uninitialized data */
-_UNSIGNED_INT  a_syms;         /* size of symbol table */
-_UNSIGNED_INT  a_entry;        /* entry point */
-_UNSIGNED_INT  a_unused;       /* not used */
-_UNSIGNED_INT  a_flag;         /* relocation info stripped */
+       int     a_magic;        /* magic number */
+unsigned int   a_text;         /* size of text segment */
+unsigned int   a_data;         /* size of initialized data */
+unsigned int   a_bss;          /* size of uninitialized data */
+unsigned int   a_syms;         /* size of symbol table */
+unsigned int   a_entry;        /* entry point */
+unsigned int   a_unused;       /* not used */
+unsigned int   a_flag;         /* relocation info stripped */
 };
 
 #define        NOVL    15              /* number of overlays */
 struct ovlhdr {
-       _INT    max_ovl;        /* maximum overlay size */
-_UNSIGNED_INT  ov_siz[NOVL];   /* size of i'th overlay */
+       int     max_ovl;        /* maximum overlay size */
+unsigned int   ov_siz[NOVL];   /* size of i'th overlay */
 };
 
 /*
@@ -53,7 +43,4 @@ struct        xexec {
 #define        A_MAGIC5        0430    /* auto-overlay (nonseparate) */
 #define        A_MAGIC6        0431    /* auto-overlay (separate) */
 
-#undef _INT
-#undef _UNSIGNED_INT
-
 #endif
index 33130aa..7a3aba5 100644 (file)
@@ -15,6 +15,7 @@
  * Machine type dependent parameters.
  */
 #include <machine/machparam.h>
+
 /*
  * Machine-independent constants
  */
index 2e1cf53..d74649b 100644 (file)
@@ -199,8 +199,7 @@ mkstr.o: /home/nick/src/211bsd.git/stage/usr/include/stdlib.h
 mkstr.o: /home/nick/src/211bsd.git/stage/usr/include/string.h
 mkstr.o: /home/nick/src/211bsd.git/stage/usr/include/sys/types.h
 mkstr.o: /home/nick/src/211bsd.git/stage/usr/include/sys/select.h
-mkstr.o: /home/nick/src/211bsd.git/stage/usr/include/sys/types.h ./krcompat.h
-mkstr.o: /home/nick/src/211bsd.git/stage/usr/include/varargs.h
+mkstr.o: /home/nick/src/211bsd.git/stage/usr/include/sys/types.h
 mkstr.o: /home/nick/src/211bsd.git/stage/usr/include/sys/types.h
 mkstr.o: /home/nick/src/211bsd.git/stage/usr/include/sys/stat.h
 printenv.o: printenv.c
@@ -333,8 +332,7 @@ unifdef.o: /home/nick/src/211bsd.git/stage/usr/include/string.h
 unifdef.o: /home/nick/src/211bsd.git/stage/usr/include/sys/types.h
 unifdef.o: /home/nick/src/211bsd.git/stage/usr/include/sys/select.h
 unifdef.o: /home/nick/src/211bsd.git/stage/usr/include/sys/types.h
-unifdef.o: /home/nick/src/211bsd.git/stage/usr/include/ctype.h ./krcompat.h
-unifdef.o: /home/nick/src/211bsd.git/stage/usr/include/varargs.h
+unifdef.o: /home/nick/src/211bsd.git/stage/usr/include/ctype.h
 users.o: users.c /home/nick/src/211bsd.git/stage/usr/include/stdio.h
 users.o: /home/nick/src/211bsd.git/stage/usr/include/utmp.h
 whois.o: whois.c /home/nick/src/211bsd.git/stage/usr/include/sys/types.h
@@ -356,8 +354,7 @@ xstr.o: /home/nick/src/211bsd.git/stage/usr/include/ctype.h
 xstr.o: /home/nick/src/211bsd.git/stage/usr/include/sys/types.h
 xstr.o: /home/nick/src/211bsd.git/stage/usr/include/signal.h
 xstr.o: /home/nick/src/211bsd.git/stage/usr/include/unistd.h
-xstr.o: /home/nick/src/211bsd.git/stage/usr/include/sys/types.h ./krcompat.h
-xstr.o: /home/nick/src/211bsd.git/stage/usr/include/varargs.h
+xstr.o: /home/nick/src/211bsd.git/stage/usr/include/sys/types.h
 yes.o: yes.c
 clear.o: clear.c /home/nick/src/211bsd.git/stage/usr/include/stdio.h
 clear.o: /home/nick/src/211bsd.git/stage/usr/include/sgtty.h
diff --git a/ucb/krcompat.h b/ucb/krcompat.h
deleted file mode 100644 (file)
index b5c0b7d..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-#ifndef _KRCOMPAT_H
-#define _KRCOMPAT_H 1
-
-#undef PARAMS
-#ifdef __STDC__
-#include <stdarg.h>
-#define VA_START(ap, arg) va_start(ap, arg)
-#define PARAMS(args) args
-#else
-#include <varargs.h>
-#define VA_START(ap, arg) va_start(ap)
-#define PARAMS(args) ()
-#endif
-
-#ifdef __GNUC__
-#define NORETURN __attribute__ ((noreturn))
-#else
-#define NORETURN
-#endif
-
-#endif
index a29a2c8..63ba955 100644 (file)
@@ -17,7 +17,6 @@ static char sccsid[] = "@(#)mkstr.c   5.1 (Berkeley) 5/31/85";
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include "krcompat.h"
 
 #define        ungetchar(c)    ungetc(c, stdin)
 
@@ -53,14 +52,22 @@ char        *progname;
 char   usagestr[] =    "usage: %s [ - ] mesgfile prefix file ...\n";
 char   name[100], *np;
 
-int main PARAMS((int argc, char *argv[]));
-void process PARAMS((void));
-int match PARAMS((char *ocp));
-void copystr PARAMS((void));
-int octdigit PARAMS((int c));
-void inithash PARAMS((void));
-long hashit PARAMS((char *str, int really, unsigned fakept));
-int fgetNUL PARAMS((char *obuf, register int rmdr, FILE *file));
+#ifndef __P
+#ifdef __STDC__
+#define __P(params) params
+#else
+#define __P(params) ()
+#endif
+#endif
+
+int main __P((int argc, char *argv[]));
+void process __P((void));
+int match __P((char *ocp));
+void copystr __P((void));
+int octdigit __P((int c));
+void inithash __P((void));
+long hashit __P((char *str, int really, unsigned fakept));
+int fgetNUL __P((char *obuf, register int rmdr, FILE *file));
 
 int main(argc, argv) int argc; char *argv[]; {
        char addon = 0;
index 40c2b67..a6fedcb 100755 (executable)
@@ -1,4 +1,4 @@
 #!/bin/sh
 ROOT="`pwd |sed -e 's/\/ucb\/pascal\/eyacc$//'`"
-HOSTCC="cc -g -Iinclude -Wall -Wno-char-subscripts -Wno-deprecated-declarations -Wno-format -Wno-maybe-uninitialized -Wno-parentheses -Wno-unused-result"
+HOSTCC="cc -g -I$ROOT/cross/usr/include -L$ROOT/cross/usr/lib/ -Wall -Wno-char-subscripts -Wno-deprecated-declarations -Wno-format -Wno-maybe-uninitialized -Wno-parentheses -Wno-unused-result"
 make HOSTCC="$HOSTCC" HOSTSEPFLAG=
index 60114f2..575306c 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/sh
 ROOT="`pwd |sed -e 's/\/ucb\/pascal\/pi$//'`"
 CC="$ROOT/cross/bin/cc"
-HOSTCC="cc -g -Iinclude -Wall -Wno-char-subscripts -Wno-deprecated-declarations -Wno-format -Wno-maybe-uninitialized -Wno-parentheses -Wno-unused-result"
+HOSTCC="cc -g -I$ROOT/cross/usr/include -L$ROOT/cross/usr/lib/ -Wall -Wno-char-subscripts -Wno-deprecated-declarations -Wno-format -Wno-maybe-uninitialized -Wno-parentheses -Wno-unused-result"
 INSTALL="$ROOT/scripts/install.sh --strip-program=\"$ROOT/cross/bin/strip\""
 MKSTR="$ROOT/cross/usr/ucb/mkstr"
 mkdir --parents "$ROOT/stage/usr/share/pascal"
index f27a99a..4bc4444 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/sh
 ROOT="`pwd |sed -e 's/\/ucb\/pascal\/pxp$//'`"
 CC="$ROOT/cross/bin/cc"
-HOSTCC="cc -g -Iinclude -Wall -Wno-char-subscripts -Wno-deprecated-declarations -Wno-format -Wno-maybe-uninitialized -Wno-parentheses -Wno-unused-result"
+HOSTCC="cc -g -I$ROOT/cross/usr/include -L$ROOT/cross/usr/lib/ -Wall -Wno-char-subscripts -Wno-deprecated-declarations -Wno-format -Wno-maybe-uninitialized -Wno-parentheses -Wno-unused-result"
 INSTALL="$ROOT/scripts/install.sh --strip-program=\"$ROOT/cross/bin/strip\""
 MKSTR="$ROOT/cross/usr/ucb/mkstr"
 mkdir --parents "$ROOT/stage/usr/share/pascal"
index f0d479f..8351468 100644 (file)
@@ -42,7 +42,6 @@
 #else
 #include <a.out.h>
 #include <sys/types.h>
-#define cross_exec exec
 #define cross_nlist nlist
 #define cross_off_t off_t
 #define cross_xexec xexec
index e33869c..ba5625e 100644 (file)
@@ -50,7 +50,6 @@
 #else
 #include <a.out.h>
 #include <sys/types.h>
-#define cross_exec exec
 #define cross_nlist nlist
 #define cross_off_t off_t
 #define cross_xexec xexec
index 2b626ee..c8fb294 100644 (file)
@@ -37,7 +37,6 @@
 #else
 #include <a.out.h>
 #include <sys/types.h>
-#define cross_exec exec
 #define cross_nlist nlist
 #define cross_off_t off_t
 #define cross_xexec xexec
index d79311e..34d31c1 100644 (file)
@@ -36,7 +36,6 @@
 #else
 #include <a.out.h>
 #include <sys/types.h>
-#define cross_exec exec
 #define cross_nlist nlist
 #define cross_off_t off_t
 #define cross_xexec xexec
index b0f3bad..9b15c74 100644 (file)
@@ -10,7 +10,6 @@ static char sccsid[] = "@(#)unifdef.c 4.4 (Berkeley) 8/11/83";
 #include <stdlib.h>
 #include <string.h>
 #include <ctype.h>
-#include "krcompat.h"
 
 #define BSS
 FILE *input;
@@ -36,17 +35,25 @@ char incomment BSS;
 char inquote[2] BSS;
 int exitstat BSS;
 
-int main PARAMS((int argc, char **argv));
-void pfile PARAMS((void));
-int doif PARAMS((register int thissym, int inif, int prevreject, int depth));
-int checkline PARAMS((int *cursym));
-char *skipcomment PARAMS((register char *cp));
-char *skipquote PARAMS((register char *cp, register int type));
-int getlin PARAMS((register char *line, int maxline, FILE *inp, int expandtabs));
-void flushline PARAMS((int keep));
-void putlin PARAMS((register char *line, register FILE *fio));
-void prname PARAMS((void));
-int error PARAMS((int err, int line, int depth));
+#ifndef __P
+#ifdef __STDC__
+#define __P(params) params
+#else
+#define __P(params) ()
+#endif
+#endif
+
+int main __P((int argc, char **argv));
+void pfile __P((void));
+int doif __P((register int thissym, int inif, int prevreject, int depth));
+int checkline __P((int *cursym));
+char *skipcomment __P((register char *cp));
+char *skipquote __P((register char *cp, register int type));
+int getlin __P((register char *line, int maxline, FILE *inp, int expandtabs));
+void flushline __P((int keep));
+void putlin __P((register char *line, register FILE *fio));
+void prname __P((void));
+int error __P((int err, int line, int depth));
 
 int main(argc, argv) int argc; char **argv; {
     char **curarg;
index c09870f..ab99511 100644 (file)
@@ -21,7 +21,6 @@ static char sccsid[] = "@(#)xstr.c    5.3 (Berkeley) 1/13/86";
 #include <sys/types.h>
 #include <signal.h>
 #include <unistd.h>
-#include "krcompat.h"
 
 /*
  * xstr - extract and hash strings in a C program
@@ -40,22 +39,30 @@ int cflg;
 int    vflg;
 int    readstd;
 
-int main PARAMS((int argc, char *argv[]));
-void process PARAMS((char *name));
-off_t yankstr PARAMS((register char **cpp));
-int octdigit PARAMS((int c));
-void inithash PARAMS((void));
-int fgetNUL PARAMS((char *obuf, register int rmdr, FILE *file));
-int xgetc PARAMS((FILE *file));
-off_t hashit PARAMS((char *str, int new));
-void flushsh PARAMS((void));
-void found PARAMS((int new, off_t off, char *str));
-void prstr PARAMS((register char *cp));
-void xsdotc PARAMS((void));
-char *savestr PARAMS((register char *cp));
-int lastchr PARAMS((register char *cp));
-int istail PARAMS((register char *str, register char *of));
-int onintr PARAMS((void));
+#ifndef __P
+#ifdef __STDC__
+#define __P(params) params
+#else
+#define __P(params) ()
+#endif
+#endif
+
+int main __P((int argc, char *argv[]));
+void process __P((char *name));
+off_t yankstr __P((register char **cpp));
+int octdigit __P((int c));
+void inithash __P((void));
+int fgetNUL __P((char *obuf, register int rmdr, FILE *file));
+int xgetc __P((FILE *file));
+off_t hashit __P((char *str, int new));
+void flushsh __P((void));
+void found __P((int new, off_t off, char *str));
+void prstr __P((register char *cp));
+void xsdotc __P((void));
+char *savestr __P((register char *cp));
+int lastchr __P((register char *cp));
+int istail __P((register char *str, register char *of));
+int onintr __P((void));
 
 int main(argc, argv) int argc; char *argv[]; {
        argc--, argv++;
index 5f18aa8..792b37f 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 ROOT="`pwd |sed -e 's/\/usr.bin\/lex$//'`"
-HOSTCC="cc -g -Iinclude -Wall -Wno-char-subscripts -Wno-deprecated-declarations -Wno-format -Wno-maybe-uninitialized -Wno-parentheses -Wno-unused-result"
+HOSTCC="cc -g -I$ROOT/cross/usr/include -L$ROOT/cross/usr/lib/ -Wall -Wno-char-subscripts -Wno-deprecated-declarations -Wno-format -Wno-maybe-uninitialized -Wno-parentheses -Wno-unused-result"
 INSTALL="$ROOT/scripts/install.sh --strip-program=/bin/true"
 MANROFF="nroff -man"
 mkdir --parents "$ROOT/cross/bin"
index d71f57a..c75a77b 100755 (executable)
@@ -66,7 +66,6 @@ static char sccsid[] = "@(#)build.c   5.3.1 (Berkeley) 5/17/93";
 #define cross_nlist nlist
 #define cross_off_t off_t
 #define cross_ranlib ranlib
-#define cross_xexec xexec
 #endif
 
 extern CHDR chdr;                      /* converted header */
index b4ad215..abf3fe2 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 ROOT="`pwd |sed -e 's/\/usr\.bin\/yacc$//'`"
-HOSTCC="cc -g -Iinclude -Wall -Wno-char-subscripts -Wno-deprecated-declarations -Wno-format -Wno-maybe-uninitialized -Wno-parentheses -Wno-unused-result"
+HOSTCC="cc -g -I$ROOT/cross/usr/include -L$ROOT/cross/usr/lib/ -Wall -Wno-char-subscripts -Wno-deprecated-declarations -Wno-format -Wno-maybe-uninitialized -Wno-parentheses -Wno-unused-result"
 INSTALL="$ROOT/scripts/install.sh --strip-program=/bin/true"
 MANROFF="nroff -man"
 mkdir --parents "$ROOT/cross/usr/bin"
index 066a43e..0efeee6 100644 (file)
@@ -1,5 +1,5 @@
 char *libF77_id[] = {
-       "@(#)libF77.a   Jan 11 23:51:19 2017",
+       "@(#)libF77.a   Jan 12 00:40:04 2017",
        "@(#)abort_.c   5.1     6/7/85",
        "@(#)besj0_.c   5.1     6/7/85",
        "@(#)besj1_.c   5.1     6/7/85",
index 0b54599..34e80df 100644 (file)
@@ -4,7 +4,7 @@ RANLIB=ranlib
 
 all: include libcross.a
 
-include: cross/cross.h cross/a.out.h cross/ar.h cross/nlist.h cross/ranlib.h cross/time.h cross/tzfile.h cross/sys/dir.h cross/sys/exec.h cross/sys/param.h cross/sys/types.h
+include: cross/cross.h cross/a.out.h cross/ar.h cross/nlist.h cross/ranlib.h cross/time.h cross/tzfile.h cross/machine/machparam.h cross/sys/dir.h cross/sys/exec.h cross/sys/param.h cross/sys/types.h
 
 libcross.a: cross.o ctime.o nlist.o nsym.o timezone.o
        rm -f $@
@@ -40,6 +40,10 @@ cross/tzfile.h: subset_include/tzfile.h copy.sed
        mkdir -p cross
        sed -f copy.sed $< >$@
 
+cross/machine/machparam.h: subset_sys_pdp/machparam.h copy.sed
+       mkdir -p cross/machine
+       sed -f copy.sed $< >$@
+
 cross/sys/dir.h: subset_sys_h/dir.h copy.sed
        mkdir -p cross/sys
        sed -f copy.sed $< >$@
index 3b96758..325be08 100644 (file)
@@ -4,8 +4,8 @@ s/^#\([\t ]*\)define\([\t ]\+\)\(_[0-9A-Z_]\+_\)$/#\1define\2_CROSS\3\n\n#includ
 s/^#\([\t ]*\)ifdef\([\t ]\+\)CROSS$/#\1if 1/
 s/^#\([\t ]*\)ifndef\([\t ]\+\)CROSS$/#\1if 0/
 
-s/#\([\t ]*\)include\([\t ]\)"\(a\.out\|ar\|nlist\|sys\/dir\|sys\/exec\|sys\/param\|sys\/time\|sys\/types\|ranlib\|time\|tzfile\)\.h"/#\1include\2"cross\/\3.h"/
-s/#\([\t ]*\)include\([\t ]\)<\(a\.out\|ar\|nlist\|sys\/dir\|sys\/exec\|sys\/param\|sys\/time\|sys\/types\|ranlib\|time\|tzfile\)\.h>/#\1include\2"cross\/\3.h"/
+s/#\([\t ]*\)include\([\t ]\)"\(a\.out\|ar\|machine\/machparam\|nlist\|sys\/dir\|sys\/exec\|sys\/param\|sys\/time\|sys\/types\|ranlib\|time\|tzfile\)\.h"/#\1include\2"cross\/\3.h"/
+s/#\([\t ]*\)include\([\t ]\)<\(a\.out\|ar\|machine\/machparam\|nlist\|sys\/dir\|sys\/exec\|sys\/param\|sys\/time\|sys\/types\|ranlib\|time\|tzfile\)\.h>/#\1include\2"cross\/\3.h"/
 
 s/^unsigned[\t ]\+\(int\|long\|short\)$/cross_u\1_t/g
 s/^unsigned[\t ]\+\(int\|long\|short\)\([^0-9A-Za-z_]\)/cross_u\1_t\2/g
index 86ba21c..c6275cc 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 ROOT="`pwd |sed -e 's/\/usr\.lib\/libcross$//'`"
-HOSTCC="cc -g -Iinclude -Wall -Wno-char-subscripts -Wno-deprecated-declarations -Wno-format -Wno-maybe-uninitialized -Wno-parentheses -Wno-unused-result"
+HOSTCC="cc -g -I$ROOT/cross/usr/include -L$ROOT/cross/usr/lib/ -Wall -Wno-char-subscripts -Wno-deprecated-declarations -Wno-format -Wno-maybe-uninitialized -Wno-parentheses -Wno-unused-result"
 INSTALL="$ROOT/scripts/install.sh --strip-program=/bin/true"
 mkdir --parents "$ROOT/cross/lib"
 make CC="$HOSTCC" && \
index fae4538..56ef044 100644 (file)
@@ -21,6 +21,7 @@
 #else
 #include <a.out.h>
 #include <sys/types.h>
+#define cross_exec exec
 #define cross_n_stroff n_stroff
 #define cross_n_symoff n_symoff
 #define cross_n_datoff n_datoff
diff --git a/usr.lib/libcross/subset_sys_pdp/machparam.h b/usr.lib/libcross/subset_sys_pdp/machparam.h
new file mode 100644 (file)
index 0000000..d9549f6
--- /dev/null
@@ -0,0 +1,159 @@
+/*
+ * Copyright (c) 1986 Regents of the University of California.
+ * All rights reserved.  The Berkeley software License Agreement
+ * specifies the terms and conditions for redistribution.
+ *
+ *     @(#)machparam.h 1.4 (2.11BSD GTE) 1998/9/15
+ */
+
+#ifndef _MACHPARAM_
+#define _MACHPARAM_
+
+/*
+ * Machine dependent constants for PDP.
+ */
+
+#ifndef CROSS
+/*
+ * Definitions for byte order,
+ * according to byte significance from low address to high.
+ */
+#define        LITTLE  1234            /* least-significant byte first (vax) */
+#define        BIG     4321            /* most-significant byte first */
+#define        PDP     3412            /* LSB first in word, MSW first in long (pdp) */
+#define        ENDIAN  PDP             /* byte order on pdp */
+
+/*
+ * Macros for network/external number representation conversion.
+ */
+#if ENDIAN == BIG && !defined(lint)
+#define        ntohl(x)        (x)
+#define        ntohs(x)        (x)
+#define        htonl(x)        (x)
+#define        htons(x)        (x)
+#else
+#include <sys/types.h>
+u_short        ntohs(), htons();
+u_long ntohl(), htonl();
+#endif
+
+#define        CHAR_BIT        NBBY
+#define        CHAR_MAX        0x7f
+#define        CHAR_MIN        0x80
+#define        CLK_TCK         60                      /* for times() */
+#define        INT_MAX         0x7fff
+#define        INT_MIN         0x8000
+#define        LONG_MAX        0x7fffffff
+#define        LONG_MIN        0x80000000
+#define        SCHAR_MAX       0x7f
+#define        SCHAR_MIN       0x80
+#define        SHRT_MAX        0x7fff
+#define        SHRT_MIN        0x8000
+#define        UCHAR_MAX       0xff
+#define        UINT_MAX        ((unsigned int)0xffff)
+#define        ULONG_MAX       0x7fffffff
+#define        USHRT_MAX       ((unsigned short)0xffff)
+
+#define        NBPG            512             /* bytes/page */
+#define        PGOFSET         (NBPG-1)        /* byte offset into page */
+#define        PGSHIFT         9               /* LOG2(NBPG) */
+
+#define        DEV_BSIZE       1024
+#define        DEV_BSHIFT      10              /* log2(DEV_BSIZE) */
+#define        DEV_BMASK       0x3ffL          /* DEV_BSIZE - 1 */
+
+#define        CLSIZE          2
+#define        CLSIZELOG2      1
+
+#define        SSIZE   20                      /* initial stack size (*64 bytes) */
+#define        SINCR   20                      /* increment of stack (*64 bytes) */
+
+/* machine dependent stuff for core files */
+#define        TXTRNDSIZ       8192L
+#define        stacktop(siz)   (0x10000L)
+#define        stackbas(siz)   (0x10000L-(siz))
+
+/*
+ * User area: a user structure, followed by a stack for the networking code
+ * (running in supervisor space on the PDP-11), followed by the kernel
+ * stack.  The numbers for NET_SSIZE and KERN_SSIZE are determined
+ * empirically.
+ *
+ * Note that the SBASE and STOP constants are only used by the assembly code,
+ * but are defined here to localize information about the user area's
+ * layout (see pdp/genassym.c).  Note also that a networking stack is always
+ * allocated even for non-networking systems.  This prevents problems with
+ * applications having to be recompiled for networking versus non-networking
+ * systems.
+ */
+#define        NET_SSIZE       16      /* size of the network stack (*64) */
+#define        KERN_SSIZE      32      /* size of the kernel stack (*64) */
+#define        USIZE           (btoc(sizeof(struct user)) + NET_SSIZE + KERN_SSIZE)
+
+#define        NET_SBASE       ctob(btoc(sizeof(struct user)))
+#define        NET_STOP        (NET_SBASE + ctob(NET_SSIZE))
+#define        KERN_SBASE      NET_STOP
+#define        KERN_STOP       (KERN_SBASE + ctob(KERN_SSIZE))
+#endif
+
+/*
+ * Some macros for units conversion
+ */
+/* Core clicks (64 bytes) to segments and vice versa */
+#define        ctos(x) (((x)+127)/128)
+#define        stoc(x) ((x)*128)
+
+#ifndef CROSS
+/* Core clicks (64 bytes) to disk blocks */
+#define        ctod(x) (((x)+7)>>3)
+#endif
+
+/* clicks to bytes */
+#define        ctob(x) ((x)<<6)
+
+/* bytes to clicks */
+#define        btoc(x) ((((unsigned)(x)+63)>>6))
+
+#ifndef CROSS
+/* these should be fixed to use unsigned longs, if we ever get them. */
+#define        btodb(bytes)            /* calculates (bytes / DEV_BSIZE) */ \
+       ((long)(bytes) >> DEV_BSHIFT)
+#define        dbtob(db)               /* calculates (db * DEV_BSIZE) */ \
+       ((long)(db) << DEV_BSHIFT)
+
+/* clicks to KB */
+#define        ctok(x) (((x)>>4)&07777)
+
+/*
+ * Macros to decode processor status word.
+ */
+#define        SUPVMODE(ps)    (((ps) & PSL_CURMOD) == PSL_CURSUP)
+#define        USERMODE(ps)    (((ps) & PSL_USERSET) == PSL_USERSET)
+#define        BASEPRI(ps)     (((ps) & PSL_IPL) == 0)
+
+#define        DELAY(n)        { long N = ((long)(n))<<1; while (--N > 0); }
+
+/*
+ * Treat ps as byte, to allow restoring value from mfps/movb.
+ * (see splfix.*.sed)
+ */
+#define        PS_LOBYTE       ((char *)0177776)
+#define        splx(ops)       (*PS_LOBYTE = ((char)(ops)))
+
+/*
+ * high int of a long
+ * low int of a long
+ */
+#define        hiint(long)     (((int *)&(long))[0])
+#define        loint(long)     (((int *)&(long))[1])
+
+/*
+ * SUPERADD is used to distinguish a supervisor-mode address from a
+ * kernel mode address to insure uniqueness over both address spaces.
+ */
+#define        SUPERADD(add)   ((int)(add)|01)
+#define        KERNELADD(add)  ((int)(add)&~01)
+#define        ISSUPERADD(add) ((int)(add)&01)
+#endif
+
+#endif
index a4fe6cb..3532987 100644 (file)
@@ -3,7 +3,6 @@ AR=ar
 MANROFF=/usr/man/manroff
 INSTALL=install
 RANLIB=ranlib
-CFLAGS=-Iinclude
 OBJECTS = vmf.o
 
 all:  genlib genlib_p vmf.0
diff --git a/usr.lib/libvmf/include/vmf.h b/usr.lib/libvmf/include/vmf.h
deleted file mode 120000 (symlink)
index 9594a15..0000000
+++ /dev/null
@@ -1 +0,0 @@
-../../../include/vmf.h
\ No newline at end of file
index 356ea2e..5d4fc69 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 ROOT="`pwd |sed -e 's/\/usr\.lib\/libvmf$//'`"
-HOSTCC="cc -g -Iinclude -Wall -Wno-char-subscripts -Wno-deprecated-declarations -Wno-format -Wno-maybe-uninitialized -Wno-parentheses -Wno-unused-result"
+HOSTCC="cc -g -I$ROOT/cross/usr/include -L$ROOT/cross/usr/lib/ -Wall -Wno-char-subscripts -Wno-deprecated-declarations -Wno-format -Wno-maybe-uninitialized -Wno-parentheses -Wno-unused-result"
 INSTALL="$ROOT/scripts/install.sh --strip-program=/bin/true"
 MANROFF="nroff -man"
 mkdir --parents "$ROOT/cross/usr/lib"
index 87dc6b3..11d85cd 100644 (file)
@@ -76,6 +76,9 @@ pstat.o: /home/nick/src/211bsd.git/stage/usr/include/machine/vmparam.h
 pstat.o: /home/nick/src/211bsd.git/stage/usr/include/sys/vmmac.h
 pstat.o: /home/nick/src/211bsd.git/stage/usr/include/sys/vmmeter.h
 pstat.o: /home/nick/src/211bsd.git/stage/usr/include/sys/vmsystm.h
+pstat.o: /home/nick/src/211bsd.git/stage/usr/include/a.out.h
+pstat.o: /home/nick/src/211bsd.git/stage/usr/include/sys/exec.h
+pstat.o: /home/nick/src/211bsd.git/stage/usr/include/sys/types.h
 pstat.o: /home/nick/src/211bsd.git/stage/usr/include/nlist.h
 pstat.o: /home/nick/src/211bsd.git/stage/usr/include/sys/types.h
 pstat.o: /home/nick/src/211bsd.git/stage/usr/include/stdio.h
index 889da50..9b7d03d 100644 (file)
@@ -30,7 +30,7 @@ static char sccsid[] = "@(#)pstat.c   5.8.6 (2.11BSD) 1999/9/13";
 #include <sys/tty.h>
 #include <sys/conf.h>
 #include <sys/vm.h>
-#include <nlist.h>
+#include <a.out.h> /* work around stupid _AOUT_INCLUDE_ stuff, should be: #include <nlist.h> */
 #include <stdio.h>
 
 char   *fcore  = "/dev/kmem";