|
|
1.1 ! root 1: /* Definitions of target machine for GNU compiler, for SPARC running Solaris 2 ! 2: Copyright 1992 Free Software Foundation, Inc. ! 3: Contributed by Ron Guilmette ([email protected]) and ! 4: David V. Henkel-Wallace ([email protected]). ! 5: ! 6: This file is part of GNU CC. ! 7: ! 8: GNU CC is free software; you can redistribute it and/or modify ! 9: it under the terms of the GNU General Public License as published by ! 10: the Free Software Foundation; either version 2, or (at your option) ! 11: any later version. ! 12: ! 13: GNU CC is distributed in the hope that it will be useful, ! 14: but WITHOUT ANY WARRANTY; without even the implied warranty of ! 15: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! 16: GNU General Public License for more details. ! 17: ! 18: You should have received a copy of the GNU General Public License ! 19: along with GNU CC; see the file COPYING. If not, write to ! 20: the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ ! 21: ! 22: /* Supposedly the same as vanilla sparc svr4, except for the stuff below: */ ! 23: #include "sparc/sysv4.h" ! 24: ! 25: #undef CPP_PREDEFINES ! 26: #define CPP_PREDEFINES \ ! 27: "-Dsun -Dsparc -Dunix -D__svr4__ \ ! 28: -Asystem(unix) -Asystem(svr4) -Acpu(sparc) -Amachine(sparc)\ ! 29: -D__GCC_NEW_VARARGS__" ! 30: ! 31: #undef CPP_SPEC ! 32: #define CPP_SPEC "\ ! 33: %{compat-bsd:-iwithprefixbefore ucbinclude -I/usr/ucbinclude}\ ! 34: %{msparclite:-D__sparclite__} %{mv8:-D__sparc_v8__}" ! 35: ! 36: /* The sun bundled assembler doesn't accept -Yd, (and neither does gas). ! 37: It's safe to pass -s always, even if -g is not used. */ ! 38: #undef ASM_SPEC ! 39: #define ASM_SPEC \ ! 40: "%{V} %{v:%{!V:-V}} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Wa,*:%*} -s \ ! 41: %{fpic:-K PIC} %{fPIC:-K PIC}" ! 42: ! 43: /* However it appears that Solaris 2.0 uses the same reg numbering as ! 44: the old BSD-style system did. */ ! 45: ! 46: #undef DBX_REGISTER_NUMBER ! 47: /* Same as sparc.h */ ! 48: #define DBX_REGISTER_NUMBER(REGNO) (REGNO) ! 49: ! 50: /* We use stabs-in-elf for debugging, because that is what the native ! 51: toolchain uses. */ ! 52: #define DBX_DEBUGGING_INFO ! 53: #define PREFERRED_DEBUGGING_TYPE DBX_DEBUG ! 54: ! 55: #define DBX_BLOCKS_FUNCTION_RELATIVE 1 ! 56: ! 57: /* "gcc2_compiled." must be a .stabs, not an ordinary symbol, or GDB won't ! 58: see it. Furthermore, since GDB reads the input piecemeal, starting ! 59: with each N_SO, it's a lot easier if the gcc2 flag symbol is *after* ! 60: the N_SO rather than before it. So we emit an N_OPT stab here. */ ! 61: ! 62: #define ASM_IDENTIFY_GCC(FILE) /* Do nothing */ ! 63: ! 64: #define ASM_IDENTIFY_GCC_AFTER_SOURCE(FILE) \ ! 65: fputs ("\t.stabs\t\"gcc2_compiled.\", 0x3c, 0, 0, 0\n", FILE) ! 66: ! 67: #undef CTORS_SECTION_ASM_OP ! 68: #undef DTORS_SECTION_ASM_OP ! 69: ! 70: #if 0 /* These seems unnecessary; the ones in sparc/sysv4.h look right. */ ! 71: #undef TEXT_SECTION_ASM_OP ! 72: #undef DATA_SECTION_ASM_OP ! 73: #undef BSS_SECTION_ASM_OP ! 74: #undef CONST_SECTION_ASM_OP ! 75: #undef INIT_SECTION_ASM_OP ! 76: ! 77: #define TEXT_SECTION_ASM_OP "\t.section\t\".text\"" ! 78: #define DATA_SECTION_ASM_OP "\t.section\t\".data\"" ! 79: #define BSS_SECTION_ASM_OP "\t.section\t\".bss\"" ! 80: ! 81: #define CONST_SECTION_ASM_OP "\t.section\t\".rodata\"" ! 82: #define INIT_SECTION_ASM_OP "\t.section\t\".init\"" ! 83: #endif ! 84: ! 85: #define CTORS_SECTION_ASM_OP "\t.section\t\".ctors\",#alloc,#execinstr\n" ! 86: #define DTORS_SECTION_ASM_OP "\t.section\t\".dtors\",#alloc,#execinstr\n" ! 87: ! 88: /* The native assembler can't compute differences between symbols in different ! 89: sections when generating pic code, so we must put jump tables in the ! 90: text section. */ ! 91: #define JUMP_TABLES_IN_TEXT_SECTION 1 ! 92: ! 93: /* Must use data section for relocatable constants when pic. */ ! 94: #undef SELECT_RTX_SECTION ! 95: #define SELECT_RTX_SECTION(MODE,RTX) \ ! 96: { \ ! 97: if (flag_pic && symbolic_operand (RTX)) \ ! 98: data_section (); \ ! 99: else \ ! 100: const_section (); \ ! 101: } ! 102: ! 103: /* The Solaris 2 assembler uses .skip, not .zero, so put this back. */ ! 104: #undef ASM_OUTPUT_SKIP ! 105: #define ASM_OUTPUT_SKIP(FILE,SIZE) \ ! 106: fprintf (FILE, "\t.skip %u\n", (SIZE)) ! 107: ! 108: #undef ASM_OUTPUT_ALIGNED_LOCAL ! 109: #define ASM_OUTPUT_ALIGNED_LOCAL(FILE, NAME, SIZE, ALIGN) \ ! 110: do { \ ! 111: fputs ("\t.local\t", (FILE)); \ ! 112: assemble_name ((FILE), (NAME)); \ ! 113: putc ('\n', (FILE)); \ ! 114: ASM_OUTPUT_ALIGNED_COMMON (FILE, NAME, SIZE, ALIGN); \ ! 115: } while (0) ! 116: ! 117: #undef COMMON_ASM_OP ! 118: #define COMMON_ASM_OP "\t.common" ! 119: ! 120: /* This is how to output a definition of an internal numbered label where ! 121: PREFIX is the class of label and NUM is the number within the class. */ ! 122: ! 123: #undef ASM_OUTPUT_INTERNAL_LABEL ! 124: #define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \ ! 125: fprintf (FILE, ".L%s%d:\n", PREFIX, NUM) ! 126: ! 127: /* This is how to output a reference to an internal numbered label where ! 128: PREFIX is the class of label and NUM is the number within the class. */ ! 129: ! 130: #undef ASM_OUTPUT_INTERNAL_LABELREF ! 131: #define ASM_OUTPUT_INTERNAL_LABELREF(FILE,PREFIX,NUM) \ ! 132: fprintf (FILE, ".L%s%d", PREFIX, NUM) ! 133: ! 134: /* This is how to store into the string LABEL ! 135: the symbol_ref name of an internal numbered label where ! 136: PREFIX is the class of label and NUM is the number within the class. ! 137: This is suitable for output with `assemble_name'. */ ! 138: ! 139: #undef ASM_GENERATE_INTERNAL_LABEL ! 140: #define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM) \ ! 141: sprintf (LABEL, "*.L%s%d", PREFIX, NUM) ! 142: ! 143: /* in Solaris 2.0, linenos are relative to the current fn. */ ! 144: #undef ASM_OUTPUT_SOURCE_LINE ! 145: #define ASM_OUTPUT_SOURCE_LINE(file, line) \ ! 146: { static int sym_lineno = 1; \ ! 147: fprintf (file, ".stabn 68,0,%d,.LM%d-%s\n.LM%d:\n", \ ! 148: line, sym_lineno, \ ! 149: XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0), \ ! 150: sym_lineno); \ ! 151: sym_lineno += 1; } ! 152: ! 153: /* But, to make this work, we have to output the stabs for the function ! 154: name *first*... */ ! 155: #define DBX_FUNCTION_FIRST ! 156: ! 157: ! 158: /* We don't use the standard svr4 STARTFILE_SPEC because it's wrong for us. ! 159: We don't use the standard LIB_SPEC only because we don't yet support c++ */ ! 160: ! 161: /* If we cannot find the GNU *crt*.o files in the STANDARD_STARTFILE_PREFIX ! 162: directory, our fallback strategy must be to look for these files instead ! 163: in the Sun C 2.0 directory. */ ! 164: ! 165: #undef MD_STARTFILE_PREFIX ! 166: #define MD_STARTFILE_PREFIX "/opt/SUNWspro/SC2.0/" ! 167: ! 168: #undef STARTFILE_SPEC ! 169: #define STARTFILE_SPEC "%{!shared: \ ! 170: %{!symbolic: \ ! 171: %{pg:crt1.o%s}%{!pg:%{p:mcrt1.o%s}%{!p:crt1.o%s}} \ ! 172: %{pg:gmon.o%s} \ ! 173: %{pg:crti.o%s}%{!pg:crti.o%s} \ ! 174: %{ansi:/usr/ccs/lib/values-Xc.o%s} \ ! 175: %{!ansi: \ ! 176: %{traditional:/usr/ccs/lib/values-Xt.o%s} \ ! 177: %{!traditional:/usr/ccs/lib/values-Xa.o%s}}}} \ ! 178: crtbegin.o%s" ! 179: ! 180: /* ??? Note: in order for -compat-bsd to work fully, ! 181: we must somehow arrange to fixincludes /usr/ucbinclude ! 182: and put the result in $(libsubdir)/ucbinclude. */ ! 183: ! 184: #undef LIB_SPEC ! 185: #define LIB_SPEC \ ! 186: "%{compat-bsd:-lucb -lsocket -lnsl -lelf -laio} \ ! 187: %{!shared:%{!symbolic:-lc}} \ ! 188: crtend.o%s \ ! 189: %{!shared:%{!symbolic:%{pg:crtn.o%s}%{!pg:crtn.o%s}}}" ! 190: ! 191: /* This should be the same as in svr4.h, except with -R added. */ ! 192: #undef LINK_SPEC ! 193: #define LINK_SPEC \ ! 194: "%{h*} %{V} %{v:%{!V:-V}} \ ! 195: %{b} %{Wl,*:%*} \ ! 196: %{static:-dn -Bstatic} \ ! 197: %{shared:-G -dy} \ ! 198: %{symbolic:-Bsymbolic -G -dy} \ ! 199: %{G:-G} \ ! 200: %{YP,*} \ ! 201: %{R*} \ ! 202: %{compat-bsd: \ ! 203: %{!YP,*:%{p:-Y P,/usr/ucblib:/usr/ccs/lib/libp:/usr/lib/libp:/usr/ccs/lib:/usr/lib} \ ! 204: %{!p:-Y P,/usr/ucblib:/usr/ccs/lib:/usr/lib}} \ ! 205: -R /usr/ucblib} \ ! 206: %{!compat-bsd: \ ! 207: %{!YP,*:%{p:-Y P,/usr/ccs/lib/libp:/usr/lib/libp:/usr/ccs/lib:/usr/lib} \ ! 208: %{!p:-Y P,/usr/ccs/lib:/usr/lib}}} \ ! 209: %{Qy:} %{!Qn:-Qy}" ! 210: ! 211: /* This defines which switch letters take arguments. ! 212: It is as in svr4.h but with -R added. */ ! 213: ! 214: #undef SWITCH_TAKES_ARG ! 215: #define SWITCH_TAKES_ARG(CHAR) \ ! 216: ( (CHAR) == 'D' \ ! 217: || (CHAR) == 'U' \ ! 218: || (CHAR) == 'o' \ ! 219: || (CHAR) == 'e' \ ! 220: || (CHAR) == 'u' \ ! 221: || (CHAR) == 'I' \ ! 222: || (CHAR) == 'm' \ ! 223: || (CHAR) == 'L' \ ! 224: || (CHAR) == 'R' \ ! 225: || (CHAR) == 'A' \ ! 226: || (CHAR) == 'h' \ ! 227: || (CHAR) == 'z') ! 228: ! 229: /* ??? This does not work in SunOS 4.x, so it is not enabled in sparc.h. ! 230: Instead, it is enabled here, because it does work under Solaris. */ ! 231: /* Define for support of TFmode long double and REAL_ARITHMETIC. ! 232: Sparc ABI says that long double is 4 words. */ ! 233: #define LONG_DOUBLE_TYPE_SIZE 128
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.