UUID stuff from Ryan Raasch
[cegcc.git] / cegcc / src / gcc-4.3.2 / gcc / config / mips / linux.h
blob4ee046a595489980c35469d52eadcf56a4442df9
1 /* Definitions for MIPS running Linux-based GNU systems with ELF format.
2 Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
3 2007 Free Software Foundation, Inc.
5 This file is part of GCC.
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.
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.
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/>. */
21 #undef WCHAR_TYPE
22 #define WCHAR_TYPE "int"
24 #undef WCHAR_TYPE_SIZE
25 #define WCHAR_TYPE_SIZE 32
27 #undef ASM_DECLARE_OBJECT_NAME
28 #define ASM_DECLARE_OBJECT_NAME mips_declare_object_name
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
37 #undef MD_EXEC_PREFIX
38 #undef MD_STARTFILE_PREFIX
40 /* If we don't set MASK_ABICALLS, we can't default to PIC. */
41 #undef TARGET_DEFAULT
42 #define TARGET_DEFAULT MASK_ABICALLS
44 #define TARGET_OS_CPP_BUILTINS() \
45 do { \
46 LINUX_TARGET_OS_CPP_BUILTINS(); \
47 /* The GNU C++ standard library requires this. */ \
48 if (c_dialect_cxx ()) \
49 builtin_define ("_GNU_SOURCE"); \
50 } while (0)
52 #undef SUBTARGET_CPP_SPEC
53 #define SUBTARGET_CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}"
55 /* A standard GNU/Linux mapping. On most targets, it is included in
56 CC1_SPEC itself by config/linux.h, but mips.h overrides CC1_SPEC
57 and provides this hook instead. */
58 #undef SUBTARGET_CC1_SPEC
59 #define SUBTARGET_CC1_SPEC "%{profile:-p}"
61 /* From iris5.h */
62 /* -G is incompatible with -KPIC which is the default, so only allow objects
63 in the small data section if the user explicitly asks for it. */
64 #undef MIPS_DEFAULT_GVALUE
65 #define MIPS_DEFAULT_GVALUE 0
67 #define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
69 /* Borrowed from sparc/linux.h */
70 #undef LINK_SPEC
71 #define LINK_SPEC \
72 "%(endian_spec) \
73 %{shared:-shared} \
74 %{!shared: \
75 %{!ibcs: \
76 %{!static: \
77 %{rdynamic:-export-dynamic} \
78 %{!dynamic-linker:-dynamic-linker " LINUX_DYNAMIC_LINKER "}} \
79 %{static:-static}}}"
81 #undef SUBTARGET_ASM_SPEC
82 #define SUBTARGET_ASM_SPEC "%{mabi=64: -64} %{!mno-abicalls:-KPIC}"
84 /* The MIPS assembler has different syntax for .set. We set it to
85 .dummy to trap any errors. */
86 #undef SET_ASM_OP
87 #define SET_ASM_OP "\t.dummy\t"
89 #undef ASM_OUTPUT_DEF
90 #define ASM_OUTPUT_DEF(FILE,LABEL1,LABEL2) \
91 do { \
92 fputc ( '\t', FILE); \
93 assemble_name (FILE, LABEL1); \
94 fputs ( " = ", FILE); \
95 assemble_name (FILE, LABEL2); \
96 fputc ( '\n', FILE); \
97 } while (0)
99 #undef ASM_DECLARE_FUNCTION_NAME
100 #define ASM_DECLARE_FUNCTION_NAME(STREAM, NAME, DECL) \
101 do { \
102 if (!flag_inhibit_size_directive) \
104 fputs ("\t.ent\t", STREAM); \
105 assemble_name (STREAM, NAME); \
106 putc ('\n', STREAM); \
108 ASM_OUTPUT_TYPE_DIRECTIVE (STREAM, NAME, "function"); \
109 assemble_name (STREAM, NAME); \
110 fputs (":\n", STREAM); \
111 } while (0)
113 #undef ASM_DECLARE_FUNCTION_SIZE
114 #define ASM_DECLARE_FUNCTION_SIZE(STREAM, NAME, DECL) \
115 do { \
116 if (!flag_inhibit_size_directive) \
118 fputs ("\t.end\t", STREAM); \
119 assemble_name (STREAM, NAME); \
120 putc ('\n', STREAM); \
122 } while (0)
124 /* Tell function_prologue in mips.c that we have already output the .ent/.end
125 pseudo-ops. */
126 #undef FUNCTION_NAME_ALREADY_DECLARED
127 #define FUNCTION_NAME_ALREADY_DECLARED 1
129 /* The glibc _mcount stub will save $v0 for us. Don't mess with saving
130 it, since ASM_OUTPUT_REG_PUSH/ASM_OUTPUT_REG_POP do not work in the
131 presence of $gp-relative calls. */
132 #undef ASM_OUTPUT_REG_PUSH
133 #undef ASM_OUTPUT_REG_POP
135 #undef LIB_SPEC
136 #define LIB_SPEC "\
137 %{pthread:-lpthread} \
138 %{shared:-lc} \
139 %{!shared: \
140 %{profile:-lc_p} %{!profile:-lc}}"
142 #define MD_UNWIND_SUPPORT "config/mips/linux-unwind.h"
144 #ifdef HAVE_AS_NO_SHARED
145 /* Default to -mno-shared for non-PIC. */
146 #define NO_SHARED_SPECS \
147 "%{mshared|mno-shared|fpic|fPIC|fpie|fPIE:;:-mno-shared}"
148 #define DRIVER_SELF_SPECS NO_SHARED_SPECS
149 #else
150 #define NO_SHARED_SPECS
151 #endif