diff options
author | Niklas Hallqvist <niklas@cvs.openbsd.org> | 1998-02-14 19:27:17 +0000 |
---|---|---|
committer | Niklas Hallqvist <niklas@cvs.openbsd.org> | 1998-02-14 19:27:17 +0000 |
commit | 6de8cb0481bd793706e38dead271f9233a57b7e5 (patch) | |
tree | 7ff9ff6922a48636469d3b019d912ee0b7894c00 /gnu/usr.bin/gcc/config/m68k | |
parent | 627e15b4811e5758670f68174f71540e63fb4040 (diff) |
Diffstat (limited to 'gnu/usr.bin/gcc/config/m68k')
23 files changed, 1376 insertions, 0 deletions
diff --git a/gnu/usr.bin/gcc/config/m68k/a-ux.h b/gnu/usr.bin/gcc/config/m68k/a-ux.h new file mode 100644 index 00000000000..74aaa4ea9ad --- /dev/null +++ b/gnu/usr.bin/gcc/config/m68k/a-ux.h @@ -0,0 +1,206 @@ +/* Definitions for Motorola 680x0 running A/UX + Copyright (C) 1996 Free Software Foundation, Inc. + +This file is part of GNU CC. + +GNU CC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU CC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU CC; see the file COPYING. If not, write to +the Free Software Foundation, 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +/* This file was renamed from aux.h because of MSDOS: aux.anything + isn't usable. Sigh. */ + +/* Execution environment */ + +#undef TARGET_DEFAULT +#define TARGET_DEFAULT (MASK_BITFIELD|MASK_68881|MASK_68020) /* 68020, 68881 */ + +#define CPP_PREDEFINES "-Dunix -Dm68k -DAUX -DmacII \ +-Asystem(unix) -Asystem(AUX) -Acpu(m68k) -Amachine(m68k) -Amachine(macII)" + +#define CPP_SPEC \ +"%{!msoft-float:%{!ansi:-Dmc68881 }-D__HAVE_68881__ }\ +-Acpu(mc68000) -D__mc68000__ %{!ansi:-Dmc68000 }\ +%{!mc68000:%{!m68000:-Acpu(mc68020) -D__mc68020__ %{!ansi:-Dmc68020 }}}\ +%{m68030:-Acpu(mc68030) -D__mc68030__ %{!ansi:-Dmc68030 }}\ +%{m68040:-Acpu(mc68040) -D__mc68040__ %{!ansi:-Dmc68040 }}\ +%{!ansi:%{!traditional:-D__STDC__=2 }}\ +%{sbsd:-D_BSD_SOURCE -DBSD }%{ZB:-D_BSD_SOURCE -DBSD }\ +%{ssysv:-D_SYSV_SOURCE -DSYSV -DUSG }%{ZS:-D_SYSV_SOURCE -DSYSV -DUSG }\ +%{sposix:-D_POSIX_SOURCE -DPOSIX }%{ZP:-D_POSIX_SOURCE -DPOSIX }\ +%{sposix+:-D_POSIX_SOURCE -DPOSIX }\ +%{saux:-D_AUX_SOURCE }%{ZA:-D_AUX_SOURCE }\ +%{!sbsd:%{!ZB:%{!ssysv:%{!ZS:%{!sposix:%{!ZP:%{!snone:\ +-D_BSD_SOURCE -D_SYSV_SOURCE -D_AUX_SOURCE }}}}}}}" + +#define LIB_SPEC \ +"%{sbsd:-lbsd }%{ZB:-lbsd }\ +%{ssysv:-lsvid }%{ZS:-lsvid }\ +%{sposix:-lposix }%{ZP:-lposix }%{sposix+:-lposix }\ +%{!static:%{smac:-lmac_s -lat -lld -lmr }-lc_s }\ +%{static:%{smac:-lmac -lat -lld -lmr }-lc }" + +#undef STARTFILE_SPEC +#define STARTFILE_SPEC \ +"%{pg:mcrt0.o%s }%{!pg:%{p:mcrt1.o%s }\ +%{!p:%{smac:maccrt1.o%s low.o%s }%{!smac:crt1.o%s }}}\ +crt2.o%s " + +#undef ENDFILE_SPEC +#define ENDFILE_SPEC "crtn.o%s " + + +/*===================================================================*/ +/* Compilation environment -- mostly */ + +#define NO_SYS_SIGLIST + +/* We provide atexit(), A/UX does not have it */ +#define HAVE_ATEXIT + +/* Generate calls to memcpy, memcmp and memset, as opposed to bcopy, bcmp, + and bzero */ +#define TARGET_MEM_FUNCTIONS + +/* Resize standard types */ + +#undef SIZE_TYPE +#define SIZE_TYPE "unsigned int" + +#undef PTRDIFF_TYPE +#define PTRDIFF_TYPE "int" + +#undef WCHAR_TYPE +#define WCHAR_TYPE "unsigned int" + +/* Every structure or union's size must be a multiple of 2 bytes. */ +#define STRUCTURE_SIZE_BOUNDARY 16 + +/* Bits needed by collect */ + +#define OBJECT_FORMAT_COFF +#define MY_ISCOFF(m) ((m) == M68TVMAGIC || \ + (m) == M68MAGIC || \ + (m) == MC68TVMAGIC || \ + (m) == MC68MAGIC || \ + (m) == M68NSMAGIC) + + +#ifndef USE_COLLECT2 +/* For .ctor/.dtor sections for collecting constructors */ +/* We have special start/end files for defining [cd]tor lists */ +#define CTOR_LISTS_DEFINED_EXTERNALLY +#endif + + +/*======================================================================*/ +/* Calling convention and library support changes */ + +/* Define how to generate (in the callee) the output value of a function + and how to find (in the caller) the value returned by a function. VALTYPE + is the data type of the value (as a tree). If the precise function being + called is known, FUNC is its FUNCTION_DECL; otherwise, FUNC is 0. + For A/UX generate the result in d0, a0, or fp0 as appropriate. */ + +#undef FUNCTION_VALUE +#define FUNCTION_VALUE(VALTYPE, FUNC) \ + (TREE_CODE (VALTYPE) == REAL_TYPE && TARGET_68881 \ + ? gen_rtx (REG, TYPE_MODE (VALTYPE), 16) \ + : (TREE_CODE (VALTYPE) == POINTER_TYPE \ + ? gen_rtx (REG, TYPE_MODE (VALTYPE), 8) \ + : gen_rtx (REG, TYPE_MODE (VALTYPE), 0))) + +#undef LIBCALL_VALUE +#define LIBCALL_VALUE(MODE) \ + gen_rtx (REG, (MODE), ((TARGET_68881 && \ + ((MODE) == SFmode || (MODE) == DFmode)) ? 16 : 0)) + +/* 1 if N is a possible register number for a function value. + For A/UX allow d0, a0, or fp0 as return registers, for integral, + pointer, or floating types, respectively. Reject fp0 if not using a + 68881 coprocessor. */ + +#undef FUNCTION_VALUE_REGNO_P +#define FUNCTION_VALUE_REGNO_P(N) \ + ((N) == 0 || (N) == 8 || (TARGET_68881 && (N) == 16)) + +/* Define this to be true when FUNCTION_VALUE_REGNO_P is true for + more than one register. */ + +#undef NEEDS_UNTYPED_CALL +#define NEEDS_UNTYPED_CALL 1 + +/* For compatibility with the large body of existing code which does not + always properly declare external functions returning pointer types, the + A/UX convention is to copy the value returned for pointer functions + from a0 to d0 in the function epilogue, so that callers that have + neglected to properly declare the callee can still find the correct return + value. */ + +#define FUNCTION_EXTRA_EPILOGUE(FILE, SIZE) \ +{ \ + extern int current_function_returns_pointer; \ + if ((current_function_returns_pointer) && \ + ! find_equiv_reg (0, get_last_insn (), 0, 0, 0, 8, Pmode)) \ + asm_fprintf (FILE, "\t%s %Ra0,%Rd0\n", ASM_MOV_INSN); \ +} + +/* How to call the function profiler */ + +#undef FUNCTION_PROFILER +#define FUNCTION_PROFILER(FILE, LABELNO) \ + asm_fprintf (FILE, "\t%Olea %LLP%d,%Ra0\n\t%Ojbsr %s\n", \ + (LABELNO), FUNCTION_PROFILER_SYMBOL) + +/* Finalize the trampoline by flushing the insn cache */ + +#undef FINALIZE_TRAMPOLINE +#define FINALIZE_TRAMPOLINE(TRAMP) \ + emit_library_call(gen_rtx(SYMBOL_REF, Pmode, "__clear_cache"), \ + 0, VOIDmode, 2, TRAMP, Pmode, \ + plus_constant(TRAMP, TRAMPOLINE_SIZE), Pmode); + +/* Clear the instruction cache from `beg' to `end'. This makes an + inline system call to SYS_sysm68k. The arguments are as follows: + + sysm68k(105, addr, scope, cache, len) + + 105 - the subfunction code to clear the cache + addr - the start address for the flush + scope - the scope of the flush (see the cpush insn) + cache - which cache to flush (see the cpush insn) + len - a factor relating to the number of flushes to perform : + len/16 lines, or len/4096 pages. + + While all this is only really relevant to 040's, the system call + will just return an error (which we ignore) on other systems. */ + +#define CLEAR_INSN_CACHE(beg, end) \ +{ \ + unsigned _beg = (unsigned)(beg), _end = (unsigned)(end); \ + unsigned _len = ((_end / 16) - (_beg / 16) + 1) * 16; \ + __asm __volatile( \ + ASM_MOV_INSN " %1, %-\n\t" /* nr lines */ \ + ASM_MOV_INSN " %#3, %-\n\t" /* insn+data caches */ \ + ASM_MOV_INSN " %#1, %-\n\t" /* clear lines */ \ + ASM_MOV_INSN " %0, %-\n\t" /* beginning of buffer */ \ + ASM_MOV_INSN " %#105, %-\n\t" /* cache sub-function nr */ \ + ASM_MOV_INSN " %#0, %-\n\t" /* dummy return address */ \ + ASM_MOV_INSN " %#38, %/d0\n\t" /* system call nr */ \ + "trap %#0\n\t" \ + "add%.l %#24, %/sp" \ + : /* no outputs */ \ + : "g"(_beg), "g"(_len) \ + : "%d0"); \ +} diff --git a/gnu/usr.bin/gcc/config/m68k/aux-crt1.c b/gnu/usr.bin/gcc/config/m68k/aux-crt1.c new file mode 100644 index 00000000000..9ee529b053d --- /dev/null +++ b/gnu/usr.bin/gcc/config/m68k/aux-crt1.c @@ -0,0 +1,134 @@ +/* Startup code for A/UX + Copyright (C) 1996 Free Software Foundation, Inc. + +This file is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 2, or (at your option) any +later version. + +In addition to the permissions in the GNU General Public License, the +Free Software Foundation gives you unlimited permission to link the +compiled version of this file with other programs, and to distribute +those programs without any restriction coming from the use of this +file. (The General Public License restrictions do apply in other +respects; for example, they cover modification of the file, and +distribution when not linked into another program.) + +This file is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; see the file COPYING. If not, write to +the Free Software Foundation, 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +/* As a special exception, if you link this library with files + compiled with GCC to produce an executable, this does not cause + the resulting executable to be covered by the GNU General Public License. + This exception does not however invalidate any other reasons why + the executable file might be covered by the GNU General Public License. */ + +/* This file is compiled three times to produce crt1.o, mcrt1.o, and + maccrt1.o. The final two are created by defining MCRT1 and MACCRT1 + respectively. */ + +#include <stdlib.h> +#ifdef MCRT1 +#include <unistd.h> +#include <mon.h> +#endif + +/* Extern function declarations */ + +extern void initfpu(void); +extern void __istart(void); +extern void __compatmode(void); +extern void _cleanup(void); +extern int main(int, char **, char **); +extern void exit(int) __attribute__((noreturn)); +extern void _exit(int) __attribute__((noreturn)); + +#ifdef MACCRT1 +extern void InitMac(void); +#endif +#ifdef MCRT1 +static void monitor_start(void); +#endif + +/* Global variables */ + +char **environ; +char *__splimit; /* address of top of stack */ + + +/* Initialize system and run */ + +void _start() __attribute__((noreturn)); +void _start() +{ + register int *fp __asm__("%a6"); + register char *d0 __asm__("%d0"); + char **argv; + int argc; + + __splimit = d0; + argc = fp[1]; + argv = (char **)&fp[2]; + environ = &argv[argc+1]; + + initfpu(); + __istart(); + __compatmode(); + + atexit(_cleanup); +#ifdef MCRT1 + monitor_start(); +#endif +#ifdef MACCRT1 + InitMac(); +#endif + + exit(main(argc, argv, environ)); +} + + +#ifdef MCRT1 +/* Start/Stop program monitor */ + +extern void monitor(void *, void *, WORD *, int, int); + +static WORD *monitor_buffer; + +static void monitor_cleanup(void) +{ + monitor(NULL, NULL, NULL, 0, 0); + free(monitor_buffer); +} + +static void monitor_start(void) +{ + extern int etext; + extern int stext __asm__(".text"); + + /* Choice of buffer size should be "no more than a few times + smaller than the program size" -- I don't believe that there + are any (useful) functions smaller than two insns (4 bytes) + so that is the scale factor used here */ + int len = (&etext - &stext + 1) / 4; + + monitor_buffer = (WORD *)calloc(len, sizeof(WORD)); + if (monitor_buffer == NULL) + { + static const char msg[] = "mcrt1: could not allocate monitor buffer\n"; + write(2, msg, sizeof(msg)-1); + _exit(-1); + } + + /* I'm not sure why the count cap at 600 -- but that is what A/UX does */ + monitor(&stext, &etext, monitor_buffer, len, 600); + + atexit(monitor_cleanup); +} +#endif /* MCRT1 */ diff --git a/gnu/usr.bin/gcc/config/m68k/aux-crt2.asm b/gnu/usr.bin/gcc/config/m68k/aux-crt2.asm new file mode 100644 index 00000000000..062c16ae8c2 --- /dev/null +++ b/gnu/usr.bin/gcc/config/m68k/aux-crt2.asm @@ -0,0 +1,42 @@ +/* More startup code for A/UX */ + +#include "tm.h" + +#ifdef USE_BIN_AS + file "crt2.s" + +/* The init section is used to support shared libraries */ + init + global __istart + +__istart: + link %fp,&-4 +#else + .file "crt2.s" + +/* The init section is used to support shared libraries */ +.section .init, "x" +.even +.globl __istart + +__istart: + link %fp,#-4 + +#ifndef USE_COLLECT2 +/* The ctors and dtors sections are used to support COFF collection of + c++ constructors and destructors */ +.section .ctors, "d" +.even +.globl __CTOR_LIST__ + +__CTOR_LIST__: + .long -1 + +.section .dtors, "d" +.even +.globl __DTOR_LIST__ + +__DTOR_LIST__: + .long -1 +#endif /* USE_COLLECT2 */ +#endif /* USE_BIN_AS */ diff --git a/gnu/usr.bin/gcc/config/m68k/aux-crtn.asm b/gnu/usr.bin/gcc/config/m68k/aux-crtn.asm new file mode 100644 index 00000000000..ce63d7fead7 --- /dev/null +++ b/gnu/usr.bin/gcc/config/m68k/aux-crtn.asm @@ -0,0 +1,26 @@ +/* More startup code for A/UX */ + +#include "tm.h" + +#ifdef USE_BIN_AS + file "crtn.s" + + init + + unlk %fp + rts +#else + .file "crtn.s" + +.section .init, "x" + unlk %fp + rts + +#ifndef USE_COLLECT2 +.section .ctors, "d" + .long 0 + +.section .dtors, "d" + .long 0 +#endif /* USE_COLLECT2 */ +#endif /* USE_BIN_AS */ diff --git a/gnu/usr.bin/gcc/config/m68k/aux-exit.c b/gnu/usr.bin/gcc/config/m68k/aux-exit.c new file mode 100644 index 00000000000..fe06c77c406 --- /dev/null +++ b/gnu/usr.bin/gcc/config/m68k/aux-exit.c @@ -0,0 +1,99 @@ +/* Generic atexit() + Copyright (C) 1996 Free Software Foundation, Inc. + +This file is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 2, or (at your option) any +later version. + +In addition to the permissions in the GNU General Public License, the +Free Software Foundation gives you unlimited permission to link the +compiled version of this file with other programs, and to distribute +those programs without any restriction coming from the use of this +file. (The General Public License restrictions do apply in other +respects; for example, they cover modification of the file, and +distribution when not linked into another program.) + +This file is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; see the file COPYING. If not, write to +the Free Software Foundation, 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +/* As a special exception, if you link this library with files + compiled with GCC to produce an executable, this does not cause + the resulting executable to be covered by the GNU General Public License. + This exception does not however invalidate any other reasons why + the executable file might be covered by the GNU General Public License. */ + +/* Rather than come up with some ugly hack to make mcrt1 work, it is + better to just go ahead and provide atexit(). */ + + +#include <stdlib.h> + + +void exit(int) __attribute__((noreturn)); +void _exit(int) __attribute__((noreturn)); +void _cleanup(void); + + +#define FNS_PER_BLOCK 32 + +struct atexit_fn_block +{ + struct atexit_fn_block *next; + void (*fns[FNS_PER_BLOCK])(void); + short used; +}; + + +/* staticly allocate the first block */ +static struct atexit_fn_block atexit_fns; +static struct atexit_fn_block *current_block = &atexit_fns; + + +int atexit(void (*fn)(void)) +{ + if (current_block->used >= FNS_PER_BLOCK) + { + struct atexit_fn_block *new_block = + (struct atexit_fn_block *)malloc(sizeof(struct atexit_fn_block)); + if (new_block == NULL) + return -1; + + new_block->used = 0; + new_block->next = current_block; + current_block = new_block; + } + + current_block->fns[current_block->used++] = fn; + + return 0; +} + + +void exit(int status) +{ + struct atexit_fn_block *block = current_block, *old_block; + short i; + + while (1) + { + for (i = block->used; --i >= 0 ;) + (*block->fns[i])(); + if (block == &atexit_fns) + break; + /* I know what you are thinking -- we are about to exit, why free? + Because it is friendly to memory leak detectors, that's why. */ + old_block = block; + block = block->next; + free(old_block); + } + + _exit(status); +} diff --git a/gnu/usr.bin/gcc/config/m68k/aux-low.gld b/gnu/usr.bin/gcc/config/m68k/aux-low.gld new file mode 100644 index 00000000000..d1bb2a99080 --- /dev/null +++ b/gnu/usr.bin/gcc/config/m68k/aux-low.gld @@ -0,0 +1,38 @@ +/* GLD link script for building mac-compatible executables */ + +OUTPUT_FORMAT("coff-m68k") + +SEARCH_DIR(@tooldir@/lib); +SEARCH_DIR(@libdir@); +SEARCH_DIR(/lib); +SEARCH_DIR(/usr/lib); +SEARCH_DIR(@local_prefix@/lib); + +ENTRY(_start) + +SECTIONS +{ + .lowmem 0 (DSECT) : { + /usr/lib/low.o (.data) + } + .text 0x10000000 : { + *(.text) + *(.init) + *(.fini) + etext = .; + _etext = .; + } + .data ALIGN(0x40000) : { + *(.data) + *(.ctors) + *(.dtors) + edata = .; + _edata = .; + } + .bss : { + *(.bss) + *(COMMON) + end = .; + _end = .; + } +} diff --git a/gnu/usr.bin/gcc/config/m68k/aux-mcount.c b/gnu/usr.bin/gcc/config/m68k/aux-mcount.c new file mode 100644 index 00000000000..1001c84762b --- /dev/null +++ b/gnu/usr.bin/gcc/config/m68k/aux-mcount.c @@ -0,0 +1,69 @@ +/* Profiling support code for A/UX + Copyright (C) 1996 Free Software Foundation, Inc. + +This file is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 2, or (at your option) any +later version. + +In addition to the permissions in the GNU General Public License, the +Free Software Foundation gives you unlimited permission to link the +compiled version of this file with other programs, and to distribute +those programs without any restriction coming from the use of this +file. (The General Public License restrictions do apply in other +respects; for example, they cover modification of the file, and +distribution when not linked into another program.) + +This file is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; see the file COPYING. If not, write to +the Free Software Foundation, 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +/* As a special exception, if you link this library with files + compiled with GCC to produce an executable, this does not cause + the resulting executable to be covered by the GNU General Public License. + This exception does not however invalidate any other reasons why + the executable file might be covered by the GNU General Public License. */ + +/* This routine is called at the beginning of functions compiled with -p + or -pg. The A/UX libraries call mcount%, but gas cannot generate + symbols with embedded percent signs. Previous ports of GCC to A/UX + have done things like (1) assemble a stub routine with the native + assembler, or (2) assemble a stub routine with gas and edit the object + file. This solution has the advantage that it can interoperate with + the A/UX version and can be used in an eventual port of glibc to A/UX. */ + +#ifndef __GNUC__ +#error This file uses GNU C extensions +#endif + +#include <mon.h> + +#ifdef IN_GCC +#include "tm.h" +#endif + +struct cnt *_countbase; + +#ifdef FUNCTION_PROFILER_SYMBOL +void __mcount() __asm__(FUNCTION_PROFILER_SYMBOL); +#endif + +void __mcount() +{ + register long **pfncnt __asm__("%a0"); + register long *fncnt = *pfncnt; + + if (!fncnt) + { + struct cnt *newcnt = _countbase++; + newcnt->fnpc = (char *)__builtin_return_address(0); + *pfncnt = fncnt = &newcnt->mcnt; + } + *fncnt += 1; +} diff --git a/gnu/usr.bin/gcc/config/m68k/auxas.h b/gnu/usr.bin/gcc/config/m68k/auxas.h new file mode 100644 index 00000000000..794df51558f --- /dev/null +++ b/gnu/usr.bin/gcc/config/m68k/auxas.h @@ -0,0 +1,189 @@ +/* Definitions for Motorola 680x0 running A/UX using /bin/as + Copyright (C) 1996, 1997 Free Software Foundation, Inc. + +This file is part of GNU CC. + +GNU CC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU CC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU CC; see the file COPYING. If not, write to +the Free Software Foundation, 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +#define USE_BIN_AS + +#ifndef USE_COLLECT2 +#define USE_COLLECT2 +#endif + +#ifndef __ASSEMBLY__ + +#include "m68k/sgs.h" + +#define ASM_SPEC "%{m68030:-68030 }%{m68040:-68040 }" + +/* Modify AT&T SGS assembler syntax */ +/* A/UX's as doesn't do dots in pseudo-ops */ + +#define SDB_DEBUGGING_INFO + +#define NO_DOLLAR_IN_LABEL +#define NO_DOT_IN_LABEL + +#undef TEXT_SECTION_ASM_OP +#define TEXT_SECTION_ASM_OP "\ttext" + +#undef DATA_SECTION_ASM_OP +#define DATA_SECTION_ASM_OP "\tdata\t1" + +#undef BYTE_ASM_OP +#define BYTE_ASM_OP "byte" + +#undef WORD_ASM_OP +#define WORD_ASM_OP "short" + +#undef LONG_ASM_OP +#define LONG_ASM_OP "long" + +#undef SPACE_ASM_OP +#define SPACE_ASM_OP "space" + +#undef ALIGN_ASM_OP +#define ALIGN_ASM_OP "align" + +#undef GLOBAL_ASM_OP +#define GLOBAL_ASM_OP "\tglobal" + +#undef SWBEG_ASM_OP +#define SWBEG_ASM_OP "swbeg" + +#undef SET_ASM_OP +#define SET_ASM_OP "set" + +#undef ASM_PN_FORMAT +#define ASM_PN_FORMAT "%s%%%d" + +#undef LOCAL_LABEL_PREFIX +#define LOCAL_LABEL_PREFIX "L%" + +#define ADDITIONAL_REGISTER_NAMES { "%a6", 14, "%a7", 15 } + +#undef ASM_OUTPUT_INT +#define ASM_OUTPUT_INT(FILE,VALUE) \ +( fprintf ((FILE), "\t%s ", LONG_ASM_OP), \ + output_addr_const ((FILE), (VALUE)), \ + fprintf ((FILE), "\n")) + +#undef ASM_OUTPUT_COMMON +#define ASM_OUTPUT_COMMON(FILE, NAME, SIZE, ROUNDED) \ +( fputs ("\tcomm\t", (FILE)), \ + assemble_name ((FILE), (NAME)), \ + fprintf ((FILE), ",%u\n", (ROUNDED))) + +#undef ASM_OUTPUT_LOCAL +#define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE, ROUNDED) \ +( fputs ("\tlcomm\t", (FILE)), \ + assemble_name ((FILE), (NAME)), \ + fprintf ((FILE), ",%u\n", (ROUNDED))) + +#undef ASM_FILE_START +#define ASM_FILE_START(FILE) \ + output_file_directive ((FILE), main_input_filename) + +#undef ASM_OUTPUT_SOURCE_FILENAME +#define ASM_OUTPUT_SOURCE_FILENAME(FILE, NAME) \ +( fputs ("\tfile\t", (FILE)), \ + output_quoted_string ((FILE), (NAME)), \ + fputc ('\n', (FILE)) ) + +#undef ASM_OUTPUT_CASE_FETCH +#define ASM_OUTPUT_CASE_FETCH(file, labelno, regname) \ + asm_fprintf (file, "10(%Rpc,%s.", regname) + +#define SGS_NO_LI + +/* Random macros describing parts of SDB data. */ + +#define PUT_SDB_SCL(a) \ + fprintf(asm_out_file, "\tscl\t%d%s", (a), SDB_DELIM) + +#define PUT_SDB_INT_VAL(a) \ + fprintf (asm_out_file, "\tval\t%d%s", (a), SDB_DELIM) + +#define PUT_SDB_VAL(a) \ +( fputs ("\tval\t", asm_out_file), \ + output_addr_const (asm_out_file, (a)), \ + fprintf (asm_out_file, SDB_DELIM)) + +#define PUT_SDB_DEF(a) \ +do { fprintf (asm_out_file, "\tdef\t"); \ + ASM_OUTPUT_LABELREF (asm_out_file, a); \ + fprintf (asm_out_file, SDB_DELIM); } while (0) + +#define PUT_SDB_PLAIN_DEF(a) fprintf(asm_out_file,"\tdef\t~%s%s", a, SDB_DELIM) + +#define PUT_SDB_ENDEF fputs("\tendef\n", asm_out_file) + +#define PUT_SDB_TYPE(a) fprintf(asm_out_file, "\ttype\t0%o%s", a, SDB_DELIM) + +#define PUT_SDB_SIZE(a) fprintf(asm_out_file, "\tsize\t%d%s", a, SDB_DELIM) + +#define PUT_SDB_START_DIM fprintf(asm_out_file, "\tdim\t") + +#define PUT_SDB_NEXT_DIM(a) fprintf(asm_out_file, "%d,", a) + +#define PUT_SDB_LAST_DIM(a) fprintf(asm_out_file, "%d%s", a, SDB_DELIM) + +#define PUT_SDB_TAG(a) \ +do { fprintf (asm_out_file, "\ttag\t"); \ + ASM_OUTPUT_LABELREF (asm_out_file, a); \ + fprintf (asm_out_file, SDB_DELIM); } while (0) + +#define PUT_SDB_BLOCK_START(LINE) \ + fprintf (asm_out_file, \ + "\tdef\t~bb%s\tval\t~%s\tscl\t100%s\tline\t%d%s\tendef\n", \ + SDB_DELIM, SDB_DELIM, SDB_DELIM, (LINE), SDB_DELIM) + +#define PUT_SDB_BLOCK_END(LINE) \ + fprintf (asm_out_file, \ + "\tdef\t~eb%s\tval\t~%s\tscl\t100%s\tline\t%d%s\tendef\n", \ + SDB_DELIM, SDB_DELIM, SDB_DELIM, (LINE), SDB_DELIM) + +#define PUT_SDB_FUNCTION_START(LINE) \ + fprintf (asm_out_file, \ + "\tdef\t~bf%s\tval\t~%s\tscl\t101%s\tline\t%d%s\tendef\n", \ + SDB_DELIM, SDB_DELIM, SDB_DELIM, (LINE), SDB_DELIM) + +#define PUT_SDB_FUNCTION_END(LINE) \ + fprintf (asm_out_file, \ + "\tdef\t~ef%s\tval\t~%s\tscl\t101%s\tline\t%d%s\tendef\n", \ + SDB_DELIM, SDB_DELIM, SDB_DELIM, (LINE), SDB_DELIM) + +#define PUT_SDB_EPILOGUE_END(NAME) \ +do { fprintf (asm_out_file, "\tdef\t"); \ + ASM_OUTPUT_LABELREF (asm_out_file, NAME); \ + fprintf (asm_out_file, \ + "%s\tval\t~%s\tscl\t-1%s\tendef\n", \ + SDB_DELIM, SDB_DELIM, SDB_DELIM); } while (0) + +#define SDB_GENERATE_FAKE(BUFFER, NUMBER) \ + sprintf ((BUFFER), "~%dfake", (NUMBER)); + +#define ASM_OUTPUT_SOURCE_LINE(FILE, LINE) \ + fprintf((FILE), "\tln\t%d\n", \ + (sdb_begin_function_line > 1 ? \ + last_linenum - sdb_begin_function_line : 1)) + +#define ASM_MOV_INSN "mov.l" + +#define FUNCTION_PROFILER_SYMBOL "mcount%" + +#endif /* !__ASSEMBLY__ */ diff --git a/gnu/usr.bin/gcc/config/m68k/auxgas.h b/gnu/usr.bin/gcc/config/m68k/auxgas.h new file mode 100644 index 00000000000..c2e0d567b45 --- /dev/null +++ b/gnu/usr.bin/gcc/config/m68k/auxgas.h @@ -0,0 +1,56 @@ +/* Definitions for Motorola 680x0 running A/UX using GAS + Copyright (C) 1996 Free Software Foundation, Inc. + +This file is part of GNU CC. + +GNU CC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU CC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU CC; see the file COPYING. If not, write to +the Free Software Foundation, 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +#define USE_GAS + +#ifndef __ASSEMBLY__ + +#include "m68k/m68k.h" +#include "m68k/coff.h" + +#define ASM_SPEC "%{m68000:-Am68000 }%{m68030:-Am68030 }%{m68040:-Am68040 }" + +/* Output #ident as a .ident. */ +#define ASM_OUTPUT_IDENT(FILE, NAME) \ + fprintf (FILE, "\t.ident \"%s\"\n", NAME); + +#ifdef IDENTIFY_WITH_IDENT +/* Put the GCC identification somewhere nicer, I think. + Does the COFF GDB use the "gcc2_complied." symbol anyway? */ +#define ASM_IDENTIFY_GCC(FILE) /* nothing */ +#define ASM_IDENTIFY_LANGUAGE(FILE) \ + fprintf (FILE, "\t.ident \"GCC (%s) %s\"\n", lang_identify(), version_string) +#endif + +#ifdef USE_COLLECT2 +#undef ASM_OUTPUT_CONSTRUCTOR +#undef ASM_OUTPUT_DESTRUCTOR +/* for the sake of link-level compatibility with /bin/as version */ +#define NO_DOLLAR_IN_LABEL +#define NO_DOT_IN_LABEL +#endif + +#define ADDITIONAL_REGISTER_NAMES { "%fp", 14, "%a7", 15 } + +#define ASM_MOV_INSN "movel" + +#define FUNCTION_PROFILER_SYMBOL "__mcount" + +#endif /* !__ASSEMBLY__ */ diff --git a/gnu/usr.bin/gcc/config/m68k/auxgld.h b/gnu/usr.bin/gcc/config/m68k/auxgld.h new file mode 100644 index 00000000000..12c97afaead --- /dev/null +++ b/gnu/usr.bin/gcc/config/m68k/auxgld.h @@ -0,0 +1,29 @@ +/* Definitions for Motorola 680x0 running A/UX using GLD + Copyright (C) 1996 Free Software Foundation, Inc. + +This file is part of GNU CC. + +GNU CC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU CC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU CC; see the file COPYING. If not, write to +the Free Software Foundation, 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +#define USE_GNU_LD + +#ifndef __ASSEMBLY__ + +#define LINK_SPEC \ +"%{p:-L/lib/libp -L/usr/lib/libp }%{pg:-L/lib/libp -L/usr/lib/libp }\ +%{smac:-T low.gld%s }" + +#endif /* !__ASSEMBLY__ */ diff --git a/gnu/usr.bin/gcc/config/m68k/auxld.h b/gnu/usr.bin/gcc/config/m68k/auxld.h new file mode 100644 index 00000000000..932dd6ab953 --- /dev/null +++ b/gnu/usr.bin/gcc/config/m68k/auxld.h @@ -0,0 +1,35 @@ +/* Definitions for Motorola 680x0 running A/UX using /bin/ld + Copyright (C) 1996 Free Software Foundation, Inc. + +This file is part of GNU CC. + +GNU CC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU CC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU CC; see the file COPYING. If not, write to +the Free Software Foundation, 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +#define USE_BIN_LD + +#ifndef USE_COLLECT2 +#define USE_COLLECT2 +#endif + +#ifndef __ASSEMBLY__ + +#define LINK_SPEC \ +"%{p:-L/lib/libp -L/usr/lib/libp }%{pg:-L/lib/libp -L/usr/lib/libp }\ +%{smac:low.ld%s }%{!smac:shlib.ld%s }" + +#define SWITCHES_NEED_SPACES "o" + +#endif /* !__ASSEMBLY__ */ diff --git a/gnu/usr.bin/gcc/config/m68k/m68k-psos.h b/gnu/usr.bin/gcc/config/m68k/m68k-psos.h new file mode 100644 index 00000000000..8e5b843397e --- /dev/null +++ b/gnu/usr.bin/gcc/config/m68k/m68k-psos.h @@ -0,0 +1,67 @@ +/* Definitions of a target machine for the GNU compiler: + 68040 running pSOS, ELF object files, DBX debugging. + Copyright (C) 1996 Free Software Foundation, Inc. + +This file is part of GNU CC. + +GNU CC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU CC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU CC; see the file COPYING. If not, write to +the Free Software Foundation, 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + + +/* Use MOTOROLA assembler syntax, as gas is configured that way and + glibc also seems to use it. Must come BEFORE m68k.h! */ + +#define MOTOROLA + +/* Get generic m68k definitions. */ + +#include "m68k/m68k.h" +#include "m68k/m68kemb.h" + +/* Default processor type is a (pure) 68040 with 68881 emulation using + the floating-point support package. */ + +#undef TARGET_DEFAULT +#define TARGET_DEFAULT (MASK_68040_ONLY|MASK_BITFIELD|MASK_68881|MASK_68020) + +/* Options passed to CPP, GAS, CC1 and CC1PLUS. We override + m68k-none.h for consistency with TARGET_DEFAULT. */ + +#undef CPP_SPEC +#define CPP_SPEC \ +"%{!mc68000:%{!m68000:%{!m68332:%{!msoft-float:-D__HAVE_68881__ }}}}\ +%{!ansi:-Dmc68000 %{m68010:-Dmc68010 }%{m68020:-Dmc68020 }%{mc68020:-Dmc68020 }%{m68030:-Dmc68030 }%{m68040:-Dmc68040 }%{m68020-40:-Dmc68020 -Dmc68030 -Dmc68040 }%{m68302:-Dmc68302 }%{m68332:-Dmc68332 }%{!mc68000:%{!m68000:%{!m68010:%{!mc68020:%{!m68020:%{!m68030:%{!m68040:%{!m68020-40:%{!m68302:%{!m68332:-Dmc68040 }}}}}}}}}}}\ +-D__mc68000__ -D__mc68000 %{m68010:-D__mc68010__ -D__mc68010 }%{m68020:-D__mc68020__ -D__mc68020 }%{mc68020:-D__mc68020__ -D__mc68020 }%{m68030:-D__mc68030__ -D__mc68030 }%{m68040:-D__mc68040__ -D__mc68040 }%{m68020-40:-D__mc68020__ -D__mc68030__ -D__mc68040__ -D__mc68020 -D__mc68030 -D__mc68040 }%{m68302:-D__mc68302__ -D__mc68302 }%{m68332:-D__mc68332__ -D__mc68332 }%{!mc68000:%{!m68000:%{!m68010:%{!mc68020:%{!m68020:%{!m68030:%{!m68040:%{!m68020-40:%{!m68302:%{!m68332:-D__mc68040__ -D__mc68040 }}}}}}}}}}" + +#undef ASM_SPEC +#define ASM_SPEC \ +"%{m68851}%{mno-68851}%{m68881}%{mno-68881}%{msoft-float:-mno-68881 }\ +%{m68000}%{mc68000}%{m68010}%{m68020}%{mc68020}%{m68030}%{m68040}%{m68020-40:-mc68040}%{m68302}%{m68332}%{!m68000:%{!mc68000:%{!m68010:%{!mc68020:%{!m68020:%{!m68030:%{!m68040:%{!m68020-40:%{!m68302:%{!m68332:-mc68040}}}}}}}}}}" + +#undef CC1_SPEC +#define CC1_SPEC \ + "%{m68000:%{!m68881:-msoft-float }}%{m68302:-m68000}%{m68332:-m68020 -mnobitfield %{!m68881:-msoft-float}}%{!m68000:%{!mc68000:%{!m68010:%{!mc68020:%{!m68020:%{!m68030:%{!m68040:%{!m68020-40:%{!m68302:%{!m68332:-m68040}}}}}}}}}}" + +#undef CC1PLUS_SPEC +#define CC1PLUS_SPEC \ + "%{m68000:%{!m68881:-msoft-float }}%{m68302:-m68000}%{m68332:-m68020 -mnobitfield %{!m68881:-msoft-float}}%{!m68000:%{!mc68000:%{!m68010:%{!mc68020:%{!m68020:%{!m68030:%{!m68040:%{!m68020-40:%{!m68302:%{!m68332:-m68040}}}}}}}}}}" + + +/* Get processor-independent pSOS definitions. */ + +#include "psos.h" + + +/* end of m68k-psos.h */ diff --git a/gnu/usr.bin/gcc/config/m68k/mot3300-crt0.S b/gnu/usr.bin/gcc/config/m68k/mot3300-crt0.S new file mode 100644 index 00000000000..2a84b37716c --- /dev/null +++ b/gnu/usr.bin/gcc/config/m68k/mot3300-crt0.S @@ -0,0 +1,98 @@ +/* The start module crt0.s for the SysV68 Motorola 3300 Delta Series. + Copyright (C) 1996 Free Software Foundation, Inc. + Contributed by Manfred Hollstein (manfred@lts.sel.alcatel.de). + +This file is part of GNU CC. + +GNU CC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU CC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU CC; see the file COPYING. If not, write to +the Free Software Foundation, 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +#ifdef MOTOROLA +# define COMM comm +# define DATA data +# define EVEN even +# define FILE(n) file n +# define GLOBAL_SYM(s) global s +# define LOCAL_LABEL(l) L%##l +# define IDENT(s) ident s +# define TEXT text +#else /* Assume we are using GNU as. */ +# define COMM .comm +# define DATA .data +# define EVEN .even +# define FILE(name) .file name +# define GLOBAL_SYM(s) .globl s +# define LOCAL_LABEL(l) .L.##l +# define IDENT(s) .section .comment;.asciz s +# define TEXT .text +#endif + + FILE ("crt0.s") + TEXT + GLOBAL_SYM (_start) +_start: mov.l %d0,splimit% + subq.w &8,%sp + mov.l 8(%sp),(%sp) + lea 12(%sp),%a0 + mov.l %a0,4(%sp) + mov.l %a0,%a1 +LOCAL_LABEL(0): + tst.l (%a0)+ + bne.b LOCAL_LABEL(0) +#ifdef SGS_CMP_ORDER + cmpa.l %a0,(%a1) +#else + cmpa.l (%a1),%a0 +#endif + blt.b LOCAL_LABEL(1) + subq.w &4,%a0 +LOCAL_LABEL(1): + mov.l %a0,8(%sp) + mov.l %a0,environ + jsr initfpu + + subq.w &8,%sp + clr.l %d0 /* if (! isatty (fileno (stderr))) */ + mov.b _iob+27,%d0 + mov.l %d0,-(%sp) + jsr isatty + addq.w &4,%sp + tst.l %d0 + bne.b LOCAL_LABEL(isatty) + clr.l -(%sp) /* setbuf (stderr, NULL) */ + pea _iob+28 + jsr setbuf + addq.w &8,%sp +LOCAL_LABEL(isatty): + addq.w &8,%sp + + jsr main + mov.l %d0,(%sp) + jsr exit + moveq.l &1,%d0 + trap &0 + nop + + GLOBAL_SYM (__stop_monitor) +__stop_monitor: + rts + EVEN + + COMM splimit%,4 + COMM environ,4 + + IDENT ("$Id: mot3300-crt0.S,v 1.1 1998/02/14 19:18:52 niklas Exp $") + IDENT ("Contributed by Manfred Hollstein (manfred@lts.sel.alcatel.de)") + IDENT ("Corrections by Philippe De Muyter (phdm@macqel.be)") diff --git a/gnu/usr.bin/gcc/config/m68k/mot3300Mcrt0.S b/gnu/usr.bin/gcc/config/m68k/mot3300Mcrt0.S new file mode 100644 index 00000000000..271c81c725a --- /dev/null +++ b/gnu/usr.bin/gcc/config/m68k/mot3300Mcrt0.S @@ -0,0 +1,142 @@ +/* The start module mcrt0.s for the SysV68 Motorola 3300 Delta Series. + Copyright (C) 1996, 1997 Free Software Foundation, Inc. + Contributed by Manfred Hollstein (manfred@lts.sel.alcatel.de). + +This file is part of GNU CC. + +GNU CC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU CC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU CC; see the file COPYING. If not, write to +the Free Software Foundation, 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +#ifdef MOTOROLA +# define COMM comm +# define DATA data +# define EVEN even +# define FILE(n) file n +# define GLOBAL_SYM(s) global s +# define LOCAL_LABEL(l) L%##l +# define IDENT(s) ident s +# define TEXT text +#else /* Assume we are using GNU as. */ +# define COMM .comm +# define DATA .data +# define EVEN .even +# define FILE(name) .file name +# define GLOBAL_SYM(s) .globl s +# define LOCAL_LABEL(l) .L.##l +# define IDENT(s) .section .comment;.asciz s +# define TEXT .text +#endif + + FILE ("mcrt0.s") + TEXT + GLOBAL_SYM (_start) +_start: mov.l %d0,splimit% + subq.w &8,%sp + mov.l 8(%sp),(%sp) + lea 12(%sp),%a0 + mov.l %a0,___Argv + mov.l %a0,4(%sp) + mov.l %a0,%a1 +LOCAL_LABEL(0): + tst.l (%a0)+ + bne.b LOCAL_LABEL(0) +#ifdef SGS_CMP_ORDER + cmpa.l %a0,(%a1) +#else + cmpa.l (%a1),%a0 +#endif + blt.b LOCAL_LABEL(1) + subq.w &4,%a0 +LOCAL_LABEL(1): + mov.l %a0,8(%sp) + mov.l %a0,environ + jsr initfpu + + sub &8,%sp + clr.l %d0 /* if (! isatty (fileno (stderr))) */ + mov.b _iob+27,%d0 + mov.l %d0,-(%sp) + jsr isatty + addq.w &4,%sp + tst.l %d0 + bne.b LOCAL_LABEL(isatty) + clr.l -(%sp) /* setbuf (stderr, NULL) */ + pea _iob+28 + jsr setbuf + addq.w &8,%sp +LOCAL_LABEL(isatty): + addq.w &8,%sp + + mov.l &600,-(%sp) + mov.l &etext,%d1 + subi.l &LOCAL_LABEL(endofstart),%d1 + addq.l &1,%d1 + bclr &0,%d1 + addi.l &4812,%d1 + asr.l &1,%d1 + mov.l %d1,-(%sp) + add.l %d1,%d1 + mov.l %d1,-(%sp) + jsr sbrk + addq.w &4,%sp +#ifdef SGS_CMP_ORDER + cmpa.l %a0,&-1 +#else + cmpa.l &-1,%a0 +#endif + beq.b LOCAL_LABEL(3) + mov.l %a0,-(%sp) + add.l &12,%a0 + mov.l %a0,_countbase + mov.l &etext,-(%sp) + mov.l &LOCAL_LABEL(endofstart),-(%sp) + jsr monitor + lea 20(%sp),%sp + jsr main + mov.l %d0,(%sp) + jsr exit +_exit: moveq &1,%d0 + trap &0 + + GLOBAL_SYM (__stop_monitor) +__stop_monitor: + clr.l -(%sp) + jsr monitor + add.w &4,%sp + rts + +LOCAL_LABEL(errtxt): + byte 'N,'o,' ,'s,'p,'a,'c,'e,' ,'f,'o,'r,' ,'m,'o,'n + byte 'i,'t,'o,'r,' ,'b,'u,'f,'f,'e,'r,'\n +LOCAL_LABEL(errtxt_end): + + EVEN +LOCAL_LABEL(3): + pea LOCAL_LABEL(errtxt_end)-LOCAL_LABEL(errtxt) + pea LOCAL_LABEL(errtxt)(%pc) + pea 2 + jsr write + bra.b _exit +LOCAL_LABEL(endofstart): + + EVEN + + COMM splimit%,4 + COMM environ,4 + COMM _countbase,4 + + IDENT ("$Id: mot3300Mcrt0.S,v 1.1 1998/02/14 19:18:55 niklas Exp $") + IDENT ("Contributed by Manfred Hollstein (manfred@lts.sel.alcatel.de)") + IDENT ("Corrections by Philippe De Muyter (phdm@macqel.be)") diff --git a/gnu/usr.bin/gcc/config/m68k/rtems.h b/gnu/usr.bin/gcc/config/m68k/rtems.h new file mode 100644 index 00000000000..77c02f8e9c8 --- /dev/null +++ b/gnu/usr.bin/gcc/config/m68k/rtems.h @@ -0,0 +1,28 @@ +/* Definitions for rtems targeting a Motorola m68k using coff. + Copyright (C) 1996, 1997 Free Software Foundation, Inc. + Contributed by Joel Sherrill (joel@OARcorp.com). + +This file is part of GNU CC. + +GNU CC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU CC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU CC; see the file COPYING. If not, write to +the Free Software Foundation, 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +#include "m68k/m68k-coff.h" + +/* Specify predefined symbols in preprocessor. */ + +#undef CPP_PREDEFINES +#define CPP_PREDEFINES "-Dmc68000 -Drtems -D__rtems__ \ + -Asystem(rtems) -Acpu(mc68000) -Acpu(m68k) -Amachine(m68k)" diff --git a/gnu/usr.bin/gcc/config/m68k/t-aux b/gnu/usr.bin/gcc/config/m68k/t-aux new file mode 100644 index 00000000000..3d59d675ffd --- /dev/null +++ b/gnu/usr.bin/gcc/config/m68k/t-aux @@ -0,0 +1,44 @@ +# Makefile additions for A/UX + +LIB2FUNCS_EXTRA=aux-mcount.c aux-exit.c + +FIXPROTO_DEFINES=-D_POSIX_SOURCE + +# Only really needed for collect2 +CLIB=-lld + +# Needed to support builds for multiple versions of A/UX +# LDFLAGS=-static + +# Make sure we get the right assembler by letting gcc choose +AS = $(GCC_FOR_TARGET) -xassembler-with-cpp -D__ASSEMBLY__ $(INCLUDES) -c + +aux-mcount.c: $(srcdir)/config/m68k/aux-mcount.c + cp $(srcdir)/config/m68k/aux-mcount.c aux-mcount.c + +aux-exit.c: $(srcdir)/config/m68k/aux-exit.c + cp $(srcdir)/config/m68k/aux-exit.c aux-exit.c + +crt1.o: $(srcdir)/config/m68k/aux-crt1.c $(GCC_PASSES) + $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(INCLUDES) -o crt1.o -c \ + -fno-omit-frame-pointer $(srcdir)/config/m68k/aux-crt1.c + +mcrt1.o: $(srcdir)/config/m68k/aux-crt1.c $(GCC_PASSES) + $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(INCLUDES) -o mcrt1.o -c \ + -fno-omit-frame-pointer -DMCRT1 $(srcdir)/config/m68k/aux-crt1.c + +maccrt1.o: $(srcdir)/config/m68k/aux-crt1.c $(GCC_PASSES) + $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(INCLUDES) -o maccrt1.o -c \ + -fno-omit-frame-pointer -DMACCRT1 $(srcdir)/config/m68k/aux-crt1.c + +crt2.o: $(srcdir)/config/m68k/aux-crt2.asm $(GCC_PASSES) + $(AS) -o crt2.o $(srcdir)/config/m68k/aux-crt2.asm + +crtn.o: $(srcdir)/config/m68k/aux-crtn.asm $(GCC_PASSES) + $(AS) -o crtn.o $(srcdir)/config/m68k/aux-crtn.asm + +low.gld: $(srcdir)/config/m68k/aux-low.gld + sed -e 's|@libdir@|$(libdir)|' -e 's|@tooldir@|$(tooldir)|' \ + -e 's|@local_prefix@|$(local_prefix)|' \ + $(srcdir)/config/m68k/aux-low.gld > tmp-low.gld + mv tmp-low.gld low.gld diff --git a/gnu/usr.bin/gcc/config/m68k/t-linux-aout b/gnu/usr.bin/gcc/config/m68k/t-linux-aout new file mode 100644 index 00000000000..4ef9e1acaed --- /dev/null +++ b/gnu/usr.bin/gcc/config/m68k/t-linux-aout @@ -0,0 +1,5 @@ +# Don't make libgcc1.a +LIBGCC1 = +CROSS_LIBGCC1 = +# On GNU/Linux we can print long double +ENQUIRE_CFLAGS = -DNO_MEM -O0 diff --git a/gnu/usr.bin/gcc/config/m68k/t-mot3300 b/gnu/usr.bin/gcc/config/m68k/t-mot3300 new file mode 100644 index 00000000000..2fc11858d58 --- /dev/null +++ b/gnu/usr.bin/gcc/config/m68k/t-mot3300 @@ -0,0 +1,10 @@ +MULTILIB_OPTIONS=m68000/m68020 msoft-float +MULTILIB_DIRNAMES= +MULTILIB_MATCHES=m68000=mc68000 m68000=m68302 m68000=m68332 m68020=mc68020 m68020=m68040 + +LIBGCC = stmp-multilib +INSTALL_LIBGCC = install-multilib + +CRT0_S = $(srcdir)/config/m68k/mot3300-crt0.S +MCRT0_S = $(srcdir)/config/m68k/mot3300Mcrt0.S +CRT0STUFF_T_CFLAGS = -DMOTOROLA -DSGS_CMP_ORDER diff --git a/gnu/usr.bin/gcc/config/m68k/t-mot3300-gald b/gnu/usr.bin/gcc/config/m68k/t-mot3300-gald new file mode 100644 index 00000000000..435afc49e65 --- /dev/null +++ b/gnu/usr.bin/gcc/config/m68k/t-mot3300-gald @@ -0,0 +1,13 @@ +T_CPPFLAGS = -DUSE_GAS -DUSE_GLD +TARGET_LIBGCC2_CFLAGS = -DUSE_GAS + +MULTILIB_OPTIONS=m68000/m68020 msoft-float +MULTILIB_DIRNAMES= +MULTILIB_MATCHES=m68000=mc68000 m68000=m68302 m68000=m68332 m68020=mc68020 m68020=m68040 + +LIBGCC = stmp-multilib +INSTALL_LIBGCC = install-multilib + +CRT0_S = $(srcdir)/config/m68k/mot3300-crt0.S +MCRT0_S = $(srcdir)/config/m68k/mot3300Mcrt0.S +CRT0STUFF_T_CFLAGS = diff --git a/gnu/usr.bin/gcc/config/m68k/t-mot3300-gas b/gnu/usr.bin/gcc/config/m68k/t-mot3300-gas new file mode 100644 index 00000000000..525667452e2 --- /dev/null +++ b/gnu/usr.bin/gcc/config/m68k/t-mot3300-gas @@ -0,0 +1,13 @@ +T_CPPFLAGS = -DUSE_GAS +TARGET_LIBGCC2_CFLAGS = -DUSE_GAS + +MULTILIB_OPTIONS=m68000/m68020 msoft-float +MULTILIB_DIRNAMES= +MULTILIB_MATCHES=m68000=mc68000 m68000=m68302 m68000=m68332 m68020=mc68020 m68020=m68040 + +LIBGCC = stmp-multilib +INSTALL_LIBGCC = install-multilib + +CRT0_S = $(srcdir)/config/m68k/mot3300-crt0.S +MCRT0_S = $(srcdir)/config/m68k/mot3300Mcrt0.S +CRT0STUFF_T_CFLAGS = diff --git a/gnu/usr.bin/gcc/config/m68k/t-mot3300-gld b/gnu/usr.bin/gcc/config/m68k/t-mot3300-gld new file mode 100644 index 00000000000..8cc3ed6f250 --- /dev/null +++ b/gnu/usr.bin/gcc/config/m68k/t-mot3300-gld @@ -0,0 +1,12 @@ +T_CPPFLAGS = -DUSE_GLD + +MULTILIB_OPTIONS=m68000/m68020 msoft-float +MULTILIB_DIRNAMES= +MULTILIB_MATCHES=m68000=mc68000 m68000=m68302 m68000=m68332 m68020=mc68020 m68020=m68040 + +LIBGCC = stmp-multilib +INSTALL_LIBGCC = install-multilib + +CRT0_S = $(srcdir)/config/m68k/mot3300-crt0.S +MCRT0_S = $(srcdir)/config/m68k/mot3300Mcrt0.S +CRT0STUFF_T_CFLAGS = -DMOTOROLA -DSGS_CMP_ORDER diff --git a/gnu/usr.bin/gcc/config/m68k/x-mot3300-gas b/gnu/usr.bin/gcc/config/m68k/x-mot3300-gas new file mode 100644 index 00000000000..cf2797773df --- /dev/null +++ b/gnu/usr.bin/gcc/config/m68k/x-mot3300-gas @@ -0,0 +1,12 @@ +ALLOCA=alloca.o + +# This disables the long/short jump optimization. +# I use sysV68 R3V7.1 RM04 (phdm@info.ucl.ac.be) +# Since ss-950318, with jump optimization enabled, "as" issues a warning +# when assembling combine.s : +# aline nnnnn : Warning: Table overflow: some optimizations lost (SDIs) +# but later "ld" complains with +# ld: relocation entry found for non-relocatable symbol in combine.o +# and the produced "cc1" fails with SIGSEGV +# Another possible fix would be to split combine.c. +XCFLAGS=`if [ x$@ = xcombine.o -a "${CC}" = "${OLDCC}" ]; then echo -Wa,-j; fi` diff --git a/gnu/usr.bin/gcc/config/m68k/xm-aux.h b/gnu/usr.bin/gcc/config/m68k/xm-aux.h new file mode 100644 index 00000000000..5ac1f4654d8 --- /dev/null +++ b/gnu/usr.bin/gcc/config/m68k/xm-aux.h @@ -0,0 +1,9 @@ +#ifndef USG +#define USG +#endif + +#ifndef AUX +#define AUX +#endif + +#include "m68k/xm-m68k.h" |