Config files to get Gnu CPP running under A/UX
Richard Michael Todd
rmtodd at uokmax.UUCP
Thu May 18 12:48:59 AEST 1989
I tried repeatedly to send this to Mike Shaff at Stanford, but Stanford
refuses to admit that any such machine exists, thus proving that at least
one machine has a more braindead mailer than ours does :-). Hopefully
someone else will find this useful as well. Anyway,
below is a shar file containing my tm-aux.h and xm-aux.h files that I used
when building cpp. Note that these *aren't* good enough for the whole of gcc
to work, just cpp. I have A/UX 1.0.1; if Apple ever ships me the update disks,
I'll find out if it works for 1.1 :-).
#--------------------------------CUT HERE-------------------------------------
#! /bin/sh
#
# This is a shell archive. Save this into a file, edit it
# and delete all lines above this comment. Then give this
# file to sh by executing the command "sh file". The files
# will be extracted into the current directory owned by
# you with default permissions.
#
# The files contained herein are:
#
# -rw-r--r-- 1 rmtodd 8976 Apr 9 00:13 tm-aux.h
# -rw-r--r-- 1 rmtodd 140 Apr 2 17:28 xm-aux.h
#
echo 'x - tm-aux.h'
if test -f tm-aux.h; then echo 'shar: not overwriting tm-aux.h'; else
sed 's/^X//' << '________This_Is_The_END________' > tm-aux.h
X/* Definitions of target machine for GNU compiler. A/UX version.
X Copyright (C) 1987, 1988 Free Software Foundation, Inc.
X
XThis file is part of GNU CC.
X
XGNU CC is free software; you can redistribute it and/or modify
Xit under the terms of the GNU General Public License as published by
Xthe Free Software Foundation; either version 1, or (at your option)
Xany later version.
X
XGNU CC is distributed in the hope that it will be useful,
Xbut WITHOUT ANY WARRANTY; without even the implied warranty of
XMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
XGNU General Public License for more details.
X
XYou should have received a copy of the GNU General Public License
Xalong with GNU CC; see the file COPYING. If not, write to
Xthe Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
X
X
X#include "tm-m68k-aux.h"
X/* See tm-m68k.h. 7 means 68020 with 68881. */
X
X#ifndef TARGET_DEFAULT
X#define TARGET_DEFAULT 7
X#endif
X
X/* Define __HAVE_FPA__ or __HAVE_68881__ in preprocessor,
X according to the -m flags.
X This will control the use of inline 68881 insns in certain macros.
X Also inform the program which CPU this is for. */
X
X#if TARGET_DEFAULT & 02
X
X/* -m68881 is the default */
X#define CPP_SPEC \
X"-D__HAVE_68881__ \
X%{!ansi:-Dmc68020}"
X
X#endif
X
X
X /* -m68000 requires special flags to the assembler. */
X
X#define ASM_SPEC \
X "%{m68000:-mc68010}%{mc68000:-mc68010}%{!mc68000:%{!m68000:-mc68020}}"
X
X /* Names to predefine in the preprocessor for this target machine. */
X
X#define CPP_PREDEFINES "-Dm68k -Dunix"
X
X /* STARTFILE_SPEC to include sun floating point initialization
X This is necessary (tr: Sun does it) for both the m68881 and the fpa
X routines.
X Note that includes knowledge of the default specs for gcc, ie. no
X args translates to the same effect as -m68881
X I'm not sure what would happen below if people gave contradictory
X arguments (eg. -msoft-float -mfpa) */
X
X#define STARTFILE_SPEC \
X "%{p:mcrt0.o%s}%{!p:crt0.o%s}"
X
X
X
X/* A/UX assembler seems to be like 3b1, so assembler-specific stuff is liberally
X * swiped from tm-3b1.h.--RMT
X */
X
X#define LINK_SPEC "%{p:-L/lib/libp }%{!p:%{g:-L/lib/libg }}%{g:-u _dbargs }"
X
X#define LIB_SPEC "%{g:-lg }-lc /usr/lib/shared.ld"
X
X /* Every structure or union's size must be a multiple of 2 bytes. */
X
X#define STRUCTURE_SIZE_BOUNDARY 16
X
X
X#define IDENT_DIRECTIVE
X#define ASM_OUTPUT_IDENT(FILE, NAME)
X
X/* Make output for SDB. */
X
X#define SDB_DEBUGGING_INFO
X
X/* The .file command should always begin the output. */
X
X#undef ASM_FILE_START
X#define ASM_FILE_START(FILE) sdbout_filename ((FILE), main_input_filename)
X
X/* Don't try to define `gcc_compiled.' since the assembler might not
X accept symbols with periods and GDB doesn't run on this machine anyway. */
X/* #define ASM_IDENTIFY_GCC(FILE) */
X
X/* Override parts of tm-m68k.h to fit the SGS-3b1 assembler. */
X
X#undef ASM_FORMAT_PRIVATE_NAME
X#undef ASM_OUTPUT_DOUBLE
X#undef ASM_OUTPUT_FLOAT
X#undef ASM_OUTPUT_ALIGN
X#undef ASM_OUTPUT_SOURCE_FILENAME
X#undef ASM_OUTPUT_SOURCE_LINE
X/* #undef PRINT_OPERAND_ADDRESS */
X#undef ASM_GENERATE_INTERNAL_LABEL
X#undef FUNCTION_PROFILER
X#undef ASM_OUTPUT_ADDR_VEC_ELT
X#undef ASM_OUTPUT_ADDR_DIFF_ELT
X#undef ASM_OUTPUT_INTERNAL_LABEL
X#undef ASM_OUTPUT_OPCODE
X#undef ASM_OUTPUT_LOCAL
X#undef ASM_OUTPUT_LABELREF
X#undef ASM_OUTPUT_ASCII
X
X#undef TARGET_VERSION
X#define TARGET_VERSION fprintf (stderr, " (68k, SGS/Apple AUX syntax)");
X
X/* Store in OUTPUT a string (made with alloca) containing
X an assembler-name for a local static variable named NAME.
X LABELNO is an integer which is different for each call. */
X
X#define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
X( (OUTPUT) = (char *) alloca (strlen ((NAME)) + 12), \
X sprintf ((OUTPUT), "%s_%%%d", (NAME), (LABELNO)))
X
X/* The unixpc doesn't know about double's and float's, and neither does A/UX. */
X
X#define ASM_OUTPUT_DOUBLE(FILE,VALUE) \
Xdo { union { double d; long l[2]; } tem; \
X tem.d = (VALUE); \
X fprintf(FILE, "\tlong 0x%x,0x%x\n", tem.l[0], tem.l[1]); \
X } while (0)
X
X#define ASM_OUTPUT_FLOAT(FILE,VALUE) \
Xdo { union { float f; long l;} tem; \
X tem.f = (VALUE); \
X fprintf (FILE, "\tlong 0x%x\n", tem.l); \
X } while (0)
X
X#define ASM_OUTPUT_ALIGN(FILE,LOG) \
X if ((LOG) == 1) \
X fprintf (FILE, "\teven\n"); \
X else if ((LOG) != 0) \
X abort ();
X
X/* The beginnings of sdb support... */
X
X#define ASM_OUTPUT_SOURCE_FILENAME(FILE, FILENAME) \
X fprintf (FILE, "\tfile\t\"%s\"\n", FILENAME)
X
X#define ASM_OUTPUT_SOURCE_LINE(FILE, LINENO) \
X fprintf (FILE, "\tln\t%d\n", \
X (sdb_begin_function_line \
X ? last_linenum - sdb_begin_function_line : 1))
X
X/* Yet another null terminated string format. */
X
X#define ASCII_DATA_ASM_OP "\tbyte"
X
X#define ASM_OUTPUT_ASCII(FILE,PTR,LEN) \
X { register int sp = 0, lp = 0; \
X fprintf (FILE, "\tbyte\t"); \
X loop: \
X if (PTR[sp] > ' ' && ! (PTR[sp] & 0x80) && PTR[sp] != '\\') \
X { lp += 3; \
X fprintf (FILE, "'%c", PTR[sp]); } \
X else \
X { lp += 5; \
X fprintf (FILE, "0x%x", PTR[sp]); } \
X if (++sp < LEN) \
X { if (lp > 60) \
X { lp = 0; \
X fprintf (FILE, "\n%s ", ASCII_DATA_ASM_OP); } \
X else \
X putc (',', FILE); \
X goto loop; } \
X putc ('\n', FILE); }
X
X/* Note that in the case of the movhi which fetches an element of
X an ADDR_DIFF_VEC the offset output is too large by 2.
X This is because the 3b1 assembler refuses to subtract 2.
X ASM_OUTPUT_CASE_LABEL, below, compensates for this. */
X
X
X#define ASM_GENERATE_INTERNAL_LABEL(LABEL, PREFIX, NUM) \
X sprintf ((LABEL), "%s%%%d", (PREFIX), (NUM))
X
X#define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \
X fprintf (FILE, "%s%%%d:\n", PREFIX, NUM)
X
X/* Must put address in %a0 , not %d0 . -- LGM, 7/15/88 */
X#define FUNCTION_PROFILER(FILE, LABEL_NO) \
X fprintf (FILE, "\tmov.l &LP%%%d,%%a0\n\tjsr mcount\n", (LABEL_NO))
X
X#define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \
X fprintf (FILE, "\tlong L%%%d\n", (VALUE))
X
X#define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, VALUE, REL) \
X fprintf (FILE, "\tshort L%%%d-L%%%d\n", (VALUE), (REL))
X
X
X/* ihnp4!lmayk!lgm says that `short 0' triggers assembler bug;
X `short L%nn-L%nn' supposedly works. */
X#define ASM_OUTPUT_CASE_LABEL(FILE,PREFIX,NUM,TABLE) \
X if (! RTX_INTEGRATED_P (TABLE)) \
X fprintf (FILE, "\tswbeg &%d\n%s%%%d:\n", \
X XVECLEN (PATTERN (TABLE), 1), (PREFIX), (NUM)); \
X else \
X fprintf (FILE, "\tswbeg &%d\n%s%%%d:\n\tshort %s%%%d-%s%%%d\n", \
X XVECLEN (PATTERN (TABLE), 1) + 1, (PREFIX), (NUM), \
X (PREFIX), (NUM), (PREFIX), (NUM))
X
X/* At end of a switch table, define LD%n iff the symbol LI%n was defined. */
X#define ASM_OUTPUT_CASE_END(FILE,NUM,TABLE) \
X if (RTX_INTEGRATED_P (TABLE)) \
X fprintf (FILE, "\tset LD%%%d,L%%%d-LI%%%d\n", (NUM), (NUM), (NUM))
X
X#define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE, ROUNDED) \
X( fputs ("\tlcomm ", (FILE)), \
X assemble_name ((FILE), (NAME)), \
X fprintf ((FILE), ",%d\n", (ROUNDED)))
X
X#define ASM_OUTPUT_LABELREF(FILE,NAME) \
X fprintf (FILE, "%s", NAME)
X
X/* Override usual definitions of SDB output macros.
X These definitions differ only in the absence of the period
X at the beginning of the name of the directive
X and in the use of `~' as the symbol for the current location. */
X
X#define PUT_SDB_SCL(a) fprintf(asm_out_file, "\tscl\t%d;", (a))
X#define PUT_SDB_INT_VAL(a) fprintf (asm_out_file, "\tval\t%d;", (a))
X#define PUT_SDB_VAL(a) \
X( fputs ("\tval\t", asm_out_file), \
X output_addr_const (asm_out_file, (a)), \
X fputc (';', asm_out_file))
X
X#define PUT_SDB_DEF(a) \
Xdo { fprintf (asm_out_file, "\tdef\t"); \
X ASM_OUTPUT_LABELREF (asm_out_file, a); \
X fprintf (asm_out_file, ";"); } while (0)
X
X#define PUT_SDB_PLAIN_DEF(a) fprintf(asm_out_file,"\tdef\t~%s;",a)
X#define PUT_SDB_ENDEF fputs("\tendef\n", asm_out_file)
X#define PUT_SDB_TYPE(a) fprintf(asm_out_file, "\ttype\t0%o;", a)
X#define PUT_SDB_SIZE(a) fprintf(asm_out_file, "\tsize\t%d;", a)
X#define PUT_SDB_DIM(a) fprintf(asm_out_file, "\tdim\t%d;", a)
X
X#define PUT_SDB_TAG(a) \
Xdo { fprintf (asm_out_file, "\ttag\t"); \
X ASM_OUTPUT_LABELREF (asm_out_file, a); \
X fprintf (asm_out_file, ";"); } while (0)
X
X#define PUT_SDB_BLOCK_START(LINE) \
X fprintf (asm_out_file, \
X "\tdef\t~bb;\tval\t~;\tscl\t100;\tline\t%d;\tendef\n", \
X (LINE))
X
X#define PUT_SDB_BLOCK_END(LINE) \
X fprintf (asm_out_file, \
X "\tdef\t~eb;\tval\t~;\tscl\t100;\tline\t%d;\tendef\n", \
X (LINE))
X
X#define PUT_SDB_FUNCTION_START(LINE) \
X fprintf (asm_out_file, \
X "\tdef\t~bf;\tval\t~;\tscl\t101;\tline\t%d;\tendef\n", \
X (LINE))
X
X#define PUT_SDB_FUNCTION_END(LINE) \
X fprintf (asm_out_file, \
X "\tdef\t~ef;\tval\t~;\tscl\t101;\tline\t%d;\tendef\n", \
X (LINE))
X
X#define PUT_SDB_EPILOGUE_END(NAME) \
X fprintf (asm_out_file, \
X "\tdef\t%s;\tval\t~;\tscl\t-1;\tendef\n", \
X (NAME))
X
X#define SDB_GENERATE_FAKE(BUFFER, NUMBER) \
X sprintf ((BUFFER), "~%dfake", (NUMBER));
X
X
________This_Is_The_END________
if test `wc -l < tm-aux.h` -ne 280; then
echo 'shar: tm-aux.h was damaged during transit (should have been 280 bytes)'
fi
fi ; : end of overwriting check
echo 'x - xm-aux.h'
if test -f xm-aux.h; then echo 'shar: not overwriting xm-aux.h'; else
sed 's/^X//' << '________This_Is_The_END________' > xm-aux.h
X#define USG
X
X#include "xm-m68k.h"
X
X#define bcopy(a,b,c) memcpy (b,a,c)
X#define bzero(a,b) memset (a,0,b)
X#define bcmp(a,b,c) memcmp (a,b,c)
________This_Is_The_END________
if test `wc -l < xm-aux.h` -ne 7; then
echo 'shar: xm-aux.h was damaged during transit (should have been 7 bytes)'
fi
fi ; : end of overwriting check
exit 0
More information about the Comp.unix.aux
mailing list