configure.in (arm-*-linux-gnueabi): Add to noconfigdirs target-libffi...
[gcc.git] / gcc / config / arm / linux-elf.h
1 /* Definitions for ARM running Linux-based GNU systems using ELF
2 Copyright (C) 1993, 1994, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
3 2005
4 Free Software Foundation, Inc.
5 Contributed by Philip Blundell <philb@gnu.org>
6
7 This file is part of GCC.
8
9 GCC is free software; you can redistribute it and/or modify it
10 under the terms of the GNU General Public License as published
11 by the Free Software Foundation; either version 2, or (at your
12 option) any later version.
13
14 GCC is distributed in the hope that it will be useful, but WITHOUT
15 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
16 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
17 License for more details.
18
19 You should have received a copy of the GNU General Public License
20 along with this program; see the file COPYING. If not, write to
21 the Free Software Foundation, 51 Franklin Street, Fifth Floor,
22 Boston, MA 02110-1301, USA. */
23
24 /* elfos.h should have already been included. Now just override
25 any conflicting definitions and add any extras. */
26
27 /* Run-time Target Specification. */
28 #undef TARGET_VERSION
29 #define TARGET_VERSION fputs (" (ARM GNU/Linux with ELF)", stderr);
30
31 /* Do not assume anything about header files. */
32 #define NO_IMPLICIT_EXTERN_C
33
34 #undef TARGET_DEFAULT_FLOAT_ABI
35 #define TARGET_DEFAULT_FLOAT_ABI ARM_FLOAT_ABI_HARD
36
37 #undef TARGET_DEFAULT
38 #define TARGET_DEFAULT (0)
39
40 #define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm6
41
42 #define SUBTARGET_EXTRA_LINK_SPEC " -m armelf_linux -p"
43
44 #undef MULTILIB_DEFAULTS
45 #define MULTILIB_DEFAULTS \
46 { "marm", "mlittle-endian", "mhard-float", "mno-thumb-interwork" }
47
48 /* The GNU C++ standard library requires that these macros be defined. */
49 #undef CPLUSPLUS_CPP_SPEC
50 #define CPLUSPLUS_CPP_SPEC "-D_GNU_SOURCE %(cpp)"
51
52 /* Now we define the strings used to build the spec file. */
53 #undef LIB_SPEC
54 #define LIB_SPEC \
55 "%{pthread:-lpthread} \
56 %{shared:-lc} \
57 %{!shared:%{profile:-lc_p}%{!profile:-lc}}"
58
59 #define LIBGCC_SPEC "%{msoft-float:-lfloat} %{mfloat-abi=soft*:-lfloat} -lgcc"
60
61 /* Provide a STARTFILE_SPEC appropriate for GNU/Linux. Here we add
62 the GNU/Linux magical crtbegin.o file (see crtstuff.c) which
63 provides part of the support for getting C++ file-scope static
64 object constructed before entering `main'. */
65
66 #undef STARTFILE_SPEC
67 #define STARTFILE_SPEC \
68 "%{!shared: \
69 %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} \
70 %{!p:%{profile:gcrt1.o%s} \
71 %{!profile:crt1.o%s}}}} \
72 crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
73
74 /* Provide a ENDFILE_SPEC appropriate for GNU/Linux. Here we tack on
75 the GNU/Linux magical crtend.o file (see crtstuff.c) which
76 provides part of the support for getting C++ file-scope static
77 object constructed before entering `main', followed by a normal
78 GNU/Linux "finalizer" file, `crtn.o'. */
79
80 #undef ENDFILE_SPEC
81 #define ENDFILE_SPEC \
82 "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s"
83
84 #define LINUX_TARGET_INTERPRETER "/lib/ld-linux.so.2"
85
86 #define LINUX_TARGET_LINK_SPEC "%{h*} %{version:-v} \
87 %{b} \
88 %{static:-Bstatic} \
89 %{shared:-shared} \
90 %{symbolic:-Bsymbolic} \
91 %{rdynamic:-export-dynamic} \
92 %{!dynamic-linker:-dynamic-linker " LINUX_TARGET_INTERPRETER "} \
93 -X \
94 %{mbig-endian:-EB}" \
95 SUBTARGET_EXTRA_LINK_SPEC
96
97 #undef LINK_SPEC
98 #define LINK_SPEC LINUX_TARGET_LINK_SPEC
99
100 #define TARGET_OS_CPP_BUILTINS() \
101 do \
102 { \
103 LINUX_TARGET_OS_CPP_BUILTINS(); \
104 if (flag_pic) \
105 { \
106 builtin_define ("__PIC__"); \
107 builtin_define ("__pic__"); \
108 } \
109 } \
110 while (0)
111
112 /* This is how we tell the assembler that two symbols have the same value. */
113 #define ASM_OUTPUT_DEF(FILE, NAME1, NAME2) \
114 do \
115 { \
116 assemble_name (FILE, NAME1); \
117 fputs (" = ", FILE); \
118 assemble_name (FILE, NAME2); \
119 fputc ('\n', FILE); \
120 } \
121 while (0)
122
123 /* NWFPE always understands FPA instructions. */
124 #undef FPUTYPE_DEFAULT
125 #define FPUTYPE_DEFAULT FPUTYPE_FPA_EMU3
126
127 /* Call the function profiler with a given profile label. */
128 #undef ARM_FUNCTION_PROFILER
129 #define ARM_FUNCTION_PROFILER(STREAM, LABELNO) \
130 { \
131 fprintf (STREAM, "\tbl\tmcount%s\n", \
132 (TARGET_ARM && NEED_PLT_RELOC) ? "(PLT)" : ""); \
133 }
134
135 /* The GNU/Linux profiler clobbers the link register. Make sure the
136 prologue knows to save it. */
137 #define PROFILE_HOOK(X) \
138 emit_insn (gen_rtx_CLOBBER (VOIDmode, gen_rtx_REG (SImode, LR_REGNUM)))
139
140 /* The GNU/Linux profiler needs a frame pointer. */
141 #define SUBTARGET_FRAME_POINTER_REQUIRED current_function_profile
142
143 #undef CC1_SPEC
144 #define CC1_SPEC "%{profile:-p}"
145
146 #define LINK_GCC_C_SEQUENCE_SPEC \
147 "%{static:--start-group} %G %L %{static:--end-group}%{!static:%G}"
148
149 /* Use --as-needed -lgcc_s for eh support. */
150 #ifdef HAVE_LD_AS_NEEDED
151 #define USE_LD_AS_NEEDED 1
152 #endif