Annotation of gcc/config/sparc/sol2.h, revision 1.1.1.1

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__ -Asystem(unix) -Acpu(sparc) -Amachine(sparc)\
                     28:   -D__GCC_NEW_VARARGS__"
                     29: 
                     30: #undef CPP_SPEC
                     31: #define CPP_SPEC "\
                     32:    %{compat-bsd:-iwithprefix ucbinclude -idirafter /usr/ucbinclude}\
                     33:    %{msparclite:-D__sparclite__} %{mv8:-D__sparc_v8__}"
                     34: 
                     35: /* The sun bundled assembler doesn't accept -Yd, (and neither does gas).
                     36:    It's safe to pass -s always, even if -g is not used. */
                     37: #undef ASM_SPEC
                     38: #define ASM_SPEC \
                     39:   "%{V} %{v:%{!V:-V}} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Wa,*:%*} -s \
                     40:    %{fpic:-K PIC} %{fPIC:-K PIC}"
                     41: 
                     42: /* However it appears that Solaris 2.0 uses the same reg numbering as
                     43:    the old BSD-style system did. */
                     44: 
                     45: #undef DBX_REGISTER_NUMBER
                     46: /* Same as sparc.h */
                     47: #define DBX_REGISTER_NUMBER(REGNO) (REGNO)
                     48: 
                     49: /* We use stabs-in-elf for debugging, because that is what the native
                     50:    toolchain uses.  */
                     51: #define DBX_DEBUGGING_INFO
                     52: #define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
                     53: 
                     54: #define DBX_BLOCKS_FUNCTION_RELATIVE 1
                     55: 
                     56: /* "gcc2_compiled." must be a .stabs, not an ordinary symbol, or GDB won't
                     57:    see it.  Furthermore, since GDB reads the input piecemeal, starting
                     58:    with each N_SO, it's a lot easier if the gcc2 flag symbol is *after*
                     59:    the N_SO rather than before it.  So we emit an N_OPT stab here.  */
                     60: 
                     61: #define ASM_IDENTIFY_GCC(FILE) /* Do nothing */
                     62: 
                     63: #define ASM_IDENTIFY_GCC_AFTER_SOURCE(FILE)    \
                     64:  fputs ("\t.stabs\t\"gcc2_compiled.\", 0x3c, 0, 0, 0\n", FILE)
                     65: 
                     66: #undef CTORS_SECTION_ASM_OP
                     67: #undef DTORS_SECTION_ASM_OP
                     68: 
                     69: #if 0 /* These seems unnecessary; the ones in sparc/sysv4.h look right.  */
                     70: #undef TEXT_SECTION_ASM_OP
                     71: #undef DATA_SECTION_ASM_OP
                     72: #undef BSS_SECTION_ASM_OP
                     73: #undef CONST_SECTION_ASM_OP
                     74: #undef INIT_SECTION_ASM_OP
                     75: 
                     76: #define TEXT_SECTION_ASM_OP    "\t.section\t\".text\""
                     77: #define DATA_SECTION_ASM_OP    "\t.section\t\".data\""
                     78: #define BSS_SECTION_ASM_OP     "\t.section\t\".bss\""
                     79: 
                     80: #define CONST_SECTION_ASM_OP   "\t.section\t\".rodata\""
                     81: #define INIT_SECTION_ASM_OP    "\t.section\t\".init\""
                     82: #endif
                     83: 
                     84: #define CTORS_SECTION_ASM_OP   "\t.section\t\".ctors\",#alloc,#execinstr\n"
                     85: #define DTORS_SECTION_ASM_OP   "\t.section\t\".dtors\",#alloc,#execinstr\n"
                     86: 
                     87: /* The native assembler can't compute differences between symbols in different
                     88:    sections when generating pic code, so we must put jump tables in the
                     89:    text section.  */
                     90: #define JUMP_TABLES_IN_TEXT_SECTION 1
                     91: 
                     92: /* Must use data section for relocatable constants when pic.  */
                     93: #undef SELECT_RTX_SECTION
                     94: #define SELECT_RTX_SECTION(MODE,RTX)           \
                     95: {                                              \
                     96:   if (flag_pic && symbolic_operand (RTX))      \
                     97:     data_section ();                           \
                     98:   else                                         \
                     99:     const_section ();                          \
                    100: }
                    101: 
                    102: /* The Solaris 2 assembler uses .skip, not .zero, so put this back. */
                    103: #undef ASM_OUTPUT_SKIP
                    104: #define ASM_OUTPUT_SKIP(FILE,SIZE)  \
                    105:   fprintf (FILE, "\t.skip %u\n", (SIZE))
                    106: 
                    107: #undef ASM_OUTPUT_ALIGNED_LOCAL
                    108: #define ASM_OUTPUT_ALIGNED_LOCAL(FILE, NAME, SIZE, ALIGN)              \
                    109: do {                                                                   \
                    110:   fputs ("\t.local\t", (FILE));                \
                    111:   assemble_name ((FILE), (NAME));                                      \
                    112:   putc ('\n', (FILE));                                                 \
                    113:   ASM_OUTPUT_ALIGNED_COMMON (FILE, NAME, SIZE, ALIGN);                 \
                    114: } while (0)
                    115: 
                    116: #undef COMMON_ASM_OP
                    117: #define COMMON_ASM_OP "\t.common"
                    118: 
                    119: /* This is how to output a definition of an internal numbered label where
                    120:    PREFIX is the class of label and NUM is the number within the class.  */
                    121: 
                    122: #undef  ASM_OUTPUT_INTERNAL_LABEL
                    123: #define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM)     \
                    124:   fprintf (FILE, ".L%s%d:\n", PREFIX, NUM)
                    125: 
                    126: /* This is how to output a reference to an internal numbered label where
                    127:    PREFIX is the class of label and NUM is the number within the class.  */
                    128: 
                    129: #undef  ASM_OUTPUT_INTERNAL_LABELREF
                    130: #define ASM_OUTPUT_INTERNAL_LABELREF(FILE,PREFIX,NUM)  \
                    131:   fprintf (FILE, ".L%s%d", PREFIX, NUM)
                    132: 
                    133: /* This is how to store into the string LABEL
                    134:    the symbol_ref name of an internal numbered label where
                    135:    PREFIX is the class of label and NUM is the number within the class.
                    136:    This is suitable for output with `assemble_name'.  */
                    137: 
                    138: #undef  ASM_GENERATE_INTERNAL_LABEL
                    139: #define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM)  \
                    140:   sprintf (LABEL, "*.L%s%d", PREFIX, NUM)
                    141: 
                    142: /* in Solaris 2.0, linenos are relative to the current fn. */
                    143: #undef  ASM_OUTPUT_SOURCE_LINE
                    144: #define ASM_OUTPUT_SOURCE_LINE(file, line)             \
                    145:   { static int sym_lineno = 1;                         \
                    146:     fprintf (file, ".stabn 68,0,%d,.LM%d-%s\n.LM%d:\n",        \
                    147:             line, sym_lineno,                          \
                    148:             XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0), \
                    149:             sym_lineno);                               \
                    150:     sym_lineno += 1; }
                    151: 
                    152: /* But, to make this work, we have to output the stabs for the function
                    153:    name *first*...  */
                    154: #define        DBX_FUNCTION_FIRST
                    155: 
                    156: 
                    157: /* We don't use the standard svr4 STARTFILE_SPEC because it's wrong for us.
                    158:    We don't use the standard LIB_SPEC only because we don't yet support c++ */
                    159: 
                    160: /* If we cannot find the GNU *crt*.o files in the STANDARD_STARTFILE_PREFIX
                    161:    directory, our fallback strategy must be to look for these files instead
                    162:    in the Sun C 2.0 directory.  */
                    163: 
                    164: #undef MD_STARTFILE_PREFIX
                    165: #define MD_STARTFILE_PREFIX "/opt/SUNWspro/SC2.0/"
                    166: 
                    167: #undef STARTFILE_SPEC
                    168: #define STARTFILE_SPEC "%{!shared: \
                    169:                         %{!symbolic: \
                    170:                          %{pg:crt1.o%s}%{!pg:%{p:mcrt1.o%s}%{!p:crt1.o%s}} \
                    171:                          %{pg:gmon.o%s} \
                    172:                          %{pg:crti.o%s}%{!pg:crti.o%s} \
                    173:                          %{ansi:/usr/ccs/lib/values-Xc.o%s} \
                    174:                          %{!ansi: \
                    175:                           %{traditional:/usr/ccs/lib/values-Xt.o%s} \
                    176:                           %{!traditional:/usr/ccs/lib/values-Xa.o%s}}}} \
                    177:                          crtbegin.o%s"
                    178: 
                    179: /* ??? Note: in order for -compat-bsd to work fully,
                    180:    we must somehow arrange to fixincludes /usr/ucbinclude
                    181:    and put the result in $(libsubdir)/ucbinclude.  */
                    182: 
                    183: #undef LIB_SPEC
                    184: #define LIB_SPEC \
                    185:   "%{compat-bsd:-lucb -lsocket -lnsl -lelf -laio} \
                    186:    %{!shared:%{!symbolic:-lc}} \
                    187:    crtend.o%s \
                    188:    %{!shared:%{!symbolic:%{pg:crtn.o%s}%{!pg:crtn.o%s}}}"
                    189: 
                    190: /* This should be the same as in svr4.h, except with -R added.  */
                    191: #undef LINK_SPEC
                    192: #define LINK_SPEC \
                    193:   "%{h*} %{V} %{v:%{!V:-V}} \
                    194:    %{b} %{Wl,*:%*} \
                    195:    %{static:-dn -Bstatic} \
                    196:    %{shared:-G -dy} \
                    197:    %{symbolic:-Bsymbolic -G -dy} \
                    198:    %{G:-G} \
                    199:    %{YP,*} \
                    200:    %{R*} \
                    201:    %{compat-bsd: \
                    202:      %{!YP,*:%{p:-Y P,/usr/ucblib:/usr/ccs/lib/libp:/usr/lib/libp:/usr/ccs/lib:/usr/lib} \
                    203:        %{!p:-Y P,/usr/ucblib:/usr/ccs/lib:/usr/lib}} \
                    204:      -R /usr/ucblib} \
                    205:    %{!compat-bsd: \
                    206:      %{!YP,*:%{p:-Y P,/usr/ccs/lib/libp:/usr/lib/libp:/usr/ccs/lib:/usr/lib} \
                    207:        %{!p:-Y P,/usr/ccs/lib:/usr/lib}}} \
                    208:    %{Qy:} %{!Qn:-Qy}"
                    209: 
                    210: /* This defines which switch letters take arguments.
                    211:    It is as in svr4.h but with -R added.  */
                    212: 
                    213: #undef SWITCH_TAKES_ARG
                    214: #define SWITCH_TAKES_ARG(CHAR) \
                    215:   (   (CHAR) == 'D' \
                    216:    || (CHAR) == 'U' \
                    217:    || (CHAR) == 'o' \
                    218:    || (CHAR) == 'e' \
                    219:    || (CHAR) == 'u' \
                    220:    || (CHAR) == 'I' \
                    221:    || (CHAR) == 'm' \
                    222:    || (CHAR) == 'L' \
                    223:    || (CHAR) == 'R' \
                    224:    || (CHAR) == 'A' \
                    225:    || (CHAR) == 'h' \
                    226:    || (CHAR) == 'z')

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.