Import of pkgsrc-2013Q2

This commit is contained in:
2013-09-26 17:14:40 +02:00
commit 785076ae39
74991 changed files with 4380255 additions and 0 deletions
+15
View File
@@ -0,0 +1,15 @@
This is Bruce Evans' C compiler and binutils package.
It is able to generate 16-bit code. Hence it's possible to compile BIOS
and DOS code under unix.
The C compiler understands K&R1 syntax, with a few restrictions
regarding bitfields. See the file bcc/bcc-cc1/bcc.bugs in the
${DISTFILE} for Bruce's bug list.
The binutils (assembler and loader) have been renamed to as86 and ld86
to not conflict with the system's assembler and loader, but they are
also available in the regular BINDIR (normally /usr/local/bin).
It's also possible to generate MC 6809 code with bcc/as. (This is a
compile-time option however, and not supported by this package.
+50
View File
@@ -0,0 +1,50 @@
# $NetBSD: Makefile,v 1.26 2012/10/31 11:16:40 asau Exp $
DISTNAME= bcc
PKGREVISION= 1
PKGNAME= bcc-95.3.12
CATEGORIES= devel lang
MAINTAINER= pkgsrc-users@NetBSD.org
COMMENT= Bruce Evans' C compiler (with as and ld); can do 16-bit code
CONFLICTS= bin86-[0-9]*
CONFLICTS+= dev86-[0-9]*
NOT_FOR_PLATFORM= *-*-alpha
NOT_FOR_PLATFORM+= Interix-*-* # no <a.out.h>
NOT_FOR_PLATFORM+= DragonFly-*-x86_64 # Cannot build 32-bit binary
USE_BSD_MAKEFILE= yes
USE_TOOLS+= groff nroff
INSTALLATION_DIRS= bin lib/bcc ${PKGMANDIR}/cat1 ${PKGMANDIR}/man1
.include "../../mk/bsd.prefs.mk"
.if ${MACHINE_ARCH} == "x86_64"
# Has LP64 issues, so must build as 32-bit binary
CFLAGS+= -m32
LDFLAGS+= -m32
.endif
.if ${OPSYS} == "DragonFly"
CPPFLAGS+= -D_POSIX_SOURCE
.endif
post-extract:
set -e; \
cd ${FILESDIR}; \
mkdir ${WRKSRC}/bcc-cc1; \
cp Makefile.main ${WRKSRC}/Makefile; \
cp Makefile.ld ${WRKSRC}/ld/Makefile; \
cp ld86.1 ${WRKSRC}/ld/; \
cp Makefile.as ${WRKSRC}/as/Makefile; \
cp as86.1 ${WRKSRC}/as/; \
cp Makefile.bcc ${WRKSRC}/bcc/Makefile; \
cp bcc.1 ${WRKSRC}/bcc/; \
cp Makefile.bcc-cc1 ${WRKSRC}/bcc-cc1/Makefile; \
cp bcc-cc1.1 ${WRKSRC}/bcc-cc1/
rm -f ${WRKSRC}/as/typeconv.o
.include "../../mk/bsd.pkg.mk"
+13
View File
@@ -0,0 +1,13 @@
@comment $NetBSD: PLIST,v 1.3 2009/06/14 17:48:34 joerg Exp $
bin/as86
bin/bcc
bin/ld86
lib/bcc/bcc-cc1
man/cat1/as86.0
man/cat1/bcc-cc1.0
man/cat1/bcc.0
man/cat1/ld86.0
man/man1/as86.1
man/man1/bcc-cc1.1
man/man1/bcc.1
man/man1/ld86.1
+24
View File
@@ -0,0 +1,24 @@
$NetBSD: distinfo,v 1.15 2006/10/22 06:31:43 rillig Exp $
SHA1 (bcc.tar.gz) = 6a5c47bde0a6ddf82b65569883a5a490deb7e9b2
RMD160 (bcc.tar.gz) = 6ce1a333bb4ffa36d9cea5c116925f74db64345e
Size (bcc.tar.gz) = 214834 bytes
SHA1 (patch-ad) = b1e609a0436132d4a7f6893cc2dab89f77cde12e
SHA1 (patch-ae) = ede27bbd8f1cc92fe047f1dc687881660d6b7a96
SHA1 (patch-af) = df7c41fb3a200145496b38694de2f927d5f108a9
SHA1 (patch-ag) = 9d564f0d6ae174545e38ca8c9ca2f11f961d8688
SHA1 (patch-ah) = 0aafaaff3ccef5f491d3ee3de12d27f24cbcddd0
SHA1 (patch-ai) = f5b921d3a3ce810728aa7df23e19eac26c12ca29
SHA1 (patch-aj) = 6a33e364aaa99576cd5fe62c963484c8a269c026
SHA1 (patch-ak) = babcde54e610609151ae525efe5ad632e2fc5de7
SHA1 (patch-al) = 98c7508aeb54771385efd44e75d7ab765f3fd91e
SHA1 (patch-am) = 4e3d440ce908ea27ddb7efb1bfb7261b8cb91d03
SHA1 (patch-an) = 7be41aeee0d37f44783b1f3c697562c3a827646b
SHA1 (patch-aq) = 343f318437b3690fdfa15f564522ce47047e5223
SHA1 (patch-ar) = 94f5afcca0aeae1d8befafd304185e5b964acb46
SHA1 (patch-as) = b5b52b843eeaf649342813a50a042dfde8314ffd
SHA1 (patch-at) = 932f6c0ad2fa5372493cd6e88806e1445cdbe448
SHA1 (patch-au) = cef1a15e3b9feba7377e55fa9ee7c812dac63e2c
SHA1 (patch-av) = 7583906b59251aa99010616b3247728a2bea27a8
SHA1 (patch-aw) = dc47528f06f16a835e53055135d704d166e41040
SHA1 (patch-ax) = 4bd5b6f2de8f04584dc188ade6ecd2cef2380976
+12
View File
@@ -0,0 +1,12 @@
# $NetBSD: Makefile.as,v 1.1 2006/10/22 06:31:43 rillig Exp $
#
.PATH: ../ld
PROG= as86
SRCS= as.c assemble.c error.c express.c genbin.c genlist.c genobj.c \
gensym.c macro.c mops.c pops.c readsrc.c scan.c table.c \
typeconv.c
WARNS= 0
.include <bsd.prog.mk>
+9
View File
@@ -0,0 +1,9 @@
# $NetBSD: Makefile.bcc,v 1.3 2006/10/22 06:31:43 rillig Exp $
#
PROG= bcc
CPPFLAGS+= -DNSIG=32
CPPFLAGS+= -DLOCALPREFIX=\"${PREFIX}\"
WARNS= 0
.include <bsd.prog.mk>
+17
View File
@@ -0,0 +1,17 @@
# $NetBSD: Makefile.bcc-cc1,v 1.1 2006/10/22 06:31:43 rillig Exp $
#
.PATH: ../bcc
PROG= bcc-cc1
SRCS= assign.c declare.c gencode.c label.c preserve.c type.c \
bcc-cc1.c express.c genloads.c loadexp.c scan.c \
exptree.c glogcode.c longop.c softop.c codefrag.c \
floatop.c hardop.c output.c state.c debug.c function.c \
input.c preproc.c table.c
CPPFLAGS+= -DNSIG=32
CPPFLAGS+= -DLOCALPREFIX=\"${PREFIX}\"
WARNS= 0
BINDIR= ${PREFIX}/lib/bcc
.include <bsd.prog.mk>
+9
View File
@@ -0,0 +1,9 @@
# $NetBSD: Makefile.ld,v 1.1 2006/10/22 06:31:43 rillig Exp $
#
PROG= ld86
SRCS= dumps.c io.c ld.c readobj.c table.c typeconv.c writebin.c
CPPFLAGS+= -DBSD_A_OUT -DSTANDARD_GNU_A_OUT
WARNS= 0
.include <bsd.prog.mk>
+5
View File
@@ -0,0 +1,5 @@
# $NetBSD: Makefile.main,v 1.1 2006/10/22 06:31:43 rillig Exp $
SUBDIR= ld as bcc-cc1 bcc
.include <bsd.subdir.mk>
+119
View File
@@ -0,0 +1,119 @@
.\" $NetBSD: as86.1,v 1.4 2001/12/25 22:41:39 wiz Exp $
.\"
.\" This manual page has been assembled after Bruce's original bcc.doc
.\" file by Jörg Wunsch <joerg@FreeBSD.org>.
.\" It is redistributed under the same conditions as the whole bcc
.\" package itself.
.\"
.Dd March 26, 1995
.Os
.Dt AS86 1
.Sh NAME
.Nm as86
.Nd assembler for 8086/80386
.Sh SYNOPSIS
.Nm as86
.Op Fl 03agjuw
.Op Fl b Op Ar bin
.Op Fl lm Op Ar list
.Op Fl n Ar name
.Op Fl o Ar obj
.Op Fl s Ar sym
.Ar src
.Sh DESCRIPTION
.Ss Overview
.Nm As86
is an assembler for 8086 or 80386 CPUs. Its syntax resembles rather
the usual 8086 assembler syntax than the AT&T-like syntax as used by
the system's assembler
.Xr as 1 .
.Pp
It can also be compiled to support the Motorola 6809 CPU. The name
.Nm as86
has only been chosen to make it distinct from the system's assembler.
.Ss Options
.Bl -tag -width indent -compact
.It Fl 0
.Pq the digit 0
start with 16-bit code segment
.It Fl 3
start with 32-bit code segment
.It Fl a
enable partial compatibility with asld
.It Fl b
produce binary file, filename may follow
.Pq obsolete
.It Fl g
only put global symbols in object file
.It Fl j
force all jumps to be long
.It Fl l
produce list file, filename may follow
.It Fl m
print macro expansions in listing
.It Fl n
name of module follows
.Pq goes in object instead of source name
.It Fl o
produce object file, filename follows
.It Fl s
produce symbol file, filename follows
.Pq obsolete
.It Fl u
take undefined symbols as imported-with-unspecified segment
.It Fl w
don't print warnings
.El
.Pp
The 6809 version does not support
.Fl 0 ,
.Fl 3 ,
.Fl a
or
.Fl j .
.Ss Defaults
Off or none except for these; no output is produced without a flag:
.Bl -tag -width indent -compact
.It Fl 0 | Fl 3
native, i.\& e. 80386
.It Ar list
stdout
.Pq beware of clobbering next arg
.It Ar name
basename of the source name
.El
.Ss Input syntax
The following lists all acceptable names except the CPU instructions:
.Bl -tag -width "XXXXXXX" -compact -offset indent
.It Register names
bp, bx, di, si, eax, ebp, ecx, edi, edx, esi, esp,
ax, cx, dx, sp, ah, al, bh, bl, ch, cl, dh, dl,
cs, ds, es, fs, gs, ss, cr0, cr2, cr3, dr0, dr1,
dr3, dr6, dr7, tr3, tr4, tr5, tr6, tr7, st.
.It Type sizes
byte, dword, fword, far, ptr, pword, qword, tbyte, word.
.It Pseudo-operations
else, elseif, elseifc, endif, if, ifc;
\&.align, .ascii, .blkb, .blkw, block, .bss, .byte, comm, .comm,
\&.data, .data1, .data2, .data4, db, dd, .define, dw, end, endb,
enter, entry, equ, .even, export, extern, .extern, extrn, fail, .fail,
fcb, fcc, fdb, get, .globl, ident, import, include, lcomm, .lcomm,
\&.list, loc, .long, .maclist, macro, .map, org, .org, public,
rmb, .rom, .sect, set, setdp, .short, .space, .text, use16,
use32, .warn, .word, .zero.
.El
.Sh SEE ALSO
.Xr as 1 ,
.Xr bcc 1 ,
.Xr ld86 1
.Sh AUTHORS
This program has been developed by Bruce Evans.
.Sh BUGS
The
.Fl u
and
.Fl w
options are perhaps back to front because they are needed for cc1
output and Minix's make does the wrong thing with .s files left
around. However, all assembler code not written by compilers should
assemble with them turned off.
+103
View File
@@ -0,0 +1,103 @@
.\" $NetBSD: bcc-cc1.1,v 1.4 2001/12/25 22:45:56 wiz Exp $
.\"
.\" This manual page has been assembled after Bruce's original bcc.doc
.\" file by Jörg Wunsch <joerg@FreeBSD.org>.
.\" It is redistributed under the same conditions as the whole bcc
.\" package itself.
.\"
.Dd March 26, 1995
.Os
.Dt BCC-CC1 1
.Sh NAME
.Nm bcc-cc1
.Nd C compiler backend
.Sh SYNOPSIS
.Nm bcc-cc1
.Op Fl 03EPcdfltw Ns Op -
.Op Fl D Ns Ar define
.Op Fl I Ns Ar include_dir
.Op Fl U Ns Ar undef
.Op Fl o Ar outfile
.Op Ar infile
.Sh DESCRIPTION
.Nm Bcc-cc1
is the backend for the
.Xr bcc 1
C compiler.
.Pp
It understands the following options:
.Bl -tag -width indent -compact
.It Fl 0
.Pq the digit 0
8086 target
.Pq works even on 80386 host
.It Fl 3
80386 target
.Pq works even on 8086 host
.It Fl D
define
.It Fl E
produce preprocessor output
.It Fl I
include search path
.It Fl P
produce preprocessor output with no line numbers
.It Fl c
produce code with caller saving regs before function calls
.It Fl d
print debugging information in assembly output
.It Fl f
produce code with 1st argument passed in a register
.It Fl l
produce code for 2 3 1 0 long byte order
.Pq only works in 16-bit versions
.It Fl o
assembler output file name follows
.It Fl p
produce
.Pq almost
position-independent code
.It Fl t
print source code in assembly output
.It Fl w
print what cc1 thinks is the location counter in assembly output
.El
.Pp
All the options except
.Fl D ,
.Fl I
and
.Fl o
may be turned off by following the
option letter by a
.Sq - .
Options are processed left to right so the last setting has precedence.
.Pp
The following is defined before option processing:
.Bd -literal
__BCC__ 1
.Ed
.Pp
The following may be defined after option processing:
.Bd -literal
__AS09__ 1 if 6809 version
__AS386_16__ 1 if -0 option on 80*86
__AS386_32__ 1 if -3 option on 80*86
__CALLER_SAVES__ 1 if -c option
__FIRST_ARG_IN_AX__ 1 if -f option on 80*86
__FIRST_ARG_IN_X__ 1 if -f option on 6809
__LONG_BIG_ENDIAN__ 1 if -l option
__POS_INDEPENDENT__ 1 if -p option on 6809
.Ed
.Pp
The following are standard builtins:
.Bd -literal
__FILE__ stringized name of current input file
__LINE__ current line number
.Ed
.Sh FILES
.Pa /usr/local/lib/bcc/bcc-cc1
.Sh SEE ALSO
.Xr bcc 1
.Sh AUTHORS
This program has been written by Bruce Evans.
+189
View File
@@ -0,0 +1,189 @@
.\" $NetBSD: bcc.1,v 1.3 2001/12/03 19:03:21 wiz Exp $
.\"
.\" This manual page has been assembled after Bruce's original bcc.doc
.\" file by Jörg Wunsch <joerg@FreeBSD.org>.
.\" It is redistributed under the same conditions as the whole bcc
.\" package itself.
.\"
.Dd March 26, 1995
.Os
.Dt BCC 1
.Sh NAME
.Nm bcc
.Nd Bruce's C compiler
.Sh SYNOPSIS
.Nm bcc
.Op Fl 03EGOPSVcegv
.Op Fl A Ns Ar as_option
.Op Fl B Ns Ar executable_prefix
.Op Fl C Ns Ar cc1_option
.Op Fl D Ns Ar define
.Op Fl I Ns Ar include_dir
.Op Fl L Ns Ar ld_option
.Op Fl Q Ns Ar c386_option
.Op Fl T Ns Ar tmpdir
.Op Fl U Ns Ar undef
.Op Fl o Ar outfile
.Op Fl fpt Ar error
.Op ld_options
.Op Ar infiles
.Sh DESCRIPTION
.Ss Overview
.Nm Bcc
is a simple C compiler suitable for generating 8086 or 80386 code.
It basically understands the old K&R C input syntax, with some
restrictions on bit fields. It interacts with the programs
.Xr as86 1
and
.Xr ld86 1 .
.Pp
As a compile-time option, it is also possible to convince
.Nm bcc
to generate code for the Motorola 6809 CPU.
.Ss Options
.Bl -tag -width indent -compact
.It Fl 0
.Pq the digit 0
8086 target
.Pq works even on 80386 host
.It Fl 3
80386 target
.Pq works even on 8086 host
.It Fl A
pass remainder of option to assembler; e.\& g.
.Ql -A-l -Alistfile
for a listing
.It Fl B
prefix for executable search path; the search order is all paths
specified using
.Fl B ,
in order, then the path given in the environment variable
.Ev BCC_EXEC_PREFIX
if that is set, then the compiled-in defaults
.Pa /usr/local/lib/bcc ,
followed by
.Pa /usr/local/bin
.It Fl C
pass remainder of option to bcc-cc1; e.\& g.
.Ql -C-c
for caller-saves
.It Fl D
define
.It Fl E
produce preprocessor output
.It Fl G
produce gnu-Minix objects
.Pq link with gnu ld
.It Fl I
include search path
.It Fl L
pass remainder of option to linker
.It Fl O
optimize
.Pq does nothing
.It Fl P
produce preprocessor output with no line numbers
.It Fl Q
pass full option to c386
.It Fl S
produce assembler file
.It Fl T
temporary directory;
overrides previous value and default; default is
from the environment variable
.Ev TMPDIR
if that is set, otherwise
.Pa /tmp
.It Fl U
undefine
.It Fl V
print names of files being compiled
.It Fl c
produce object file
.It Fl e
run the preprocess pass separately. This takes less memory, and may
help or harm by giving more traditional semantics like token pasting
with
.Ql /**/
\&.
.It Fl f
error
.Pq float emulation not supported
.It Fl g
produce debugging info
.Pq does nothing
.It Fl o
output file name follows
.Pq assembler, object or executable
.It Fl p
error
.Pq profiling not supported
.It Fl t
error
.Pq substitution of some cc passes not supported
.It Fl v
print names and args of subprocesses being run.
.Pp
Two or more
.Fl v
\&'s: print names of files being unlinked.
.Pp
Three or more
.Fl v
\&'s: print names of paths being searched.
.El
.Pp
The 6809 version does not support
.Fl 0 ,
.Fl 3
or
.Fl G .
.Pp
Only the c386 version supports
.Fl Q .
.Ss Defaults
Off or none except for these:
.Bl -tag -width indent -compact
.It Fl 0 | Fl 3
native, i.\& e. 80386
.It Ar outfile
stdout for preprocessor output
.Pp
.Pa somewhere/file.[ci]
\&->
.Pa file.s
for compiler output
.Pp
.Pa somewhere/file.[cis]
\&->
.Pa file.o
for assembler output
.Pp
.Pa a.out
for ld output
.El
.Pp
Other options are passed to the linker, in particular
.Fl i- ,
.Fl l Ns Ar x ,
.Fl M ,
.Fl m ,
.Fl s .
The
.Fl i
option is always passed to the linker but can be cancelled using
.Fl i- .
.Sh ENVIRONMENT
.Bl -tag -width indent -compact
.It Ev BCC_EXEC_PREFIX
directory to search for compiler passes
.It Ev TMPDIR
where to place temporary files
.El
.Sh SEE ALSO
.Xr as86 1 ,
.Xr bcc-cc1 1 ,
.Xr cc 1 ,
.Xr ld86 1
.Sh AUTHORS
This program has been written by Bruce Evans.
+106
View File
@@ -0,0 +1,106 @@
.\" $NetBSD: ld86.1,v 1.3 2001/12/03 19:03:21 wiz Exp $
.\"
.\" This manual page has been assembled after Bruce's original bcc.doc
.\" file by Jörg Wunsch <joerg@FreeBSD.org>.
.\" It is redistributed under the same conditions as the whole bcc
.\" package itself.
.\"
.Dd March 26, 1995
.Os
.Dt LD86 1
.Sh NAME
.Nm ld86
.Nd loader for as86
.Sh SYNOPSIS
.Nm ld86
.Op Fl 03Mimrstz Ns Op -
.Op Fl l Ns Ar lib_extension
.Op Fl o outfile
.Op Fl C crtfile
.Op Fl L Ns libdir
.Op Fl O Ns libfile
.Op Fl T textaddr
.Ar infile
.Op Ar ...
.Sh DESCRIPTION
.Ss Overview
.Nm Ld86
is the loader that understands how to link the output of
.Xr as86 1
together.
.Ss Options
.Bl -tag -width indent -compact
.It Fl 0
.Pq the digit 0
produce header with 16-bit magic and use library subdir
.Pa i86
for
.Fl l Ns Ar x
.It Fl 3
produce header with 32-bit magic and use library subdir
.Pa i386
for
.Fl l Ns Ar x
.It Fl C Ns Ar x
add file
.Pa libdir-from-search/crt Ns Ar x Ns \&.o
to list of files linked
.It Fl L Ns Ar x
add dir name
.Ar x
to the head of the list of library dirs searched
.It Fl M
print symbols linked on stdout
.It Fl O Ns Ar x
add library
.Pa libdir-from-search/ Ns Ar x
to list of files linked
.It Fl T
text base address follows
.Pq in format suitable for strtoul
.It Fl i
separate I&D output
.It Fl l Ns Ar x
add library
.Pa libdir-from-search/lib Ns Ar x Ns \&.a
to list of files linked
.It Fl m
print modules linked on stdout
.It Fl o
output file name follows
.It Fl r
produce output suitable for further relocation
.It Fl s
strip symbols
.It Fl t
trace modules being looked at on stdout
.It Fl z
produce
.Dq unmapped zero page
executables
.El
.Pp
The 6809 version does not support -i or -r.
.Pp
All the options not taking an argument may be turned off by following the
option letter by a
.Sq \&- ,
as for bcc-cc1.
.Ss Defaults
Off or none except for these:
.Bl -tag -width indent -compact
.It Fl 0 | Fl 3
native, i.\& e. 80386
.It Fl L Ns Pa /usr/local/lib/bcc/ Ns Ar m/
.Po
.Ar m
is machine dependent
.Pc
.It Ar outfile
.Pa a.out
.El
.Sh SEE ALSO
.Xr as86 1 ,
.Xr bcc 1
.Sh AUTHORS
This programm has been written by Bruce Evans.
+14
View File
@@ -0,0 +1,14 @@
$NetBSD: patch-ad,v 1.2 2006/10/10 06:56:05 uebayasi Exp $
bin86 uses BIG_ENDIAN in silly ways.
--- ld/readobj.c.orig 1994-02-19 23:36:05.000000000 +0100
+++ ld/readobj.c
@@ -15,6 +15,7 @@ char *strncpy P((char *dest, const char
unsigned long strtoul P((const char *s, char **endptr, int base));
#else
#undef NULL
+#undef BIG_ENDIAN
#include <stdlib.h>
#include <string.h>
#endif
+20
View File
@@ -0,0 +1,20 @@
$NetBSD: patch-ae,v 1.4 2006/10/10 06:56:05 uebayasi Exp $
--- ld/table.c.orig 1994-02-19 23:36:05.000000000 +0100
+++ ld/table.c
@@ -13,6 +13,7 @@ void *malloc P((unsigned size));
#else
#undef NULL
#include <stdlib.h>
+#include <string.h>
#endif
#define GOLDEN 157 /* GOLDEN/HASHTABSIZE approx golden ratio */
@@ -48,7 +49,7 @@ PUBLIC struct symstruct *addsym(name)
char *name;
{
struct symstruct **hashptr;
- struct symstruct *oldsymptr;
+ struct symstruct *oldsymptr = NULL;
struct symstruct *symptr;
hashptr = gethashptr(name);
+48
View File
@@ -0,0 +1,48 @@
$NetBSD: patch-af,v 1.3 2006/10/10 06:56:05 uebayasi Exp $
--- ld/writebin.c.orig 1994-02-19 23:37:23.000000000 +0100
+++ ld/writebin.c
@@ -12,6 +12,7 @@ static long bdataoffset;
#else
# ifdef BSD_A_OUT
# ifdef STANDARD_GNU_A_OUT
+# include <sys/types.h>
# include <a.out.h>
# define RELOC_INFO_SIZE 8 /* unportable bitfields - bcc doesn't pack */
# else
@@ -174,7 +175,7 @@ bool_pt argreloc_output;
linkrefs(symptr->modptr);
needlink = FALSE;
{
- struct redlist *prlptr;
+ struct redlist *prlptr = NULL;
struct redlist *rlptr;
for (rlptr = redfirst; rlptr != NULL;
@@ -478,11 +479,11 @@ bool_pt arguzp;
extsym.n_was_sclass = C_EXT;
else
extsym.n_was_sclass = C_STAT;
- if (!(flags & I_MASK) ||
+ if (!(flags & I_MASK) || (
#ifdef BSD_A_OUT
!reloc_output &&
#endif
- flags & C_MASK)
+ flags & C_MASK))
switch (flags & (A_MASK | SEGM_MASK))
{
case 0:
@@ -918,8 +919,12 @@ PRIVATE void writeheader()
#ifdef N_SET_MAGIC
N_SET_MAGIC(header, OMAGIC);
#else
+#ifdef N_SETMAGIC
+ N_SETMAGIC(header,OMAGIC,MID_I386,0);
+#else
*(unsigned short *) &header.a_magic = OMAGIC; /* XXX - works for 386BSD */
#endif
+#endif
#else
header.a_magic[0] = A_MAGIC0;
header.a_magic[1] = A_MAGIC1;
+38
View File
@@ -0,0 +1,38 @@
$NetBSD: patch-ag,v 1.4 2006/10/10 06:56:05 uebayasi Exp $
--- as/as.c.orig 1993-07-10 21:03:52.000000000 +0200
+++ as/as.c
@@ -7,7 +7,6 @@
#include "const.h"
#include "type.h"
-#include "byteord.h"
#include "macro.h"
#undef EXTERN
#define EXTERN
@@ -31,12 +30,15 @@ int close P((int fd));
int creat P((const char *path, int mode));
int write P((int fd, const void *buf, unsigned nbytes));
#else
-#undef NULL
#include <sys/types.h>
#include <fcntl.h>
#include <unistd.h>
#endif
+/* BSD #defines this in <machine/endian.h>, but with another sense */
+#undef BIG_ENDIAN
+#include "byteord.h"
+
PUBLIC char hexdigit[] = "0123456789ABCDEF"; /* XXX - ld uses lower case */
PRIVATE struct block_s hid_blockstak[MAXBLOCK]; /* block stack */
@@ -157,7 +159,7 @@ char **argv;
{
char *arg;
bool_t isnextarg;
- char *nextarg;
+ char *nextarg = NULL;
if (argc <= 1)
usage();
+15
View File
@@ -0,0 +1,15 @@
$NetBSD: patch-ah,v 1.3 2006/10/10 06:56:05 uebayasi Exp $
--- as/genlist.c.orig 1993-07-10 21:37:22.000000000 +0200
+++ as/genlist.c
@@ -186,8 +186,8 @@ PUBLIC void listline()
{
if (!listpre)
{
- if (errcount || list.current && (!macflag || mcount != 0) ||
- macflag && maclist.current)
+ if (errcount || (list.current && (!macflag || mcount != 0)) ||
+ (macflag && maclist.current))
list1(lstfil);
if (errcount)
{
+23
View File
@@ -0,0 +1,23 @@
$NetBSD: patch-ai,v 1.3 2006/10/10 06:56:05 uebayasi Exp $
--- as/genobj.c.orig 1993-07-10 21:10:53.000000000 +0200
+++ as/genobj.c
@@ -18,7 +18,6 @@ unsigned strlen P((const char *s));
#ifdef POSIX_HEADERS_MISSING
int write P((int fd, const void *buf, unsigned nbytes));
#else
-#undef NULL
#include <sys/types.h>
#include <unistd.h>
#endif
@@ -385,8 +384,8 @@ PUBLIC void objheader()
do
{
if ((symptr->type & EXPBIT || symptr->data & IMPBIT) ||
- !globals_only_in_obj && symptr->name[0] != '.' &&
- !(symptr->type & (MNREGBIT | MACBIT | VARBIT)))
+ (!globals_only_in_obj && symptr->name[0] != '.' &&
+ !(symptr->type & (MNREGBIT | MACBIT | VARBIT))))
{
if (copyptr >= (struct sym_s **) heapend)
{
+13
View File
@@ -0,0 +1,13 @@
$NetBSD: patch-aj,v 1.3 2006/10/10 06:56:05 uebayasi Exp $
--- as/macro.c.orig 1993-07-10 21:08:23.000000000 +0200
+++ as/macro.c
@@ -95,7 +95,7 @@ PUBLIC void pmacro()
{
bool_t saving;
bool_t savingc;
- struct sym_s *symptr;
+ struct sym_s *symptr = NULL;
saving = /* prepare for bad macro */
savingc = FALSE; /* normally don't save comments */
+36
View File
@@ -0,0 +1,36 @@
$NetBSD: patch-ak,v 1.3 2006/10/10 06:56:05 uebayasi Exp $
--- as/mops.c.orig 1993-07-10 20:36:55.000000000 +0200
+++ as/mops.c
@@ -547,7 +547,7 @@ register struct ea_s *eap;
mcount += asize;
}
else if (lastexp.offset != 0x0 ||
- eap->base == BPREG && eap->index == NOREG ||
+ (eap->base == BPREG && eap->index == NOREG) ||
eap->base == EBPREG)
{
postb |= MEM1_MOD;
@@ -917,8 +917,8 @@ register struct ea_s *eap;
if (!(lastexp.data & UNDBIT) && lastexp.offset != 0x1)
{
if (eap->base <= MAX16BITINDREG ||
- lastexp.offset != 0x2 && lastexp.offset != 0x4 &&
- lastexp.offset != 0x8)
+ (lastexp.offset != 0x2 && lastexp.offset != 0x4 &&
+ lastexp.offset != 0x8))
error(ILL_SCALE);
else
{
@@ -1589,9 +1589,9 @@ PUBLIC void mgroup1()
{
if (target.indcount == 0x0 && (target.base == ALREG ||
target.base == AXREG ||
- target.base == EAXREG &&
+ (target.base == EAXREG &&
(source.displ.data & (FORBIT | RELBIT | UNDBIT) ||
- !is8bitsignedoffset(source.displ.offset))))
+ !is8bitsignedoffset(source.displ.offset)))))
{
opcode |= 0x04 | segword;
buildimm(&source, FALSE);
+22
View File
@@ -0,0 +1,22 @@
$NetBSD: patch-al,v 1.5 2006/10/10 06:56:05 uebayasi Exp $
--- as/pops.c.orig 1993-07-11 14:43:39.000000000 +0200
+++ as/pops.c
@@ -72,7 +72,7 @@ PUBLIC bool_pt checksegrel(symptr)
register struct sym_s *symptr;
{
if ((symptr->type & LABIT ||
- symptr->data & IMPBIT && !(symptr->data & UNDBIT)) &&
+ (symptr->data & IMPBIT && !(symptr->data & UNDBIT))) &&
((symptr->data ^ lcdata) & (RELBIT | SEGM)))
{
error(SEGREL);
@@ -263,7 +263,7 @@ unsigned char impbits;
PRIVATE void dofcc()
{
register char *bufptr;
- char byte;
+ signed char byte;
char delimiter;
register char *reglineptr;
+13
View File
@@ -0,0 +1,13 @@
$NetBSD: patch-am,v 1.3 2006/10/10 06:56:05 uebayasi Exp $
--- as/readsrc.c.orig 1993-07-10 21:06:52.000000000 +0200
+++ as/readsrc.c
@@ -220,7 +220,7 @@ PUBLIC void readline()
char *oldbufptr;
struct schain_s *parameters;
char paramnum;
- unsigned char remaining; /* space remaining in line + 2 */
+ unsigned short remaining; /* space remaining in line + 2 */
/* value 0 not used except for temp predec */
/* value 1 means error already gen */
/* values 1 and 2 mean no space */
+42
View File
@@ -0,0 +1,42 @@
$NetBSD: patch-an,v 1.3 2006/10/10 06:56:05 uebayasi Exp $
--- bcc/bcc.c.orig 1993-07-17 14:49:49.000000000 +0200
+++ bcc/bcc.c
@@ -27,20 +27,20 @@
#define P(x) ()
#endif
-#define AS "as"
+#define AS "as86"
#define BAS86
#define BCC86
-#define CC1 "cc1"
+#define CC1 "bcc-cc1"
#define CC1_MINUS_O_BROKEN FALSE
-#define CPP "cpp" /* normally a link to /usr/bin/bcc-cc1 */
+#define CPP "bcc-cc1" /* normally a link to /usr/bin/bcc-cc1 */
#define CPPFLAGS "-E"
#define CRT0 "crt0.o"
#define GCC "gcc"
-#define LD "ld"
-#define STANDARD_CRT0_0_PREFIX "/usr/local/lib/i86/"
-#define STANDARD_CRT0_3_PREFIX "/usr/local/lib/i386/"
-#define STANDARD_EXEC_PREFIX "/usr/local/libexec/i386/bcc/"
-#define STANDARD_EXEC_PREFIX_2 "/usr/bin/"
+#define LD "ld86"
+#define STANDARD_CRT0_0_PREFIX LOCALPREFIX "/lib/bcc/i86/"
+#define STANDARD_CRT0_3_PREFIX LOCALPREFIX "/lib/bcc/i386/"
+#define STANDARD_EXEC_PREFIX LOCALPREFIX "/lib/bcc/"
+#define STANDARD_EXEC_PREFIX_2 LOCALPREFIX "/bin/"
#ifdef CCC
#undef BCC86
@@ -553,7 +553,7 @@ char **argv;
{
arg = ldargs.argv[argc];
if (arg[0] == '-' && arg[1] == 'i'
- && (arg[2] == 0 || arg[2] == '-' && arg[3] == 0))
+ && (arg[2] == 0 || (arg[2] == '-' && arg[3] == 0)))
{
--ldargs.argc;
memmove(ldargs.argv + argc, ldargs.argv + argc + 1,
+27
View File
@@ -0,0 +1,27 @@
$NetBSD: patch-aq,v 1.2 2006/10/10 06:56:05 uebayasi Exp $
--- ld/ld.c.orig 1994-02-19 23:36:05.000000000 +0100
+++ ld/ld.c
@@ -3,7 +3,6 @@
/* Copyright (C) 1994 Bruce Evans */
#include "const.h"
-#include "byteord.h"
#include "type.h"
#include "globvar.h"
@@ -22,10 +21,13 @@ unsigned long strtoul P((const char *s,
#define R_OK 0
int access P((const char *path, int amode));
#else
-#undef NULL
#include <unistd.h>
#endif
+/* BSD #defines this in <machine/endian.h>, but with another sense */
+#undef BIG_ENDIAN
+#include "byteord.h"
+
#define MAX_LIBS (NR_STDLIBS + 5)
#define NR_STDLIBS 1
+13
View File
@@ -0,0 +1,13 @@
$NetBSD: patch-ar,v 1.2 2006/10/10 06:56:05 uebayasi Exp $
--- bcc/proto.h.orig 1992-11-14 16:12:34.000000000 +0100
+++ bcc/proto.h
@@ -381,8 +381,6 @@ void *malloc P((unsigned _nbytes));
void *realloc P((void *_ptr, unsigned _nbytes));
/* library - string.h */
-void *memcpy P((void *_t, const void *_s, unsigned _length));
-void *memset P((void *_s, int _c, unsigned _nbytes));
char *strcat P((char *_target, const char *_source));
char *strchr P((const char *_s, int _ch));
int strcmp P((const char *_s1, const char *_s2));
+20
View File
@@ -0,0 +1,20 @@
$NetBSD: patch-as,v 1.2 2006/10/10 06:56:05 uebayasi Exp $
--- ld/io.c.orig 1994-04-17 23:59:53.000000000 +0200
+++ ld/io.c
@@ -13,6 +13,7 @@ void *malloc P((unsigned size));
#else
#undef NULL
#include <stdlib.h>
+#include <string.h>
#endif
#ifdef POSIX_HEADERS_MISSING
@@ -33,7 +34,6 @@ int read P((int fd, void *buf, unsigned
mode_t umask P((int oldmask));
int write P((int fd, const void *buf, unsigned nbytes));
#else
-#undef NULL
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
+40
View File
@@ -0,0 +1,40 @@
$NetBSD: patch-at,v 1.2 2006/10/10 06:56:05 uebayasi Exp $
--- bcc/express.c.orig 1992-11-14 16:12:35.000000000 +0100
+++ bcc/express.c
@@ -21,7 +21,7 @@ PRIVATE unsigned insizeof; /* nest level
/* on p49 of K & R */
FORWARD struct nodestruct *cast_exp P((void));
-FORWARD struct nodestruct *exp2 P((void));
+FORWARD struct nodestruct *my_exp2 P((void));
FORWARD struct nodestruct *exp3to12 P((fastin_pt lprecedence));
FORWARD struct nodestruct *listargs P((void));
FORWARD struct nodestruct *postfix_exp P((bool_pt seenlp));
@@ -55,7 +55,7 @@ PUBLIC struct nodestruct *assignment_exp
struct nodestruct *lhs;
op_pt op;
- lhs = exp2();
+ lhs = my_exp2();
if (sym >= ASSIGNOP && sym <= SUBABOP) /* assign-op syms in order! */
{
op = sym;
@@ -78,7 +78,7 @@ PUBLIC struct nodestruct *expression()
return lhs;
}
-PRIVATE struct nodestruct *exp2()
+PRIVATE struct nodestruct *my_exp2()
{
struct nodestruct *lhs;
struct nodestruct *rhs;
@@ -89,7 +89,7 @@ PRIVATE struct nodestruct *exp2()
nextsym();
rhs = expression();
colon();
- lhs = node(CONDOP, lhs, node(COLONOP, rhs, exp2()));
+ lhs = node(CONDOP, lhs, node(COLONOP, rhs, my_exp2()));
}
return lhs;
}
+12
View File
@@ -0,0 +1,12 @@
$NetBSD: patch-au,v 1.1 2006/10/10 06:56:05 uebayasi Exp $
--- as/gensym.c.orig 1993-07-10 21:11:38.000000000 +0200
+++ as/gensym.c
@@ -17,7 +17,6 @@ int strcmp P((const char *s1, const char
#ifdef POSIX_HEADERS_MISSING
int write P((int fd, const void *buf, unsigned nbytes));
#else
-#undef NULL
#include <sys/types.h>
#include <unistd.h>
#endif
+13
View File
@@ -0,0 +1,13 @@
$NetBSD: patch-av,v 1.1 2006/10/10 06:56:05 uebayasi Exp $
--- bcc/input.c.orig 1992-11-14 16:12:36.000000000 +0100
+++ bcc/input.c
@@ -2,6 +2,8 @@
/* Copyright (C) 1992 Bruce Evans */
+#include <string.h>
+
#define ARBITRARY_BACKSLASH_NEWLINES_NOT
#define INSERT_BACKSLASH_NEWLINES_NOT
+13
View File
@@ -0,0 +1,13 @@
$NetBSD: patch-aw,v 1.1 2006/10/10 06:56:05 uebayasi Exp $
--- bcc/preproc.c.orig 1992-12-04 22:45:03.000000000 +0100
+++ bcc/preproc.c
@@ -2,6 +2,8 @@
/* Copyright (C) 1992 Bruce Evans */
+#include <string.h>
+
#include "const.h"
#include "types.h"
#include "input.h"
+13
View File
@@ -0,0 +1,13 @@
$NetBSD: patch-ax,v 1.1 2006/10/10 06:56:05 uebayasi Exp $
--- bcc/table.c.orig 1992-11-14 16:12:38.000000000 +0100
+++ bcc/table.c
@@ -6,6 +6,8 @@
* usually be set to some level different from OFFKLUDGELEVEL.
*/
+#include <string.h>
+
#include "const.h"
#include "types.h"
#include "align.h"