Mercurial > hg > CbC > CbC_gcc
annotate gcc/config/mips/linux.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 MIPS running Linux-based GNU systems with ELF format. |
2 Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, | |
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
|
3 2007, 2008, 2010, 2011 Free Software Foundation, Inc. |
0 | 4 |
5 This file is part of GCC. | |
6 | |
7 GCC is free software; you can redistribute it and/or modify | |
8 it under the terms of the GNU General Public License as published by | |
9 the Free Software Foundation; either version 3, or (at your option) | |
10 any later version. | |
11 | |
12 GCC is distributed in the hope that it will be useful, | |
13 but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
15 GNU General Public License for more details. | |
16 | |
17 You should have received a copy of the GNU General Public License | |
18 along with GCC; see the file COPYING3. If not see | |
19 <http://www.gnu.org/licenses/>. */ | |
20 | |
21 #undef WCHAR_TYPE | |
22 #define WCHAR_TYPE "int" | |
23 | |
24 #undef WCHAR_TYPE_SIZE | |
25 #define WCHAR_TYPE_SIZE 32 | |
26 | |
27 #undef ASM_DECLARE_OBJECT_NAME | |
28 #define ASM_DECLARE_OBJECT_NAME mips_declare_object_name | |
29 | |
30 #undef TARGET_VERSION | |
31 #if TARGET_ENDIAN_DEFAULT == 0 | |
32 #define TARGET_VERSION fprintf (stderr, " (MIPSel GNU/Linux with ELF)"); | |
33 #else | |
34 #define TARGET_VERSION fprintf (stderr, " (MIPS GNU/Linux with ELF)"); | |
35 #endif | |
36 | |
37 /* If we don't set MASK_ABICALLS, we can't default to PIC. */ | |
38 #undef TARGET_DEFAULT | |
39 #define TARGET_DEFAULT MASK_ABICALLS | |
40 | |
41 #define TARGET_OS_CPP_BUILTINS() \ | |
42 do { \ | |
43 LINUX_TARGET_OS_CPP_BUILTINS(); \ | |
44 /* The GNU C++ standard library requires this. */ \ | |
45 if (c_dialect_cxx ()) \ | |
46 builtin_define ("_GNU_SOURCE"); \ | |
47 } while (0) | |
48 | |
49 #undef SUBTARGET_CPP_SPEC | |
50 #define SUBTARGET_CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}" | |
51 | |
52 /* A standard GNU/Linux mapping. On most targets, it is included in | |
53 CC1_SPEC itself by config/linux.h, but mips.h overrides CC1_SPEC | |
54 and provides this hook instead. */ | |
55 #undef SUBTARGET_CC1_SPEC | |
56 #define SUBTARGET_CC1_SPEC "%{profile:-p}" | |
57 | |
58 /* From iris5.h */ | |
59 /* -G is incompatible with -KPIC which is the default, so only allow objects | |
60 in the small data section if the user explicitly asks for it. */ | |
61 #undef MIPS_DEFAULT_GVALUE | |
62 #define MIPS_DEFAULT_GVALUE 0 | |
63 | |
64 #define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1" | |
65 | |
66 /* Borrowed from sparc/linux.h */ | |
67 #undef LINK_SPEC | |
68 #define LINK_SPEC \ | |
69 "%(endian_spec) \ | |
70 %{shared:-shared} \ | |
71 %{!shared: \ | |
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
|
72 %{!static: \ |
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
|
73 %{rdynamic:-export-dynamic} \ |
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
|
74 -dynamic-linker " LINUX_DYNAMIC_LINKER "} \ |
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
|
75 %{static:-static}}" |
0 | 76 |
77 #undef SUBTARGET_ASM_SPEC | |
78 #define SUBTARGET_ASM_SPEC \ | |
79 "%{!mno-abicalls:%{mplt:-call_nonpic;:-KPIC}}" | |
80 | |
81 /* The MIPS assembler has different syntax for .set. We set it to | |
82 .dummy to trap any errors. */ | |
83 #undef SET_ASM_OP | |
84 #define SET_ASM_OP "\t.dummy\t" | |
85 | |
86 #undef ASM_OUTPUT_DEF | |
87 #define ASM_OUTPUT_DEF(FILE,LABEL1,LABEL2) \ | |
88 do { \ | |
89 fputc ( '\t', FILE); \ | |
90 assemble_name (FILE, LABEL1); \ | |
91 fputs ( " = ", FILE); \ | |
92 assemble_name (FILE, LABEL2); \ | |
93 fputc ( '\n', FILE); \ | |
94 } while (0) | |
95 | |
96 /* The glibc _mcount stub will save $v0 for us. Don't mess with saving | |
97 it, since ASM_OUTPUT_REG_PUSH/ASM_OUTPUT_REG_POP do not work in the | |
98 presence of $gp-relative calls. */ | |
99 #undef ASM_OUTPUT_REG_PUSH | |
100 #undef ASM_OUTPUT_REG_POP | |
101 | |
102 #undef LIB_SPEC | |
103 #define LIB_SPEC "\ | |
104 %{pthread:-lpthread} \ | |
105 %{shared:-lc} \ | |
106 %{!shared: \ | |
107 %{profile:-lc_p} %{!profile:-lc}}" | |
108 | |
109 #define MD_UNWIND_SUPPORT "config/mips/linux-unwind.h" | |
110 | |
111 #ifdef HAVE_AS_NO_SHARED | |
112 /* Default to -mno-shared for non-PIC. */ | |
113 # define NO_SHARED_SPECS \ | |
114 "%{mshared|mno-shared|fpic|fPIC|fpie|fPIE:;:-mno-shared}" | |
115 #else | |
116 # define NO_SHARED_SPECS "" | |
117 #endif | |
118 | |
119 /* -march=native handling only makes sense with compiler running on | |
120 a MIPS chip. */ | |
121 #if defined(__mips__) | |
122 extern const char *host_detect_local_cpu (int argc, const char **argv); | |
123 # define EXTRA_SPEC_FUNCTIONS \ | |
124 { "local_cpu_detect", host_detect_local_cpu }, | |
125 | |
126 # define MARCH_MTUNE_NATIVE_SPECS \ | |
127 " %{march=native:%<march=native %:local_cpu_detect(arch)}" \ | |
128 " %{mtune=native:%<mtune=native %:local_cpu_detect(tune)}" | |
129 #else | |
130 # define MARCH_MTUNE_NATIVE_SPECS "" | |
131 #endif | |
132 | |
133 #define LINUX_DRIVER_SELF_SPECS \ | |
134 NO_SHARED_SPECS \ | |
135 MARCH_MTUNE_NATIVE_SPECS, \ | |
136 /* -mplt has no effect without -mno-shared. Simplify later \ | |
137 specs handling by removing a redundant option. */ \ | |
138 "%{!mno-shared:%<mplt}", \ | |
139 /* -mplt likewise has no effect for -mabi=64 without -msym32. */ \ | |
140 "%{mabi=64:%{!msym32:%<mplt}}" | |
141 | |
142 #undef DRIVER_SELF_SPECS | |
143 #define DRIVER_SELF_SPECS \ | |
144 BASE_DRIVER_SELF_SPECS, \ | |
145 LINUX_DRIVER_SELF_SPECS | |
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
|
146 |
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
|
147 /* Similar to standard Linux, but adding -ffast-math support. */ |
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
|
148 #undef ENDFILE_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
|
149 #define ENDFILE_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
|
150 "%{ffast-math|funsafe-math-optimizations:crtfastmath.o%s} \ |
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
|
151 %{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s" |