freebsd.h revision 96263
1/* Definitions for Sun Sparc64 running FreeBSD using the ELF format
2   Copyright (C) 2001, 2002 Free Software Foundation, Inc.
3   Contributed by David E. O'Brien <obrien@FreeBSD.org> and BSDi.
4
5This file is part of GNU CC.
6
7GNU CC is free software; you can redistribute it and/or modify
8it under the terms of the GNU General Public License as published by
9the Free Software Foundation; either version 2, or (at your option)
10any later version.
11
12GNU CC is distributed in the hope that it will be useful,
13but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License
18along with GNU CC; see the file COPYING.  If not, write to
19the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
20
21/* FreeBSD needs's the platform name (sparc64) defined.  */
22
23#undef  CPP_CPU64_DEFAULT_SPEC
24#define CPP_CPU64_DEFAULT_SPEC "-D__sparc64__ -D__sparc_v9__"
25
26#undef  CPP_PREDEFINES
27#define CPP_PREDEFINES FBSD_CPP_PREDEFINES
28
29#define LINK_SPEC "%(link_arch)						\
30  %{!mno-relax:%{!r:-relax}}						\
31  %{p:%e`-p' not supported; use `-pg' and gprof(1)}			\
32  %{Wl,*:%*}								\
33  %{assert*} %{R*} %{rpath*} %{defsym*}					\
34  %{shared:-Bshareable %{h*} %{soname*}}				\
35  %{symbolic:-Bsymbolic}						\
36  %{!shared:								\
37    %{!static:								\
38      %{rdynamic:-export-dynamic}					\
39      %{!dynamic-linker:-dynamic-linker /usr/libexec/ld-elf.so.1}}	\
40    %{static:-Bstatic}}"
41
42
43/************************[  Target stuff  ]***********************************/
44
45/* Define the actual types of some ANSI-mandated types.
46   Needs to agree with <machine/ansi.h>.  GCC defaults come from c-decl.c,
47   c-common.c, and config/<arch>/<arch>.h.  */
48
49/* Earlier headers may get this wrong for FreeBSD.
50   We use the GCC defaults instead.  */
51#undef WCHAR_TYPE
52
53#undef  WCHAR_UNSIGNED
54#define WCHAR_UNSIGNED 0
55
56#undef  WCHAR_TYPE_SIZE
57#define WCHAR_TYPE_SIZE 32
58
59/* Define for support of TFmode long double and REAL_ARITHMETIC.
60   Sparc ABI says that long double is 4 words.  */
61#undef  LONG_DOUBLE_TYPE_SIZE
62#define LONG_DOUBLE_TYPE_SIZE (TARGET_LONG_DOUBLE_128 ? 128 : 64)
63
64/* Constant which presents upper bound of the above value.  */
65#undef  MAX_LONG_DOUBLE_TYPE_SIZE
66#define MAX_LONG_DOUBLE_TYPE_SIZE 128
67
68/* Define this to set long double type size to use in libgcc2.c, which can
69   not depend on target_flags.  */
70#if defined(__arch64__) || defined(__LONG_DOUBLE_128__)
71#define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 128
72#else
73#define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 64
74#endif
75
76/* Definitions for 64-bit SPARC running systems with ELF. */
77
78#undef  SUBTARGET_SWITCHES
79#define SUBTARGET_SWITCHES						    \
80  {"long-double-64", -MASK_LONG_DOUBLE_128, N_("Use 64 bit long doubles") },  \
81  {"long-double-128", MASK_LONG_DOUBLE_128, N_("Use 128 bit long doubles") },
82
83#undef  TARGET_VERSION
84#define TARGET_VERSION fprintf (stderr, " (FreeBSD/sparc64 ELF)");
85
86#define TARGET_ELF		1
87
88/* XXX */
89/* A 64 bit v9 compiler with stack-bias,
90   in a Medium/mid code model environment.  */
91
92#undef  TARGET_DEFAULT
93#define TARGET_DEFAULT \
94  (MASK_V9 + MASK_64BIT + MASK_PTR64 /* + MASK_FASTER_STRUCTS */ \
95   + MASK_STACK_BIAS + MASK_APP_REGS + MASK_FPU \
96   + MASK_LONG_DOUBLE_128 /* + MASK_HARD_QUAD */)
97
98/* The default code model.  */
99#undef  SPARC_DEFAULT_CMODEL
100#define SPARC_DEFAULT_CMODEL	CM_MEDLOW
101
102
103/************************[  Assembler stuff  ]********************************/
104
105#undef	LOCAL_LABEL_PREFIX
106#define LOCAL_LABEL_PREFIX  "."
107
108/* XXX2 */
109/* This is how to output a definition of an internal numbered label where
110   PREFIX is the class of label and NUM is the number within the class.  */
111
112#undef  ASM_OUTPUT_INTERNAL_LABEL
113#define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM)			\
114  fprintf (FILE, ".L%s%d:\n", PREFIX, NUM)
115
116/* XXX2 */
117/* This is how to output a reference to an internal numbered label where
118   PREFIX is the class of label and NUM is the number within the class.  */
119
120#undef  ASM_OUTPUT_INTERNAL_LABELREF
121#define ASM_OUTPUT_INTERNAL_LABELREF(FILE,PREFIX,NUM)			\
122  fprintf (FILE, ".L%s%d", PREFIX, NUM)
123
124/* XXX2 */
125/* This is how to store into the string LABEL
126   the symbol_ref name of an internal numbered label where
127   PREFIX is the class of label and NUM is the number within the class.
128   This is suitable for output with `assemble_name'.  */
129
130#undef  ASM_GENERATE_INTERNAL_LABEL
131#define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM)			\
132  sprintf (LABEL, "*.L%s%d", PREFIX, NUM)
133
134
135/************************[  Debugger stuff  ]*********************************/
136
137/* This is the char to use for continuation (in case we need to turn
138   continuation back on).  */
139
140#undef  DBX_CONTIN_CHAR
141#define DBX_CONTIN_CHAR	'?'
142
143/* DWARF bits.  */
144
145/* Follow Irix 6 and not the Dwarf2 draft in using 64-bit offsets.
146   Obviously the Dwarf2 folks havn't tried to actually build systems
147   with their spec.  On a 64-bit system, only 64-bit relocs become
148   RELATIVE relocations.  */
149
150/* #define DWARF_OFFSET_SIZE PTR_SIZE */
151
152#undef ENDFILE_SPEC
153#define ENDFILE_SPEC \
154  	"%{ffast-math|funsafe-math-optimizations:crtfastmath.o%s}" \
155	FBSD_ENDFILE_SPEC
156
157/* We use GNU ld so undefine this so that attribute((init_priority)) works.  */
158#undef CTORS_SECTION_ASM_OP
159#undef DTORS_SECTION_ASM_OP
160