|
|
1.1 ! root 1: /* Definitions for DECstation running BSD as target machine for GNU compiler. ! 2: Copyright (C) 1993, 1995 Free Software Foundation, Inc. ! 3: ! 4: This file is part of GNU CC. ! 5: ! 6: GNU CC is free software; you can redistribute it and/or modify ! 7: it under the terms of the GNU General Public License as published by ! 8: the Free Software Foundation; either version 2, or (at your option) ! 9: any later version. ! 10: ! 11: GNU CC is distributed in the hope that it will be useful, ! 12: but WITHOUT ANY WARRANTY; without even the implied warranty of ! 13: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! 14: GNU General Public License for more details. ! 15: ! 16: You should have received a copy of the GNU General Public License ! 17: along with GNU CC; see the file COPYING. If not, write to ! 18: the Free Software Foundation, 59 Temple Place - Suite 330, ! 19: Boston, MA 02111-1307, USA. */ ! 20: ! 21: #define DECSTATION ! 22: ! 23: /* Look for the include files in the system-defined places. */ ! 24: ! 25: #ifndef CROSS_COMPILE ! 26: #undef GPLUSPLUS_INCLUDE_DIR ! 27: #define GPLUSPLUS_INCLUDE_DIR "/usr/include/g++" ! 28: ! 29: #undef GCC_INCLUDE_DIR ! 30: #define GCC_INCLUDE_DIR "/usr/include" ! 31: ! 32: #undef INCLUDE_DEFAULTS ! 33: #define INCLUDE_DEFAULTS \ ! 34: { \ ! 35: { GPLUSPLUS_INCLUDE_DIR, 1, 1 }, \ ! 36: { GCC_INCLUDE_DIR, 0, 0 }, \ ! 37: { 0, 0, 0 } \ ! 38: } ! 39: ! 40: /* Under NetBSD, the normal location of the various *crt*.o files is the ! 41: /usr/lib directory. */ ! 42: ! 43: #undef STANDARD_STARTFILE_PREFIX ! 44: #define STANDARD_STARTFILE_PREFIX "/usr/lib/" ! 45: #endif ! 46: ! 47: /* Provide a LINK_SPEC appropriate for NetBSD. Here we provide support ! 48: for the special GCC options -static, -assert, and -nostdlib. */ ! 49: ! 50: #undef LINK_SPEC ! 51: #define LINK_SPEC \ ! 52: "%{G*} %{EB} %{EL} %{mips1} %{mips2} %{mips3} \ ! 53: %{!nostdlib:%{!r*:%{!e*:-e __start}}} -dc -dp %{static:-Bstatic} %{assert*}" ! 54: ! 55: /* We have atexit(3). */ ! 56: ! 57: #define HAVE_ATEXIT ! 58: ! 59: /* Implicit library calls should use memcpy, not bcopy, etc. */ ! 60: ! 61: #define TARGET_MEM_FUNCTIONS ! 62: ! 63: /* Define mips-specific netbsd predefines... */ ! 64: #ifndef CPP_PREDEFINES ! 65: #define CPP_PREDEFINES "-D__ANSI_COMPAT \ ! 66: -DMIPSEL -DR3000 -DSYSTYPE_BSD -D_SYSTYPE_BSD -D__NetBSD__ -Dmips \ ! 67: -D__NO_LEADING_UNDERSCORES__ -D__GP_SUPPORT__ \ ! 68: -Dunix -D_R3000 \ ! 69: -Asystem(unix) -Asystem(NetBSD) -Amachine(mips)" ! 70: #endif ! 71: ! 72: /* Always uses gas. */ ! 73: #ifndef ASM_SPEC ! 74: #define ASM_SPEC "\ ! 75: %{G*} %{EB} %{EL} %{mips1} %{mips2} %{mips3} %{v} \ ! 76: %{noasmopt:-O0} \ ! 77: %{!noasmopt:%{O:-O2} %{O1:-O2} %{O2:-O2} %{O3:-O3}} \ ! 78: %{g} %{g0} %{g1} %{g2} %{g3} \ ! 79: %{ggdb:-g} %{ggdb0:-g0} %{ggdb1:-g1} %{ggdb2:-g2} %{ggdb3:-g3} \ ! 80: %{gstabs:-g} %{gstabs0:-g0} %{gstabs1:-g1} %{gstabs2:-g2} %{gstabs3:-g3} \ ! 81: %{gstabs+:-g} %{gstabs+0:-g0} %{gstabs+1:-g1} %{gstabs+2:-g2} %{gstabs+3:-g3} \ ! 82: %{gcoff:-g} %{gcoff0:-g0} %{gcoff1:-g1} %{gcoff2:-g2} %{gcoff3:-g3}" ! 83: #endif ! 84: ! 85: #ifndef CPP_SPEC ! 86: #define CPP_SPEC "\ ! 87: %{posix:-D_POSIX_SOURCE} \ ! 88: %{mlong64:-D__SIZE_TYPE__=long\\ unsigned\\ int -D__PTRDIFF_TYPE__=long\\ int} \ ! 89: %{!mlong64:-D__SIZE_TYPE__=unsigned\\ int -D__PTRDIFF_TYPE__=int} \ ! 90: %{mips3:-U__mips -D__mips=3 -D__mips64} \ ! 91: %{mgp32:-U__mips64} %{mgp64:-D__mips64}" ! 92: #endif ! 93: ! 94: #define LIB_SPEC "%{!p:%{!pg:-lc}}%{p:-lc_p}%{pg:-lc_p}" ! 95: #define STARTFILE_SPEC "" ! 96: ! 97: #ifndef MACHINE_TYPE ! 98: #define MACHINE_TYPE "NetBSD/pmax" ! 99: #endif ! 100: ! 101: #define TARGET_DEFAULT MASK_GAS ! 102: #define PREFERRED_DEBUGGING_TYPE DBX_DEBUG ! 103: ! 104: #define LOCAL_LABEL_PREFIX "." ! 105: ! 106: #include "mips/mips.h" ! 107: ! 108: /* ! 109: * Some imports from svr4.h in support of shared libraries. ! 110: * Currently, we need the DECLARE_OBJECT_SIZE stuff. ! 111: */ ! 112: ! 113: /* Define the strings used for the special svr4 .type and .size directives. ! 114: These strings generally do not vary from one system running svr4 to ! 115: another, but if a given system (e.g. m88k running svr) needs to use ! 116: different pseudo-op names for these, they may be overridden in the ! 117: file which includes this one. */ ! 118: ! 119: #undef TYPE_ASM_OP ! 120: #undef SIZE_ASM_OP ! 121: #undef WEAK_ASM_OP ! 122: #define TYPE_ASM_OP ".type" ! 123: #define SIZE_ASM_OP ".size" ! 124: #define WEAK_ASM_OP ".weak" ! 125: ! 126: /* The following macro defines the format used to output the second ! 127: operand of the .type assembler directive. Different svr4 assemblers ! 128: expect various different forms for this operand. The one given here ! 129: is just a default. You may need to override it in your machine- ! 130: specific tm.h file (depending upon the particulars of your assembler). */ ! 131: ! 132: #undef TYPE_OPERAND_FMT ! 133: #define TYPE_OPERAND_FMT "@%s" ! 134: ! 135: /* Write the extra assembler code needed to declare a function's result. ! 136: Most svr4 assemblers don't require any special declaration of the ! 137: result value, but there are exceptions. */ ! 138: ! 139: #ifndef ASM_DECLARE_RESULT ! 140: #define ASM_DECLARE_RESULT(FILE, RESULT) ! 141: #endif ! 142: ! 143: /* These macros generate the special .type and .size directives which ! 144: are used to set the corresponding fields of the linker symbol table ! 145: entries in an ELF object file under SVR4. These macros also output ! 146: the starting labels for the relevant functions/objects. */ ! 147: ! 148: /* Write the extra assembler code needed to declare a function properly. ! 149: Some svr4 assemblers need to also have something extra said about the ! 150: function's return value. We allow for that here. */ ! 151: ! 152: #undef ASM_DECLARE_FUNCTION_NAME ! 153: #define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \ ! 154: do { \ ! 155: fprintf (FILE, "\t%s\t ", TYPE_ASM_OP); \ ! 156: assemble_name (FILE, NAME); \ ! 157: putc (',', FILE); \ ! 158: fprintf (FILE, TYPE_OPERAND_FMT, "function"); \ ! 159: putc ('\n', FILE); \ ! 160: ASM_DECLARE_RESULT (FILE, DECL_RESULT (DECL)); \ ! 161: } while (0) ! 162: ! 163: /* Write the extra assembler code needed to declare an object properly. */ ! 164: ! 165: #undef ASM_DECLARE_OBJECT_NAME ! 166: #define ASM_DECLARE_OBJECT_NAME(FILE, NAME, DECL) \ ! 167: do { \ ! 168: fprintf (FILE, "\t%s\t ", TYPE_ASM_OP); \ ! 169: assemble_name (FILE, NAME); \ ! 170: putc (',', FILE); \ ! 171: fprintf (FILE, TYPE_OPERAND_FMT, "object"); \ ! 172: putc ('\n', FILE); \ ! 173: size_directive_output = 0; \ ! 174: if (!flag_inhibit_size_directive && DECL_SIZE (DECL)) \ ! 175: { \ ! 176: size_directive_output = 1; \ ! 177: fprintf (FILE, "\t%s\t ", SIZE_ASM_OP); \ ! 178: assemble_name (FILE, NAME); \ ! 179: fprintf (FILE, ",%d\n", int_size_in_bytes (TREE_TYPE (DECL))); \ ! 180: } \ ! 181: ASM_OUTPUT_LABEL(FILE, NAME); \ ! 182: } while (0) ! 183: ! 184: /* Output the size directive for a decl in rest_of_decl_compilation ! 185: in the case where we did not do so before the initializer. ! 186: Once we find the error_mark_node, we know that the value of ! 187: size_directive_output was set ! 188: by ASM_DECLARE_OBJECT_NAME when it was run for the same decl. */ ! 189: ! 190: #undef ASM_FINISH_DECLARE_OBJECT ! 191: #define ASM_FINISH_DECLARE_OBJECT(FILE, DECL, TOP_LEVEL, AT_END) \ ! 192: do { \ ! 193: char *name = XSTR (XEXP (DECL_RTL (DECL), 0), 0); \ ! 194: if (!flag_inhibit_size_directive && DECL_SIZE (DECL) \ ! 195: && ! AT_END && TOP_LEVEL \ ! 196: && DECL_INITIAL (DECL) == error_mark_node \ ! 197: && !size_directive_output) \ ! 198: { \ ! 199: size_directive_output = 1; \ ! 200: fprintf (FILE, "\t%s\t ", SIZE_ASM_OP); \ ! 201: assemble_name (FILE, name); \ ! 202: fprintf (FILE, ",%d\n", int_size_in_bytes (TREE_TYPE (DECL))); \ ! 203: } \ ! 204: } while (0) ! 205: ! 206: /* This is how to declare the size of a function. */ ! 207: ! 208: #undef ASM_DECLARE_FUNCTION_SIZE ! 209: #define ASM_DECLARE_FUNCTION_SIZE(FILE, FNAME, DECL) \ ! 210: do { \ ! 211: if (!flag_inhibit_size_directive) \ ! 212: { \ ! 213: char label[256]; \ ! 214: static int labelno; \ ! 215: labelno++; \ ! 216: ASM_GENERATE_INTERNAL_LABEL (label, "Lfe", labelno); \ ! 217: ASM_OUTPUT_INTERNAL_LABEL (FILE, "Lfe", labelno); \ ! 218: fprintf (FILE, "\t%s\t ", SIZE_ASM_OP); \ ! 219: assemble_name (FILE, (FNAME)); \ ! 220: fprintf (FILE, ","); \ ! 221: assemble_name (FILE, label); \ ! 222: fprintf (FILE, "-"); \ ! 223: assemble_name (FILE, (FNAME)); \ ! 224: putc ('\n', FILE); \ ! 225: } \ ! 226: } while (0) ! 227: ! 228: /* Since gas and gld are standard on NetBSD, we don't need these */ ! 229: #undef ASM_FINAL_SPEC ! 230: #undef STARTFILE_SPEC ! 231:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.