1 /* Definitions of target machine for GNU compiler, for SPARC running Solaris 2
2 Copyright 1992, 1995, 1996 Free Software Foundation, Inc.
3 Contributed by Ron Guilmette (rfg@netcom.com).
4 Additional changes by 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, 59 Temple Place - Suite 330,
21 Boston, MA 02111-1307, USA. */
23 /* Supposedly the same as vanilla sparc svr4, except for the stuff below: */
24 #include "sparc/sysv4.h"
27 #define CPP_PREDEFINES \
28 "-Dsun -Dsparc -Dunix -D__svr4__ -D__SVR4 \
29 -Asystem(unix) -Asystem(svr4) -Acpu(sparc) -Amachine(sparc)\
30 -D__GCC_NEW_VARARGS__"
34 %{compat-bsd:-iwithprefixbefore ucbinclude -I/usr/ucbinclude} \
38 /* The sun bundled assembler doesn't accept -Yd, (and neither does gas).
39 It's safe to pass -s always, even if -g is not used. */
42 %{v:-V} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Wa,*:%*} -s \
43 %{fpic:-K PIC} %{fPIC:-K PIC} \
47 /* This is here rather than in sparc.h because it's not known what
48 other assemblers will accept. */
49 #if TARGET_CPU_DEFAULT == TARGET_CPU_sparc64
50 #undef ASM_DEFAULT_SPEC
51 #define ASM_DEFAULT_SPEC "-xarch=v8plus"
54 #define ASM_CPU_SPEC "\
55 %{mcpu=v8plus:-xarch=v8plus} \
56 %{mcpu=ultrasparc:-xarch=v8plus} \
57 %{!mcpu*:%(asm_default)} \
60 /* However it appears that Solaris 2.0 uses the same reg numbering as
61 the old BSD-style system did. */
63 #undef DBX_REGISTER_NUMBER
65 #define DBX_REGISTER_NUMBER(REGNO) \
66 (TARGET_FLAT && REGNO == FRAME_POINTER_REGNUM ? 31 : REGNO)
68 /* We use stabs-in-elf for debugging, because that is what the native
70 #undef PREFERRED_DEBUGGING_TYPE
71 #define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
73 /* The Solaris 2 assembler uses .skip, not .zero, so put this back. */
74 #undef ASM_OUTPUT_SKIP
75 #define ASM_OUTPUT_SKIP(FILE,SIZE) \
76 fprintf (FILE, "\t.skip %u\n", (SIZE))
78 /* Use .uahalf/.uaword so packed structure members don't generate
79 assembler errors when using the native assembler. */
81 #define ASM_SHORT ".uahalf"
83 #define ASM_LONG ".uaword"
85 /* This is how to output a definition of an internal numbered label where
86 PREFIX is the class of label and NUM is the number within the class. */
88 #undef ASM_OUTPUT_INTERNAL_LABEL
89 #define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \
90 fprintf (FILE, ".L%s%d:\n", PREFIX, NUM)
92 /* This is how to output a reference to an internal numbered label where
93 PREFIX is the class of label and NUM is the number within the class. */
95 #undef ASM_OUTPUT_INTERNAL_LABELREF
96 #define ASM_OUTPUT_INTERNAL_LABELREF(FILE,PREFIX,NUM) \
97 fprintf (FILE, ".L%s%d", PREFIX, NUM)
99 /* This is how to store into the string LABEL
100 the symbol_ref name of an internal numbered label where
101 PREFIX is the class of label and NUM is the number within the class.
102 This is suitable for output with `assemble_name'. */
104 #undef ASM_GENERATE_INTERNAL_LABEL
105 #define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM) \
106 sprintf (LABEL, "*.L%s%d", PREFIX, NUM)
109 /* We don't use the standard svr4 STARTFILE_SPEC because it's wrong for us.
110 We don't use the standard LIB_SPEC only because we don't yet support c++ */
112 #undef STARTFILE_SPEC
113 #define STARTFILE_SPEC "%{!shared: \
117 %{pg:gcrt1.o%s gmon.o%s} \
120 %{ansi:values-Xc.o%s} \
122 %{traditional:values-Xt.o%s} \
123 %{!traditional:values-Xa.o%s}} \
126 /* ??? Note: in order for -compat-bsd to work fully,
127 we must somehow arrange to fixincludes /usr/ucbinclude
128 and put the result in $(libsubdir)/ucbinclude. */
132 "%{compat-bsd:-lucb -lsocket -lnsl -lelf -laio} %{!shared:%{!symbolic:-lc}}"
135 #define ENDFILE_SPEC "crtend.o%s crtn.o%s"
137 /* This should be the same as in svr4.h, except with -R added. */
142 %{static:-dn -Bstatic} \
143 %{shared:-G -dy %{!mimpure-text:-z text} %{!h*:%{o*:-h %*}}} \
144 %{symbolic:-Bsymbolic -G -dy -z text %{!h*:%{o*:-h %*}}} \
149 %{!YP,*:%{p:-Y P,/usr/ucblib:/usr/ccs/lib/libp:/usr/lib/libp:/usr/ccs/lib:/usr/lib} \
150 %{pg:-Y P,/usr/ucblib:/usr/ccs/lib/libp:/usr/lib/libp:/usr/ccs/lib:/usr/lib} \
151 %{!p:%{!pg:-Y P,/usr/ucblib:/usr/ccs/lib:/usr/lib}}} \
154 %{!YP,*:%{p:-Y P,/usr/ccs/lib/libp:/usr/lib/libp:/usr/ccs/lib:/usr/lib} \
155 %{pg:-Y P,/usr/ccs/lib/libp:/usr/lib/libp:/usr/ccs/lib:/usr/lib} \
156 %{!p:%{!pg:-Y P,/usr/ccs/lib:/usr/lib}}}} \
159 /* This defines which switch letters take arguments.
160 It is as in svr4.h but with -R added. */
162 #undef SWITCH_TAKES_ARG
163 #define SWITCH_TAKES_ARG(CHAR) \
164 (DEFAULT_SWITCH_TAKES_ARG(CHAR) \
170 /* ??? This does not work in SunOS 4.x, so it is not enabled in sparc.h.
171 Instead, it is enabled here, because it does work under Solaris. */
172 /* Define for support of TFmode long double and REAL_ARITHMETIC.
173 Sparc ABI says that long double is 4 words. */
174 #define LONG_DOUBLE_TYPE_SIZE 128