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 (rfg@ncd.com) and
4 David V. Henkel-Wallace (gumby@cygnus.com).
6 This file is part of GNU CC.
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)
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.
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. */
22 /* Supposedly the same as vanilla sparc svr4, except for the stuff below: */
26 #define CPP_PREDEFINES \
27 "-Dsun -Dsparc -Dunix -D__svr4__ -Asystem(unix) -Acpu(sparc) -Amachine(sparc)"
29 /* The sun bundled assembler doesn't accept -Yd, (and neither does gas).
30 It's safe to pass -s always, even if -g is not used. */
33 "%{V} %{v:%{!V:-V}} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Wa,*:%*} -s"
35 /* However it appears that Solaris 2.0 uses the same reg numbering as
36 the old BSD-style system did. */
38 #undef DBX_REGISTER_NUMBER
40 #define DBX_REGISTER_NUMBER(REGNO) (REGNO)
42 /* We use stabs-in-elf for debugging, because that is what the native
44 #define DBX_DEBUGGING_INFO
45 #define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
47 #define DBX_BLOCKS_FUNCTION_RELATIVE 1
49 /* "gcc2_compiled." must be a .stabs, not an ordinary symbol, or GDB won't
50 see it. Furthermore, since GDB reads the input piecemeal, starting
51 with each N_SO, it's a lot easier if the gcc2 flag symbol is *after*
52 the N_SO rather than before it. So we emit an N_OPT stab here. */
54 #define ASM_IDENTIFY_GCC(FILE) /* Do nothing */
56 #define ASM_IDENTIFY_GCC_AFTER_SOURCE(FILE) \
57 fputs ("\t.stabs\t\"gcc2_compiled.\", 0x3c, 0, 0, 0\n", FILE)
59 #undef CTORS_SECTION_ASM_OP
60 #undef DTORS_SECTION_ASM_OP
62 #if 0 /* These seems unnecessary; the ones in sparcv4.h look right. */
63 #undef TEXT_SECTION_ASM_OP
64 #undef DATA_SECTION_ASM_OP
65 #undef BSS_SECTION_ASM_OP
66 #undef CONST_SECTION_ASM_OP
67 #undef INIT_SECTION_ASM_OP
69 #define TEXT_SECTION_ASM_OP "\t.section\t\".text\""
70 #define DATA_SECTION_ASM_OP "\t.section\t\".data\""
71 #define BSS_SECTION_ASM_OP "\t.section\t\".bss\""
73 #define CONST_SECTION_ASM_OP "\t.section\t\".rodata\""
74 #define INIT_SECTION_ASM_OP "\t.section\t\".init\""
77 #define CTORS_SECTION_ASM_OP "\t.section\t\".ctors\",#alloc,#execinstr\n"
78 #define DTORS_SECTION_ASM_OP "\t.section\t\".dtors\",#alloc,#execinstr\n"
80 /* The Solaris 2 assembler uses .skip, not .zero, so put this back. */
81 #undef ASM_OUTPUT_SKIP
82 #define ASM_OUTPUT_SKIP(FILE,SIZE) \
83 fprintf (FILE, "\t.skip %u\n", (SIZE))
85 #undef ASM_OUTPUT_ALIGNED_LOCAL
86 #define ASM_OUTPUT_ALIGNED_LOCAL(FILE, NAME, SIZE, ALIGN) \
88 fputs ("\t.local\t", (FILE)); \
89 assemble_name ((FILE), (NAME)); \
90 putc ('\n', (FILE)); \
91 ASM_OUTPUT_ALIGNED_COMMON (FILE, NAME, SIZE, ALIGN); \
95 #define COMMON_ASM_OP "\t.common"
97 /* This is how to output a definition of an internal numbered label where
98 PREFIX is the class of label and NUM is the number within the class. */
100 #undef ASM_OUTPUT_INTERNAL_LABEL
101 #define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \
102 fprintf (FILE, ".L%s%d:\n", PREFIX, NUM)
104 /* This is how to output a reference to an internal numbered label where
105 PREFIX is the class of label and NUM is the number within the class. */
107 #undef ASM_OUTPUT_INTERNAL_LABELREF
108 #define ASM_OUTPUT_INTERNAL_LABELREF(FILE,PREFIX,NUM) \
109 fprintf (FILE, ".L%s%d", PREFIX, NUM)
111 /* This is how to store into the string LABEL
112 the symbol_ref name of an internal numbered label where
113 PREFIX is the class of label and NUM is the number within the class.
114 This is suitable for output with `assemble_name'. */
116 #undef ASM_GENERATE_INTERNAL_LABEL
117 #define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM) \
118 sprintf (LABEL, "*.L%s%d", PREFIX, NUM)
120 /* in Solaris 2.0, linenos are relative to the current fn. */
121 #undef ASM_OUTPUT_SOURCE_LINE
122 #define ASM_OUTPUT_SOURCE_LINE(file, line) \
123 { static int sym_lineno = 1; \
124 fprintf (file, ".stabn 68,0,%d,.LM%d-%s\n.LM%d:\n", \
126 IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (current_function_decl)),\
130 /* But, to make this work, we have to output the stabs for the function
132 #define DBX_FUNCTION_FIRST
135 /* We don't use the standard svr4 STARTFILE_SPEC because it's wrong for us.
136 We don't use the standard LIB_SPEC only because we don't yet support c++ */
138 /* If we cannot find the GNU *crt*.o files in the STANDARD_STARTFILE_PREFIX
139 directory, our fallback strategy must be to look for these files instead
140 in the Sun C 2.0 directory. */
142 #undef MD_STARTFILE_PREFIX
143 #define MD_STARTFILE_PREFIX "/opt/SUNWspro/SC2.0/"
145 #undef STARTFILE_SPEC
146 #define STARTFILE_SPEC "%{!shared: \
148 %{pg:crt1.o%s}%{!pg:%{p:mcrt1.o%s}%{!p:crt1.o%s}} \
150 %{pg:crti.o%s}%{!pg:crti.o%s} \
151 %{ansi:/usr/ccs/lib/values-Xc.o%s} \
153 %{traditional:/usr/ccs/lib/values-Xt.o%s} \
154 %{!traditional:/usr/ccs/lib/values-Xa.o%s}}}} \
159 "%{!shared:%{!symbolic:-lc}} \
161 %{!shared:%{!symbolic:%{pg:crtn.o%s}%{!pg:crtn.o%s}}}"