linux.h: Remove undefines which disabled .ctor/.dtor support.
[official-gcc.git] / gcc / config / mips / linux.h
blob45e5e446f68efec92a10df658aedc2bf30bec86f
1 /* Definitions for MIPS running Linux-based GNU systems with ELF format.
2 Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
4 This file is part of GNU CC.
6 GNU CC is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
9 any later version.
11 GNU CC is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with GNU CC; see the file COPYING. If not, write to
18 the Free Software Foundation, 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. */
21 #undef TARGET_VERSION
22 #if TARGET_ENDIAN_DEFAULT == 0
23 #define TARGET_VERSION fprintf (stderr, " (MIPSel GNU/ELF)");
24 #else
25 #define TARGET_VERSION fprintf (stderr, " (MIPS GNU/ELF)");
26 #endif
28 #undef MD_EXEC_PREFIX
29 #undef MD_STARTFILE_PREFIX
31 /* Output at beginning of assembler file. */
32 /* The .file command should always begin the output. */
33 #undef ASM_FILE_START
34 #define ASM_FILE_START(FILE) \
35 do { \
36 mips_asm_file_start (FILE); \
37 fprintf (FILE, "\t.version\t\"01.01\"\n"); \
38 } while (0)
41 /* Required to keep collect2.c happy */
42 #undef OBJECT_FORMAT_COFF
44 /* If we don't set MASK_ABICALLS, we can't default to PIC. */
45 #undef TARGET_DEFAULT
46 #define TARGET_DEFAULT (MASK_ABICALLS|MASK_GAS)
49 /* Handle #pragma weak and #pragma pack. */
50 #define HANDLE_SYSV_PRAGMA 1
52 /* Use more efficient ``thunks'' to implement C++ vtables. */
53 #undef DEFAULT_VTABLE_THUNKS
54 #define DEFAULT_VTABLE_THUNKS 1
56 /* Don't assume anything about the header files. */
57 #define NO_IMPLICIT_EXTERN_C
59 /* Generate calls to memcpy, etc., not bcopy, etc. */
60 #define TARGET_MEM_FUNCTIONS
62 /* Specify predefined symbols in preprocessor. */
63 #undef CPP_PREDEFINES
64 #if TARGET_ENDIAN_DEFAULT == 0
65 #define CPP_PREDEFINES "-DMIPSEL -D_MIPSEL -Dunix -Dmips -D_mips \
66 -DR3000 -D_R3000 -Dlinux -Asystem(posix) -Acpu(mips) \
67 -Amachine(mips) -D__ELF__ -D__PIC__ -D__pic__"
68 #else
69 #define CPP_PREDEFINES "-DMIPSEB -D_MIPSEB -Dunix -Dmips -D_mips \
70 -DR3000 -D_R3000 -Dlinux -Asystem(posix) -Acpu(mips) \
71 -Amachine(mips) -D__ELF__ -D__PIC__ -D__pic__"
72 #endif
74 #undef SUBTARGET_CPP_SIZE_SPEC
75 #define SUBTARGET_CPP_SIZE_SPEC "\
76 %{mabi=32: -D__SIZE_TYPE__=unsigned\\ int -D__PTRDIFF_TYPE__=int} \
77 %{mabi=n32: -D__SIZE_TYPE__=unsigned\\ int -D__PTRDIFF_TYPE__=int} \
78 %{mabi=64: -D__SIZE_TYPE__=long\\ unsigned\\ int -D__PTRDIFF_TYPE__=long\\ int} \
79 %{!mabi*: -D__SIZE_TYPE__=unsigned\\ int -D__PTRDIFF_TYPE__=int}"
81 /* We must make -mips3 do what -mlong64 used to do. */
82 /* ??? If no mipsX option given, but a mabi=X option is, then should set
83 _MIPS_ISA based on the mabi=X option. */
84 /* ??? If no mabi=X option give, but a mipsX option is, then should set
85 _MIPS_SIM based on the mipsX option. */
86 /* ??? Same for _MIPS_SZINT. */
87 /* ??? Same for _MIPS_SZPTR. */
88 /* ??? Same for __SIZE_TYPE and __PTRDIFF_TYPE. */
89 #undef SUBTARGET_CPP_SPEC
90 #define SUBTARGET_CPP_SPEC "\
91 %{mfp32: -D_MIPS_FPSET=16} \
92 %{mfp64: -D_MIPS_FPSET=32} \
93 %{!mfp*: -D_MIPS_FPSET=32} \
94 %{mips1: -D_MIPS_ISA=_MIPS_ISA_MIPS1} \
95 %{mips2: -D_MIPS_ISA=_MIPS_ISA_MIPS2} \
96 %{mips3: -D_MIPS_ISA=_MIPS_ISA_MIPS3} \
97 %{mips4: -D_MIPS_ISA=_MIPS_ISA_MIPS4} \
98 %{!mips*: -D_MIPS_ISA=_MIPS_ISA_MIPS3} \
99 %{mabi=32: -D_MIPS_SIM=_MIPS_SIM_ABI32} \
100 %{mabi=n32: -D_ABIN32=2 -D_MIPS_SIM=_ABIN32} \
101 %{mabi=64: -D_ABI64=3 -D_MIPS_SIM=_ABI64} \
102 %{!mabi*: -D_ABIN32=2 -D_MIPS_SIM=_ABIN32} \
103 %{!mint64: -D_MIPS_SZINT=32}%{mint64: -D_MIPS_SZINT=64} \
104 %{mabi=32: -D_MIPS_SZLONG=32} \
105 %{mabi=n32: -D_MIPS_SZLONG=32} \
106 %{mabi=64: -D_MIPS_SZLONG=64} \
107 %{!mabi*: -D_MIPS_SZLONG=32} \
108 %{mabi=32: -D_MIPS_SZPTR=32} \
109 %{mabi=n32: -D_MIPS_SZPTR=32} \
110 %{mabi=64: -D_MIPS_SZPTR=64} \
111 %{!mabi*: -D_MIPS_SZPTR=32} \
112 %{!mips*: -U__mips -D__mips} \
113 %{mabi=32: -U__mips64} \
114 %{mabi=n32: -D__mips64} \
115 %{mabi=64: -U__mips64} \
116 %{!mabi*: -U__mips64} \
117 %{fno-PIC:-U__PIC__ -U__pic__} %{fno-pic:-U__PIC__ -U__pic__} \
118 %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} \
119 %{pthread:-D_REENTRANT}"
121 /* Provide a STARTFILE_SPEC appropriate for GNU/Linux. Here we add
122 the GNU/Linux magical crtbegin.o file (see crtstuff.c) which
123 provides part of the support for getting C++ file-scope static
124 object constructed before entering `main'. */
126 #undef STARTFILE_SPEC
127 #define STARTFILE_SPEC \
128 "%{!shared: \
129 %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} %{!p:crt1.o%s}}}\
130 crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
132 /* Provide a ENDFILE_SPEC appropriate for GNU/Linux. Here we tack on
133 the GNU/Linux magical crtend.o file (see crtstuff.c) which
134 provides part of the support for getting C++ file-scope static
135 object constructed before entering `main', followed by a normal
136 GNU/Linux "finalizer" file, `crtn.o'. */
138 #undef ENDFILE_SPEC
139 #define ENDFILE_SPEC \
140 "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s"
142 /* From iris5.h */
143 /* -G is incompatible with -KPIC which is the default, so only allow objects
144 in the small data section if the user explicitly asks for it. */
145 #undef MIPS_DEFAULT_GVALUE
146 #define MIPS_DEFAULT_GVALUE 0
148 #undef LIB_SPEC
149 /* Taken from sparc/linux.h. */
150 #define LIB_SPEC \
151 "%{shared: -lc} \
152 %{!shared: %{mieee-fp:-lieee} %{pthread:-lpthread} \
153 %{profile:-lc_p} %{!profile: -lc}}"
155 /* Borrowed from sparc/linux.h */
156 #undef LINK_SPEC
157 #define LINK_SPEC "%{shared:-shared} \
158 %{!shared: \
159 %{!ibcs: \
160 %{!static: \
161 %{rdynamic:-export-dynamic} \
162 %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}} \
163 %{static:-static}}}"
166 #undef SUBTARGET_ASM_SPEC
167 #define SUBTARGET_ASM_SPEC "\
168 %{mabi=64: -64} \
169 %{!fno-PIC:%{!fno-pic:-KPIC}} \
170 %{fno-PIC:-non_shared} %{fno-pic:-non_shared}"