Mercurial > hg > CbC > CbC_gcc
annotate gcc/config/sparc/freebsd.h @ 67:f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
author | nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 22 Mar 2011 17:18:12 +0900 |
parents | a06113de4d67 |
children | 04ced10e8804 |
rev | line source |
---|---|
0 | 1 /* Definitions for Sun SPARC64 running FreeBSD using the ELF format |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2 Copyright (C) 2001, 2002, 2004, 2005, 2006, 2007, 2010, 2011 |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
3 Free Software Foundation, Inc. |
0 | 4 Contributed by David E. O'Brien <obrien@FreeBSD.org> and BSDi. |
5 | |
6 This file is part of GCC. | |
7 | |
8 GCC 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 3, or (at your option) | |
11 any later version. | |
12 | |
13 GCC 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 GCC; see the file COPYING3. If not see | |
20 <http://www.gnu.org/licenses/>. */ | |
21 | |
22 #undef SUBTARGET_EXTRA_SPECS | |
23 #define SUBTARGET_EXTRA_SPECS \ | |
24 { "fbsd_dynamic_linker", FBSD_DYNAMIC_LINKER } | |
25 | |
26 /* FreeBSD needs the platform name (sparc64) defined. | |
27 Emacs needs to know if the arch is 64 or 32-bits. */ | |
28 | |
29 #undef CPP_CPU64_DEFAULT_SPEC | |
30 #define CPP_CPU64_DEFAULT_SPEC \ | |
31 "-D__sparc64__ -D__sparc_v9__ -D__sparcv9 -D__arch64__" | |
32 | |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
33 #undef ASM_SPEC |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
34 #define ASM_SPEC "%{fpic|fPIC|fpie|fPIE:-K PIC} %(asm_cpu)" |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
35 |
0 | 36 #define LINK_SPEC "%(link_arch) \ |
37 %{!mno-relax:%{!r:-relax}} \ | |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
38 %{p:%nconsider using '-pg' instead of '-p' with gprof(1)} \ |
0 | 39 %{assert*} %{R*} %{rpath*} %{defsym*} \ |
40 %{shared:-Bshareable %{h*} %{soname*}} \ | |
41 %{symbolic:-Bsymbolic} \ | |
42 %{!shared: \ | |
43 %{!static: \ | |
44 %{rdynamic:-export-dynamic} \ | |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
45 -dynamic-linker %(fbsd_dynamic_linker) } \ |
0 | 46 %{static:-Bstatic}}" |
47 | |
48 | |
49 /************************[ Target stuff ]***********************************/ | |
50 | |
51 /* Define the actual types of some ANSI-mandated types. | |
52 Needs to agree with <machine/ansi.h>. GCC defaults come from c-decl.c, | |
53 c-common.c, and config/<arch>/<arch>.h. */ | |
54 | |
55 /* Earlier headers may get this wrong for FreeBSD. | |
56 We use the GCC defaults instead. */ | |
57 #undef WCHAR_TYPE | |
58 | |
59 #undef WCHAR_TYPE_SIZE | |
60 #define WCHAR_TYPE_SIZE 32 | |
61 | |
62 /* Define for support of TFmode long double. | |
63 SPARC ABI says that long double is 4 words. */ | |
64 #undef LONG_DOUBLE_TYPE_SIZE | |
65 #define LONG_DOUBLE_TYPE_SIZE (TARGET_LONG_DOUBLE_128 ? 128 : 64) | |
66 | |
67 /* Define this to set long double type size to use in libgcc2.c, which can | |
68 not depend on target_flags. */ | |
69 #if defined(__arch64__) || defined(__LONG_DOUBLE_128__) | |
70 #define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 128 | |
71 #else | |
72 #define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 64 | |
73 #endif | |
74 | |
75 /* Definitions for 64-bit SPARC running systems with ELF. */ | |
76 | |
77 #undef TARGET_VERSION | |
78 #define TARGET_VERSION fprintf (stderr, " (FreeBSD/sparc64 ELF)"); | |
79 | |
80 #define TARGET_ELF 1 | |
81 | |
82 /* XXX */ | |
83 /* A 64 bit v9 compiler with stack-bias, | |
84 in a Medium/mid code model environment. */ | |
85 | |
86 #undef TARGET_DEFAULT | |
87 #define TARGET_DEFAULT \ | |
88 (MASK_V9 + MASK_64BIT + MASK_PTR64 /* + MASK_FASTER_STRUCTS */ \ | |
89 + MASK_STACK_BIAS + MASK_APP_REGS + MASK_FPU \ | |
90 + MASK_LONG_DOUBLE_128 /* + MASK_HARD_QUAD */) | |
91 | |
92 /* The default code model. */ | |
93 #undef SPARC_DEFAULT_CMODEL | |
94 #define SPARC_DEFAULT_CMODEL CM_MEDLOW | |
95 | |
96 #define ENABLE_EXECUTE_STACK \ | |
97 static int need_enable_exec_stack; \ | |
98 static void check_enabling(void) __attribute__ ((constructor)); \ | |
99 static void check_enabling(void) \ | |
100 { \ | |
101 extern int sysctlbyname(const char *, void *, size_t *, void *, size_t);\ | |
102 int prot = 0; \ | |
103 size_t len = sizeof(prot); \ | |
104 \ | |
105 sysctlbyname ("kern.stackprot", &prot, &len, NULL, 0); \ | |
106 if (prot != 7) \ | |
107 need_enable_exec_stack = 1; \ | |
108 } \ | |
109 extern void __enable_execute_stack (void *); \ | |
110 void __enable_execute_stack (void *addr) \ | |
111 { \ | |
112 if (!need_enable_exec_stack) \ | |
113 return; \ | |
114 else { \ | |
115 /* 7 is PROT_READ | PROT_WRITE | PROT_EXEC */ \ | |
116 if (mprotect (addr, TRAMPOLINE_SIZE, 7) < 0) \ | |
117 perror ("mprotect of trampoline code"); \ | |
118 } \ | |
119 } | |
120 | |
121 | |
122 /************************[ Assembler stuff ]********************************/ | |
123 | |
124 #undef LOCAL_LABEL_PREFIX | |
125 #define LOCAL_LABEL_PREFIX "." | |
126 | |
127 /* XXX2 */ | |
128 /* This is how to store into the string LABEL | |
129 the symbol_ref name of an internal numbered label where | |
130 PREFIX is the class of label and NUM is the number within the class. | |
131 This is suitable for output with `assemble_name'. */ | |
132 | |
133 #undef ASM_GENERATE_INTERNAL_LABEL | |
134 #define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM) \ | |
135 sprintf (LABEL, "*.L%s%lu", PREFIX, (unsigned long)(NUM)) | |
136 | |
137 | |
138 /************************[ Debugger stuff ]*********************************/ | |
139 | |
140 /* This is the char to use for continuation (in case we need to turn | |
141 continuation back on). */ | |
142 | |
143 #undef DBX_CONTIN_CHAR | |
144 #define DBX_CONTIN_CHAR '?' | |
145 | |
146 /* DWARF bits. */ | |
147 | |
148 /* Follow Irix 6 and not the Dwarf2 draft in using 64-bit offsets. | |
149 Obviously the Dwarf2 folks havn't tried to actually build systems | |
150 with their spec. On a 64-bit system, only 64-bit relocs become | |
151 RELATIVE relocations. */ | |
152 | |
153 /* #define DWARF_OFFSET_SIZE PTR_SIZE */ | |
154 | |
155 #undef ENDFILE_SPEC | |
156 #define ENDFILE_SPEC \ | |
157 "%{ffast-math|funsafe-math-optimizations:crtfastmath.o%s} " \ | |
158 FBSD_ENDFILE_SPEC | |
159 | |
160 /* We use GNU ld so undefine this so that attribute((init_priority)) works. */ | |
161 #undef CTORS_SECTION_ASM_OP | |
162 #undef DTORS_SECTION_ASM_OP |