]>
Commit | Line | Data |
---|---|---|
077fc835 | 1 | /* Configuration file for ARM GNU/Linux EABI targets. |
aeee4812 | 2 | Copyright (C) 2004-2023 Free Software Foundation, Inc. |
077fc835 KH |
3 | Contributed by CodeSourcery, LLC |
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 | |
2f83c7d6 | 9 | by the Free Software Foundation; either version 3, or (at your |
077fc835 KH |
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 | You should have received a copy of the GNU General Public License | |
2f83c7d6 NC |
18 | along with GCC; see the file COPYING3. If not see |
19 | <http://www.gnu.org/licenses/>. */ | |
077fc835 KH |
20 | |
21 | /* On EABI GNU/Linux, we want both the BPABI builtins and the | |
22 | GNU/Linux builtins. */ | |
d3a9662c | 23 | #undef TARGET_OS_CPP_BUILTINS |
077fc835 KH |
24 | #define TARGET_OS_CPP_BUILTINS() \ |
25 | do \ | |
26 | { \ | |
27 | TARGET_BPABI_CPP_BUILTINS(); \ | |
107fd1c1 | 28 | GNU_USER_TARGET_OS_CPP_BUILTINS(); \ |
2c8f43e6 | 29 | ANDROID_TARGET_OS_CPP_BUILTINS(); \ |
077fc835 KH |
30 | } \ |
31 | while (false) | |
32 | ||
33 | /* We default to a soft-float ABI so that binaries can run on all | |
6302b84b RE |
34 | target hardware. If you override this to use the hard-float ABI then |
35 | change the setting of GLIBC_DYNAMIC_LINKER_DEFAULT as well. */ | |
d3a9662c | 36 | #undef TARGET_DEFAULT_FLOAT_ABI |
077fc835 KH |
37 | #define TARGET_DEFAULT_FLOAT_ABI ARM_FLOAT_ABI_SOFT |
38 | ||
39 | /* We default to the "aapcs-linux" ABI so that enums are int-sized by | |
40 | default. */ | |
d3a9662c | 41 | #undef ARM_DEFAULT_ABI |
077fc835 KH |
42 | #define ARM_DEFAULT_ABI ARM_ABI_AAPCS_LINUX |
43 | ||
d3a9662c BF |
44 | /* TARGET_BIG_ENDIAN_DEFAULT is set in |
45 | config.gcc for big endian configurations. */ | |
46 | #undef TARGET_LINKER_EMULATION | |
47 | #if TARGET_BIG_ENDIAN_DEFAULT | |
48 | #define TARGET_LINKER_EMULATION "armelfb_linux_eabi" | |
49 | #else | |
50 | #define TARGET_LINKER_EMULATION "armelf_linux_eabi" | |
51 | #endif | |
52 | ||
53 | #undef SUBTARGET_EXTRA_LINK_SPEC | |
54 | #define SUBTARGET_EXTRA_LINK_SPEC " -m " TARGET_LINKER_EMULATION | |
077fc835 | 55 | |
6302b84b RE |
56 | /* GNU/Linux on ARM currently supports three dynamic linkers: |
57 | - ld-linux.so.2 - for the legacy ABI | |
58 | - ld-linux.so.3 - for the EABI-derived soft-float ABI | |
59 | - ld-linux-armhf.so.3 - for the EABI-derived hard-float ABI. | |
60 | All the dynamic linkers live in /lib. | |
61 | We default to soft-float, but this can be overridden by changing both | |
62 | GLIBC_DYNAMIC_LINKER_DEFAULT and TARGET_DEFAULT_FLOAT_ABI. */ | |
63 | ||
d3a9662c | 64 | #undef GLIBC_DYNAMIC_LINKER |
c7121189 MH |
65 | #define GLIBC_DYNAMIC_LINKER_SOFT_FLOAT "/lib/ld-linux.so.3" |
66 | #define GLIBC_DYNAMIC_LINKER_HARD_FLOAT "/lib/ld-linux-armhf.so.3" | |
c7121189 | 67 | #define GLIBC_DYNAMIC_LINKER_DEFAULT GLIBC_DYNAMIC_LINKER_SOFT_FLOAT |
6302b84b | 68 | |
c7121189 MH |
69 | #define GLIBC_DYNAMIC_LINKER \ |
70 | "%{mfloat-abi=hard:" GLIBC_DYNAMIC_LINKER_HARD_FLOAT "} \ | |
71 | %{mfloat-abi=soft*:" GLIBC_DYNAMIC_LINKER_SOFT_FLOAT "} \ | |
72 | %{!mfloat-abi=*:" GLIBC_DYNAMIC_LINKER_DEFAULT "}" | |
077fc835 | 73 | |
4d45be53 GR |
74 | /* For ARM musl currently supports four dynamic linkers: |
75 | - ld-musl-arm.so.1 - for the EABI-derived soft-float ABI | |
76 | - ld-musl-armhf.so.1 - for the EABI-derived hard-float ABI | |
77 | - ld-musl-armeb.so.1 - for the EABI-derived soft-float ABI, EB | |
78 | - ld-musl-armebhf.so.1 - for the EABI-derived hard-float ABI, EB | |
79 | musl does not support the legacy OABI mode. | |
80 | All the dynamic linkers live in /lib. | |
81 | We default to soft-float, EL. */ | |
82 | #undef MUSL_DYNAMIC_LINKER | |
83 | #if TARGET_BIG_ENDIAN_DEFAULT | |
84 | #define MUSL_DYNAMIC_LINKER_E "%{mlittle-endian:;:eb}" | |
85 | #else | |
86 | #define MUSL_DYNAMIC_LINKER_E "%{mbig-endian:eb}" | |
87 | #endif | |
88 | #define MUSL_DYNAMIC_LINKER \ | |
45d53c67 | 89 | "/lib/ld-musl-arm" MUSL_DYNAMIC_LINKER_E "%{mfloat-abi=hard:hf}%{mfdpic:-fdpic}.so.1" |
4d45be53 | 90 | |
077fc835 KH |
91 | /* At this point, bpabi.h will have clobbered LINK_SPEC. We want to |
92 | use the GNU/Linux version, not the generic BPABI version. */ | |
d3a9662c | 93 | #undef LINK_SPEC |
37953bd3 | 94 | #define LINK_SPEC EABI_LINK_SPEC \ |
51b9db92 MK |
95 | LINUX_OR_ANDROID_LD (LINUX_TARGET_LINK_SPEC, \ |
96 | LINUX_TARGET_LINK_SPEC " " ANDROID_LINK_SPEC) | |
97 | ||
8a5800b8 | 98 | #undef ASAN_CC1_SPEC |
de5a5fa1 | 99 | #define ASAN_CC1_SPEC "%{%:sanitize(address):-funwind-tables}" |
8a5800b8 | 100 | |
45d53c67 CL |
101 | #define FDPIC_CC1_SPEC "" |
102 | ||
51b9db92 | 103 | #undef CC1_SPEC |
8e38461c | 104 | #define CC1_SPEC \ |
45d53c67 CL |
105 | LINUX_OR_ANDROID_CC (GNU_USER_TARGET_CC1_SPEC " " ASAN_CC1_SPEC " " \ |
106 | FDPIC_CC1_SPEC, \ | |
8a5800b8 CL |
107 | GNU_USER_TARGET_CC1_SPEC " " ASAN_CC1_SPEC " " \ |
108 | ANDROID_CC1_SPEC) | |
51b9db92 MK |
109 | |
110 | #define CC1PLUS_SPEC \ | |
111 | LINUX_OR_ANDROID_CC ("", ANDROID_CC1PLUS_SPEC) | |
112 | ||
113 | #undef LIB_SPEC | |
8e38461c JM |
114 | #define LIB_SPEC \ |
115 | LINUX_OR_ANDROID_LD (GNU_USER_TARGET_LIB_SPEC, \ | |
8edb8dc8 | 116 | GNU_USER_TARGET_NO_PTHREADS_LIB_SPEC " " ANDROID_LIB_SPEC) |
51b9db92 MK |
117 | |
118 | #undef STARTFILE_SPEC | |
119 | #define STARTFILE_SPEC \ | |
8e38461c | 120 | LINUX_OR_ANDROID_LD (GNU_USER_TARGET_STARTFILE_SPEC, ANDROID_STARTFILE_SPEC) |
51b9db92 MK |
121 | |
122 | #undef ENDFILE_SPEC | |
123 | #define ENDFILE_SPEC \ | |
5a0ff57c | 124 | "%{Ofast|ffast-math|funsafe-math-optimizations:crtfastmath.o%s} " \ |
8e38461c | 125 | LINUX_OR_ANDROID_LD (GNU_USER_TARGET_ENDFILE_SPEC, ANDROID_ENDFILE_SPEC) |
077fc835 KH |
126 | |
127 | /* Use the default LIBGCC_SPEC, not the version in linux-elf.h, as we | |
128 | do not use -lfloat. */ | |
129 | #undef LIBGCC_SPEC | |
130 | ||
8a66e987 | 131 | /* Clear the instruction cache from `beg' to `end'. This is |
45b86625 | 132 | implemented in lib1funcs.S, so ensure an error if this definition |
8a66e987 | 133 | is used. */ |
d3a9662c | 134 | #undef CLEAR_INSN_CACHE |
7cea01df | 135 | #define CLEAR_INSN_CACHE(BEG, END) not_used |
1e874273 PB |
136 | |
137 | #define ARM_TARGET2_DWARF_FORMAT (DW_EH_PE_pcrel | DW_EH_PE_indirect) |