]>
Commit | Line | Data |
---|---|---|
275d0a7c | 1 | /* Definitions of target machine for GNU compiler, FreeBSD/arm version. |
f1717362 | 2 | Copyright (C) 2002-2016 Free Software Foundation, Inc. |
275d0a7c | 3 | Contributed by Wasabi Systems, Inc. |
4 | ||
5 | This file is part of GCC. | |
6 | ||
7 | GCC is free software; you can redistribute it and/or modify it | |
8 | under the terms of the GNU General Public License as published | |
9 | by the Free Software Foundation; either version 3, or (at your | |
10 | option) any later version. | |
11 | ||
12 | GCC is distributed in the hope that it will be useful, but WITHOUT | |
13 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY | |
14 | or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public | |
15 | License for more details. | |
16 | ||
17 | Under Section 7 of GPL version 3, you are granted additional | |
18 | permissions described in the GCC Runtime Library Exception, version | |
19 | 3.1, as published by the Free Software Foundation. | |
20 | ||
21 | You should have received a copy of the GNU General Public License | |
22 | along with GCC; see the file COPYING3. If not see | |
23 | <http://www.gnu.org/licenses/>. */ | |
24 | ||
25 | #undef SUBTARGET_CPP_SPEC | |
26 | #define SUBTARGET_CPP_SPEC FBSD_CPP_SPEC | |
27 | ||
28 | #undef SUBTARGET_EXTRA_SPECS | |
29 | #define SUBTARGET_EXTRA_SPECS \ | |
30 | { "subtarget_extra_asm_spec", SUBTARGET_EXTRA_ASM_SPEC }, \ | |
31 | { "subtarget_asm_float_spec", SUBTARGET_ASM_FLOAT_SPEC }, \ | |
32 | { "fbsd_dynamic_linker", FBSD_DYNAMIC_LINKER } | |
33 | ||
34 | #undef SUBTARGET_EXTRA_ASM_SPEC | |
35 | #define SUBTARGET_EXTRA_ASM_SPEC \ | |
36 | "%{mabi=apcs-gnu|mabi=atpcs:-meabi=gnu;:-meabi=5} " TARGET_FIX_V4BX_SPEC " \ | |
e9abca4f | 37 | %{" FPIE_OR_FPIC_SPEC ":-k}" |
275d0a7c | 38 | |
39 | #undef SUBTARGET_ASM_FLOAT_SPEC | |
40 | #ifdef TARGET_FREEBSD_ARM_HARD_FLOAT | |
41 | /* Default to full vfp if we build for arm*hf. */ | |
42 | #define SUBTARGET_ASM_FLOAT_SPEC "%{!mfpu=*:-mfpu=vfp}" | |
43 | #else | |
44 | #define SUBTARGET_ASM_FLOAT_SPEC "%{!mfpu=*:-mfpu=softvfp}" | |
45 | #endif | |
46 | ||
47 | #undef LINK_SPEC | |
48 | #define LINK_SPEC " \ | |
49 | %{p:%nconsider using `-pg' instead of `-p' with gprof (1) } \ | |
50 | %{v:-V} \ | |
51 | %{assert*} %{R*} %{rpath*} %{defsym*} \ | |
52 | %{shared:-Bshareable %{h*} %{soname*}} \ | |
53 | %{!shared: \ | |
54 | %{!static: \ | |
55 | %{rdynamic:-export-dynamic} \ | |
56 | %{!dynamic-linker:-dynamic-linker %(fbsd_dynamic_linker) }} \ | |
57 | %{static:-Bstatic}} \ | |
58 | %{!static:--hash-style=both --enable-new-dtags} \ | |
59 | %{symbolic:-Bsymbolic} \ | |
60 | -X %{mbig-endian:-EB} %{mlittle-endian:-EL}" | |
61 | ||
62 | /* TARGET_BIG_ENDIAN_DEFAULT is set in | |
63 | config.gcc for big endian configurations. */ | |
64 | #if TARGET_BIG_ENDIAN_DEFAULT | |
65 | #define TARGET_ENDIAN_DEFAULT MASK_BIG_END | |
66 | #define TARGET_ENDIAN_OPTION "mbig-endian" | |
67 | #define TARGET_LINKER_EMULATION "armelfb_fbsd" | |
68 | #else | |
69 | #define TARGET_ENDIAN_DEFAULT 0 | |
70 | #define TARGET_ENDIAN_OPTION "mlittle-endian" | |
71 | #define TARGET_LINKER_EMULATION "armelf_fbsd" | |
72 | #endif | |
73 | ||
74 | #undef SUBTARGET_EXTRA_LINK_SPEC | |
75 | #define SUBTARGET_EXTRA_LINK_SPEC " -m " TARGET_LINKER_EMULATION " -p" | |
76 | ||
77 | #undef TARGET_OS_CPP_BUILTINS | |
78 | #define TARGET_OS_CPP_BUILTINS() \ | |
79 | do \ | |
80 | { \ | |
81 | FBSD_TARGET_OS_CPP_BUILTINS (); \ | |
82 | TARGET_BPABI_CPP_BUILTINS (); \ | |
83 | } \ | |
84 | while (false) | |
85 | ||
86 | /* We default to a soft-float ABI so that binaries can run on all | |
87 | target hardware. */ | |
88 | #undef TARGET_DEFAULT_FLOAT_ABI | |
89 | #ifdef TARGET_FREEBSD_ARM_HARD_FLOAT | |
90 | #define TARGET_DEFAULT_FLOAT_ABI ARM_FLOAT_ABI_HARD | |
91 | #else | |
92 | #define TARGET_DEFAULT_FLOAT_ABI ARM_FLOAT_ABI_SOFT | |
93 | #endif | |
94 | ||
95 | #undef ARM_DEFAULT_ABI | |
96 | ||
97 | /* AACPS_LINUX has access to kernel atomic ops while we don't. | |
98 | But AACPS defaults to short_enums. */ | |
99 | #define ARM_DEFAULT_ABI ARM_ABI_AAPCS_LINUX | |
100 | ||
101 | #undef TARGET_DEFAULT | |
102 | #define TARGET_DEFAULT (MASK_INTERWORK | TARGET_ENDIAN_DEFAULT) | |
103 | ||
104 | /* We do not have any MULTILIB_OPTIONS specified, so there are no | |
105 | MULTILIB_DEFAULTS. */ | |
106 | #undef MULTILIB_DEFAULTS | |
107 | ||
108 | /* Use the AAPCS type for wchar_t, override the one from config/freebsd.h. */ | |
109 | #undef WCHAR_TYPE | |
110 | #define WCHAR_TYPE "unsigned int" | |
111 | ||
112 | #undef WCHAR_TYPE_SIZE | |
113 | #define WCHAR_TYPE_SIZE BITS_PER_WORD | |
114 | ||
115 | #if defined (TARGET_FREEBSD_ARMv6) | |
116 | #undef SUBTARGET_CPU_DEFAULT | |
117 | #define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm1176jzs | |
118 | #else | |
119 | #undef SUBTARGET_CPU_DEFAULT | |
120 | #define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm9 | |
121 | #endif | |
122 | ||
123 | #define SUBTARGET_OVERRIDE_OPTIONS \ | |
124 | do { \ | |
125 | if (unaligned_access) \ | |
126 | unaligned_access = 0; \ | |
127 | } while (0) | |
128 | ||
129 | #undef MAX_SYNC_LIBFUNC_SIZE | |
130 | #define MAX_SYNC_LIBFUNC_SIZE 4 /* UNITS_PER_WORD not defined yet. */ | |
131 | ||
132 | /* FreeBSD does its profiling differently to the Acorn compiler. We | |
133 | don't need a word following the mcount call; and to skip it | |
134 | requires either an assembly stub or use of fomit-frame-pointer when | |
135 | compiling the profiling functions. Since we break Acorn CC | |
136 | compatibility below a little more won't hurt. */ | |
137 | ||
138 | #undef ARM_FUNCTION_PROFILER | |
139 | #define ARM_FUNCTION_PROFILER(STREAM,LABELNO) \ | |
140 | { \ | |
141 | asm_fprintf (STREAM, "\tmov\t%Rip, %Rlr\n"); \ | |
142 | asm_fprintf (STREAM, "\tbl\t__mcount%s\n", \ | |
143 | (TARGET_ARM && NEED_PLT_RELOC) \ | |
144 | ? "(PLT)" : ""); \ | |
145 | } | |
146 | ||
147 | /* Clear the instruction cache from `BEG' to `END'. This makes a | |
148 | call to the ARM_SYNC_ICACHE architecture specific syscall. */ | |
149 | #define CLEAR_INSN_CACHE(BEG, END) \ | |
150 | do \ | |
151 | { \ | |
152 | extern int sysarch (int number, void *args); \ | |
153 | struct \ | |
154 | { \ | |
155 | unsigned int addr; \ | |
156 | int len; \ | |
157 | } s; \ | |
158 | s.addr = (unsigned int) (BEG); \ | |
159 | s.len = (END) - (BEG); \ | |
160 | (void) sysarch (0, &s); \ | |
161 | } \ | |
162 | while (0) | |
163 | ||
164 | /* This is how we tell the assembler that two symbols have the same value. */ | |
165 | #define ASM_OUTPUT_DEF(FILE, NAME1, NAME2) \ | |
166 | do \ | |
167 | { \ | |
168 | assemble_name (FILE, NAME1); \ | |
169 | fputs (" = ", FILE); \ | |
170 | assemble_name (FILE, NAME2); \ | |
171 | fputc ('\n', FILE); \ | |
172 | } \ | |
173 | while (0) | |
174 | ||
175 | /* Add .note.GNU-stack. */ | |
176 | #undef NEED_INDICATE_EXEC_STACK | |
177 | #define NEED_INDICATE_EXEC_STACK 1 | |
178 | ||
179 | #define ARM_TARGET2_DWARF_FORMAT (DW_EH_PE_pcrel | DW_EH_PE_indirect) | |
180 |