|
1 | 1 | /* Detect platform triplet from builtin defines
|
2 |
| - * cc -E Misc/platform_triplet.c | grep -v '^#' | grep -v '^ *$' | grep -v '^typedef' | tr -d ' ' |
| 2 | + * cc -E Misc/platform_triplet.c | grep '^PLATFORM_TRIPLET=' | tr -d ' ' |
3 | 3 | */
|
4 | 4 | #undef bfin
|
5 | 5 | #undef cris
|
|
72 | 72 | # define LIBC_PPC gnu
|
73 | 73 | # endif
|
74 | 74 | # else
|
75 |
| -/* Heuristic to detect musl libc |
76 |
| - * Adds "typedef __builtin_va_list va_list;" to output |
77 |
| - */ |
| 75 | +// Heuristic to detect musl libc |
78 | 76 | # include <stdarg.h>
|
79 | 77 | # ifdef __DEFINED_va_list
|
80 | 78 | # define LIBC musl
|
|
129 | 127 | # endif
|
130 | 128 |
|
131 | 129 | # if defined(__x86_64__) && defined(__LP64__)
|
132 |
| - x86_64-linux-LIBC |
| 130 | +PLATFORM_TRIPLET=x86_64-linux-LIBC |
133 | 131 | # elif defined(__x86_64__) && defined(__ILP32__)
|
134 |
| - x86_64-linux-LIBC_X32 |
| 132 | +PLATFORM_TRIPLET=x86_64-linux-LIBC_X32 |
135 | 133 | # elif defined(__i386__)
|
136 |
| - i386-linux-LIBC |
| 134 | +PLATFORM_TRIPLET=i386-linux-LIBC |
137 | 135 | # elif defined(__aarch64__) && defined(__AARCH64EL__)
|
138 | 136 | # if defined(__ILP32__)
|
139 |
| - aarch64_ilp32-linux-LIBC |
| 137 | +PLATFORM_TRIPLET=aarch64_ilp32-linux-LIBC |
140 | 138 | # else
|
141 |
| - aarch64-linux-LIBC |
| 139 | +PLATFORM_TRIPLET=aarch64-linux-LIBC |
142 | 140 | # endif
|
143 | 141 | # elif defined(__aarch64__) && defined(__AARCH64EB__)
|
144 | 142 | # if defined(__ILP32__)
|
145 |
| - aarch64_be_ilp32-linux-LIBC |
| 143 | +PLATFORM_TRIPLET=aarch64_be_ilp32-linux-LIBC |
146 | 144 | # else
|
147 |
| - aarch64_be-linux-LIBC |
| 145 | +PLATFORM_TRIPLET=aarch64_be-linux-LIBC |
148 | 146 | # endif
|
149 | 147 | # elif defined(__alpha__)
|
150 |
| - alpha-linux-LIBC |
| 148 | +PLATFORM_TRIPLET=alpha-linux-LIBC |
151 | 149 | # elif defined(__ARM_EABI__)
|
152 | 150 | # if defined(__ARMEL__)
|
153 |
| - arm-linux-LIBC_ARM |
| 151 | +PLATFORM_TRIPLET=arm-linux-LIBC_ARM |
154 | 152 | # else
|
155 |
| - armeb-linux-LIBC_ARM |
| 153 | +PLATFORM_TRIPLET=armeb-linux-LIBC_ARM |
156 | 154 | # endif
|
157 | 155 | # elif defined(__hppa__)
|
158 |
| - hppa-linux-LIBC |
| 156 | +PLATFORM_TRIPLET=hppa-linux-LIBC |
159 | 157 | # elif defined(__ia64__)
|
160 |
| - ia64-linux-LIBC |
| 158 | +PLATFORM_TRIPLET=ia64-linux-LIBC |
161 | 159 | # elif defined(__loongarch__) && defined(__loongarch_lp64)
|
162 |
| - loongarch64-linux-LIBC_LA |
| 160 | +PLATFORM_TRIPLET=loongarch64-linux-LIBC_LA |
163 | 161 | # elif defined(__m68k__) && !defined(__mcoldfire__)
|
164 |
| - m68k-linux-LIBC |
| 162 | +PLATFORM_TRIPLET=m68k-linux-LIBC |
165 | 163 | # elif defined(__mips__)
|
166 | 164 | # if defined(__mips_isa_rev) && (__mips_isa_rev >=6)
|
167 | 165 | # if defined(_MIPSEL) && defined(__mips64)
|
168 |
| - mipsisa64r6el-linux-LIBC_MIPS |
| 166 | +PLATFORM_TRIPLET=mipsisa64r6el-linux-LIBC_MIPS |
169 | 167 | # elif defined(_MIPSEL)
|
170 |
| - mipsisa32r6el-linux-LIBC_MIPS |
| 168 | +PLATFORM_TRIPLET=mipsisa32r6el-linux-LIBC_MIPS |
171 | 169 | # elif defined(__mips64)
|
172 |
| - mipsisa64r6-linux-LIBC_MIPS |
| 170 | +PLATFORM_TRIPLET=mipsisa64r6-linux-LIBC_MIPS |
173 | 171 | # else
|
174 |
| - mipsisa32r6-linux-LIBC_MIPS |
| 172 | +PLATFORM_TRIPLET=mipsisa32r6-linux-LIBC_MIPS |
175 | 173 | # endif
|
176 | 174 | # else
|
177 | 175 | # if defined(_MIPSEL) && defined(__mips64)
|
178 |
| - mips64el-linux-LIBC_MIPS |
| 176 | +PLATFORM_TRIPLET=mips64el-linux-LIBC_MIPS |
179 | 177 | # elif defined(_MIPSEL)
|
180 |
| - mipsel-linux-LIBC_MIPS |
| 178 | +PLATFORM_TRIPLET=mipsel-linux-LIBC_MIPS |
181 | 179 | # elif defined(__mips64)
|
182 |
| - mips64-linux-LIBC_MIPS |
| 180 | +PLATFORM_TRIPLET=mips64-linux-LIBC_MIPS |
183 | 181 | # else
|
184 |
| - mips-linux-LIBC_MIPS |
| 182 | +PLATFORM_TRIPLET=mips-linux-LIBC_MIPS |
185 | 183 | # endif
|
186 | 184 | # endif
|
187 | 185 | # elif defined(__or1k__)
|
188 |
| - or1k-linux-LIBC |
| 186 | +PLATFORM_TRIPLET=or1k-linux-LIBC |
189 | 187 | # elif defined(__powerpc__)
|
190 |
| - powerpc-linux-LIBC_PPC |
| 188 | +PLATFORM_TRIPLET=powerpc-linux-LIBC_PPC |
191 | 189 | # elif defined(__powerpc64__)
|
192 | 190 | # if defined(__LITTLE_ENDIAN__)
|
193 |
| - powerpc64le-linux-LIBC |
| 191 | +PLATFORM_TRIPLET=powerpc64le-linux-LIBC |
194 | 192 | # else
|
195 |
| - powerpc64-linux-LIBC |
| 193 | +PLATFORM_TRIPLET=powerpc64-linux-LIBC |
196 | 194 | # endif
|
197 | 195 | # elif defined(__s390x__)
|
198 |
| - s390x-linux-LIBC |
| 196 | +PLATFORM_TRIPLET=s390x-linux-LIBC |
199 | 197 | # elif defined(__s390__)
|
200 |
| - s390-linux-LIBC |
| 198 | +PLATFORM_TRIPLET=s390-linux-LIBC |
201 | 199 | # elif defined(__sh__) && defined(__LITTLE_ENDIAN__)
|
202 |
| - sh4-linux-LIBC |
| 200 | +PLATFORM_TRIPLET=sh4-linux-LIBC |
203 | 201 | # elif defined(__sparc__) && defined(__arch64__)
|
204 |
| - sparc64-linux-LIBC |
| 202 | +PLATFORM_TRIPLET=sparc64-linux-LIBC |
205 | 203 | # elif defined(__sparc__)
|
206 |
| - sparc-linux-LIBC |
| 204 | +PLATFORM_TRIPLET=sparc-linux-LIBC |
207 | 205 | # elif defined(__riscv)
|
208 | 206 | # if __riscv_xlen == 32
|
209 |
| - riscv32-linux-LIBC |
| 207 | +PLATFORM_TRIPLET=riscv32-linux-LIBC |
210 | 208 | # elif __riscv_xlen == 64
|
211 |
| - riscv64-linux-LIBC |
| 209 | +PLATFORM_TRIPLET=riscv64-linux-LIBC |
212 | 210 | # else
|
213 | 211 | # error unknown platform triplet
|
214 | 212 | # endif
|
|
220 | 218 | */
|
221 | 219 | #elif defined(__FreeBSD_kernel__)
|
222 | 220 | # if defined(__LP64__)
|
223 |
| - x86_64-kfreebsd-gnu |
| 221 | +PLATFORM_TRIPLET=x86_64-kfreebsd-gnu |
224 | 222 | # elif defined(__i386__)
|
225 |
| - i386-kfreebsd-gnu |
| 223 | +PLATFORM_TRIPLET=i386-kfreebsd-gnu |
226 | 224 | # else
|
227 | 225 | # error unknown platform triplet
|
228 | 226 | # endif
|
229 | 227 | #elif defined(__gnu_hurd__)
|
230 |
| - i386-gnu |
| 228 | +PLATFORM_TRIPLET=i386-gnu |
231 | 229 | #elif defined(__APPLE__)
|
232 |
| - darwin |
| 230 | +PLATFORM_TRIPLET=darwin |
233 | 231 | #elif defined(__VXWORKS__)
|
234 |
| - vxworks |
| 232 | +PLATFORM_TRIPLET=vxworks |
235 | 233 | #elif defined(__wasm32__)
|
236 | 234 | # if defined(__EMSCRIPTEN__)
|
237 |
| - wasm32-emscripten |
| 235 | +PLATFORM_TRIPLET=wasm32-emscripten |
238 | 236 | # elif defined(__wasi__)
|
239 | 237 | # if defined(_REENTRANT)
|
240 |
| - wasm32-wasi-threads |
| 238 | +PLATFORM_TRIPLET=wasm32-wasi-threads |
241 | 239 | # else
|
242 |
| - wasm32-wasi |
| 240 | +PLATFORM_TRIPLET=wasm32-wasi |
243 | 241 | # endif
|
244 | 242 | # else
|
245 | 243 | # error unknown wasm32 platform
|
246 | 244 | # endif
|
247 | 245 | #elif defined(__wasm64__)
|
248 | 246 | # if defined(__EMSCRIPTEN__)
|
249 |
| - wasm64-emscripten |
| 247 | +PLATFORM_TRIPLET=wasm64-emscripten |
250 | 248 | # elif defined(__wasi__)
|
251 |
| - wasm64-wasi |
| 249 | +PLATFORM_TRIPLET=wasm64-wasi |
252 | 250 | # else
|
253 | 251 | # error unknown wasm64 platform
|
254 | 252 | # endif
|
|
0 commit comments