target.def (pragma_parse): Use DEFHOOK.
[gcc.git] / libgcc / config.host
1 # libgcc host-specific configuration file.
2 # Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
3 # 2008, 2009, 2010 Free Software Foundation, Inc.
4
5 #This file is part of GCC.
6
7 #GCC is free software; you can redistribute it and/or modify it under
8 #the terms of the GNU General Public License as published by the Free
9 #Software Foundation; either version 3, or (at your option) any later
10 #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 or
14 #FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 #for more details.
16
17 #You should have received a copy of the GNU General Public License
18 #along with GCC; see the file COPYING3. If not see
19 #<http://www.gnu.org/licenses/>.
20
21 # This is the libgcc host-specific configuration file
22 # where a configuration type is mapped to different system-specific
23 # definitions and files. This is invoked by the autoconf-generated
24 # configure script. Putting it in a separate shell file lets us skip
25 # running autoconf when modifying host-specific information.
26
27 # This file bears an obvious resemblance to gcc/config.gcc. The cases
28 # should be kept similar, to ease moving library-specific settings
29 # from config.gcc to this file. That is also why tmake_file is
30 # left as tmake_file, rather than hmake_file, even though this library
31 # switches on ${host}.
32
33 # This file switches on the shell variable ${host}, and also uses the
34 # following shell variables:
35 #
36 # with_* Various variables as set by configure.
37
38 # This file sets the following shell variables for use by the
39 # autoconf-generated configure script:
40 #
41 # asm_hidden_op The assembler pseudo-op to use for hide
42 # lists for object files implemented in
43 # assembly (with -fvisibility=hidden for C).
44 # The default is ".hidden".
45 # cpu_type The name of the cpu, if different from the first
46 # chunk of the canonical host name.
47 # extra_parts List of extra object files that should be compiled
48 # for this target machine. This may be overridden
49 # by setting EXTRA_PARTS in a tmake_file fragment.
50 # If either is set, EXTRA_PARTS and
51 # EXTRA_MULTILIB_PARTS inherited from the GCC
52 # subdirectory will be ignored.
53 # tmake_file A list of machine-description-specific
54 # makefile-fragments, if different from
55 # "$cpu_type/t-$cpu_type".
56
57 asm_hidden_op=.hidden
58 extra_parts=
59 tmake_file=
60
61 # Set default cpu_type so it can be updated in each machine entry.
62 cpu_type=`echo ${host} | sed 's/-.*$//'`
63 case ${host} in
64 m32c*-*-*)
65 cpu_type=m32c
66 ;;
67 alpha*-*-*)
68 cpu_type=alpha
69 ;;
70 am33_2.0-*-linux*)
71 cpu_type=mn10300
72 ;;
73 arm*-*-*)
74 cpu_type=arm
75 ;;
76 avr-*-*)
77 cpu_type=avr
78 ;;
79 bfin*-*)
80 cpu_type=bfin
81 ;;
82 fido-*-*)
83 cpu_type=m68k
84 ;;
85 frv*) cpu_type=frv
86 ;;
87 moxie*) cpu_type=moxie
88 ;;
89 i[34567]86-*-*)
90 cpu_type=i386
91 ;;
92 x86_64-*-*)
93 cpu_type=i386
94 ;;
95 ia64-*-*)
96 ;;
97 hppa*-*-*)
98 cpu_type=pa
99 ;;
100 lm32*-*-*)
101 cpu_type=lm32
102 ;;
103 m32r*-*-*)
104 cpu_type=m32r
105 ;;
106 m68k-*-*)
107 ;;
108 mep*-*-*)
109 ;;
110 mips*-*-*)
111 cpu_type=mips
112 ;;
113 powerpc*-*-*)
114 cpu_type=rs6000
115 ;;
116 rs6000*-*-*)
117 ;;
118 score*-*-*)
119 cpu_type=score
120 ;;
121 sparc64*-*-*)
122 cpu_type=sparc
123 ;;
124 sparc*-*-*)
125 cpu_type=sparc
126 ;;
127 spu*-*-*)
128 cpu_type=spu
129 ;;
130 s390*-*-*)
131 cpu_type=s390
132 ;;
133 # Note the 'l'; we need to be able to match e.g. "shle" or "shl".
134 sh[123456789lbe]*-*-*)
135 cpu_type=sh
136 ;;
137 esac
138
139 # Common parts for widely ported systems.
140 case ${host} in
141 *-*-darwin*)
142 asm_hidden_op=.private_extern
143 tmake_file="t-darwin ${cpu_type}/t-darwin t-slibgcc-darwin"
144 ;;
145 *-*-freebsd[12] | *-*-freebsd[12].* | *-*-freebsd*aout*)
146 # This is the place-holder for the generic a.out configuration
147 # of FreeBSD. No actual configuration resides here since
148 # there was only ever a bare-bones ix86 configuration for
149 # a.out and it exists solely in the machine-specific section.
150 # This place-holder must exist to avoid dropping into
151 # the generic ELF configuration of FreeBSD (i.e. it must be
152 # ordered before that section).
153 ;;
154 *-*-freebsd*)
155 # This is the generic ELF configuration of FreeBSD. Later
156 # machine-specific sections may refine and add to this
157 # configuration.
158 ;;
159 *-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu | *-*-gnu*)
160 extra_parts="crtbegin.o crtbeginS.o crtbeginT.o crtend.o crtendS.o"
161 ;;
162 *-*-netbsd*)
163 ;;
164 *-*-openbsd*)
165 ;;
166 *-*-rtems*)
167 ;;
168 *-*-vxworks*)
169 ;;
170 *-*-elf)
171 ;;
172 esac
173
174 case ${host} in
175 # Support site-specific machine types.
176 *local*)
177 rest=`echo ${host} | sed -e "s/$cpu_type-//"`
178 if test -f $srcdir/config/${cpu_type}/t-$rest
179 then tmake_file=${cpu_type}/t-$rest
180 fi
181 ;;
182 alpha*-*-linux* | alpha*-*-gnu*)
183 tmake_file="${tmake_file} alpha/t-crtfm"
184 extra_parts="$extra_parts crtfastmath.o"
185 ;;
186 alpha*-*-freebsd*)
187 ;;
188 alpha*-*-netbsd*)
189 ;;
190 alpha*-*-openbsd*)
191 ;;
192 alpha*-dec-osf5.1*)
193 ;;
194 alpha64-dec-*vms*)
195 tmake_file="vms/t-vms vms/t-vms64 alpha/t-vms"
196 ;;
197 alpha*-dec-*vms*)
198 tmake_file="vms/t-vms alpha/t-vms"
199 ;;
200 arc-*-elf*)
201 ;;
202 arm-wrs-vxworks)
203 ;;
204 arm*-*-freebsd*)
205 ;;
206 arm*-*-netbsdelf*)
207 ;;
208 arm*-*-netbsd*)
209 ;;
210 arm*-*-linux*) # ARM GNU/Linux with ELF
211 ;;
212 arm*-*-uclinux*) # ARM ucLinux
213 ;;
214 arm*-*-ecos-elf)
215 ;;
216 arm*-*-eabi* | arm*-*-symbianelf* )
217 ;;
218 arm*-*-rtems*)
219 ;;
220 arm*-*-elf)
221 ;;
222 arm*-wince-pe*)
223 ;;
224 arm-*-pe*)
225 ;;
226 avr-*-rtems*)
227 ;;
228 avr-*-*)
229 # Make HImode functions for AVR
230 tmake_file=${cpu_type}/t-avr
231 ;;
232 bfin*-elf*)
233 ;;
234 bfin*-uclinux*)
235 ;;
236 bfin*-linux-uclibc*)
237 # No need to build crtbeginT.o on uClibc systems. Should probably
238 # be moved to the OS specific section above.
239 extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
240 ;;
241 bfin*-*)
242 ;;
243 crisv32-*-elf | crisv32-*-none | cris-*-elf | cris-*-none)
244 extra_parts="crtbegin.o crtend.o"
245 ;;
246 cris-*-linux* | crisv32-*-linux*)
247 ;;
248 crx-*-elf)
249 ;;
250 fido-*-elf)
251 ;;
252 fr30-*-elf)
253 ;;
254 frv-*-elf)
255 ;;
256 frv-*-*linux*)
257 ;;
258 h8300-*-rtems*)
259 ;;
260 h8300-*-elf*)
261 ;;
262 hppa*64*-*-linux*)
263 ;;
264 hppa*-*-linux*)
265 ;;
266 hppa[12]*-*-hpux10*)
267 ;;
268 hppa*64*-*-hpux11*)
269 ;;
270 hppa[12]*-*-hpux11*)
271 ;;
272 i[34567]86-*-darwin*)
273 ;;
274 x86_64-*-darwin*)
275 tmake_file="t-darwin ${cpu_type}/t-darwin64 t-slibgcc-darwin"
276 ;;
277 i[34567]86-*-elf*)
278 ;;
279 x86_64-*-elf*)
280 ;;
281 i[34567]86-*-freebsd*)
282 ;;
283 x86_64-*-freebsd*)
284 ;;
285 i[34567]86-*-netbsdelf*)
286 ;;
287 i[34567]86-*-netbsd*)
288 ;;
289 x86_64-*-netbsd*)
290 ;;
291 i[34567]86-*-openbsd2.*|i[34567]86-*openbsd3.[0123])
292 ;;
293 i[34567]86-*-openbsd*)
294 ;;
295 i[34567]86-*-linux* | i[34567]86-*-kfreebsd*-gnu | i[34567]86-*-knetbsd*-gnu | i[34567]86-*-gnu*)
296 extra_parts="$extra_parts crtprec32.o crtprec64.o crtprec80.o crtfastmath.o"
297 tmake_file="${tmake_file} i386/t-crtpc i386/t-crtfm"
298 ;;
299 x86_64-*-linux* | x86_64-*-kfreebsd*-gnu | x86_64-*-knetbsd*-gnu)
300 extra_parts="$extra_parts crtprec32.o crtprec64.o crtprec80.o crtfastmath.o"
301 tmake_file="${tmake_file} i386/t-crtpc i386/t-crtfm"
302 ;;
303 i[34567]86-pc-msdosdjgpp*)
304 ;;
305 i[34567]86-*-lynxos*)
306 ;;
307 i[3456x]86-*-netware*)
308 case /${with_ld} in
309 */nwld)
310 tmake_file="${tmake_file} i386/t-nwld"
311 ;;
312 esac
313 ;;
314 i[34567]86-*-nto-qnx*)
315 ;;
316 i[34567]86-*-rtems*)
317 ;;
318 i[34567]86-*-solaris2*)
319 tmake_file="${tmake_file} i386/t-sol2"
320 case ${host} in
321 *-*-solaris2.1[0-9]*)
322 # Solaris 2.10 provides crt1.o, crti.o, crtn.o, and gcrt1.o as
323 # part of the base system.
324 extra_parts="gmon.o crtbegin.o crtend.o"
325 ;;
326 *)
327 extra_parts="crt1.o crti.o crtn.o gcrt1.o gmon.o crtbegin.o crtend.o"
328 ;;
329 esac
330 ;;
331 i[4567]86-wrs-vxworks|i[4567]86-wrs-vxworksae)
332 ;;
333 i[34567]86-*-pe)
334 ;;
335 i[34567]86-*-cygwin* | i[34567]86-*-mingw*)
336 extra_parts="crtbegin.o crtend.o crtfastmath.o"
337 tmake_file="i386/t-cygming i386/t-crtfm"
338 ;;
339 x86_64-*-mingw*)
340 ;;
341 i[34567]86-*-interix3*)
342 ;;
343 ia64*-*-elf*)
344 extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o crtfastmath.o"
345 tmake_file="ia64/t-ia64"
346 ;;
347 ia64*-*-freebsd*)
348 ;;
349 ia64*-*-linux*)
350 extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o crtfastmath.o"
351 tmake_file="ia64/t-ia64 t-softfp ia64/t-fprules-softfp ia64/t-softfp-compat"
352 ;;
353 ia64*-*-hpux*)
354 ;;
355 ia64-hp-*vms*)
356 tmake_file="vms/t-vms vms/t-vms64 ia64/t-vms"
357 ;;
358 iq2000*-*-elf*)
359 ;;
360 lm32-*-elf*|lm32-*-rtems*)
361 extra_parts="crtbegin.o crtend.o crti.o crtn.o"
362 tmake_file="lm32/t-lm32 lm32/t-elf t-softfp"
363 ;;
364 lm32-*-uclinux*)
365 extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o"
366 tmake_file="lm32/t-lm32 lm32/t-uclinux t-softfp"
367 ;;
368 m32r-*-elf*|m32r-*-rtems*)
369 ;;
370 m32rle-*-elf*)
371 ;;
372 m32r-*-linux*)
373 ;;
374 m32rle-*-linux*)
375 ;;
376 m68hc11-*-*|m6811-*-*)
377 ;;
378 m68hc12-*-*|m6812-*-*)
379 ;;
380 m68k-*-elf*)
381 ;;
382 m68k*-*-netbsdelf*)
383 ;;
384 m68k*-*-openbsd*)
385 ;;
386 m68k-*-uclinux*) # Motorola m68k/ColdFire running uClinux with uClibc
387 ;;
388 m68k-*-linux*) # Motorola m68k's running GNU/Linux
389 # with ELF format using glibc 2
390 # aka the GNU/Linux C library 6.
391 ;;
392 m68k-*-rtems*)
393 ;;
394 mcore-*-elf)
395 ;;
396 mcore-*-pe*)
397 ;;
398 mips-sgi-irix[56]*)
399 ;;
400 mips*-*-netbsd*) # NetBSD/mips, either endian.
401 ;;
402 mips64*-*-linux*)
403 extra_parts="$extra_parts crtfastmath.o"
404 tmake_file="{$tmake_file} mips/t-crtfm"
405 ;;
406 mips*-*-linux*) # Linux MIPS, either endian.
407 extra_parts="$extra_parts crtfastmath.o"
408 tmake_file="{$tmake_file} mips/t-crtfm"
409 ;;
410 mips*-*-openbsd*)
411 ;;
412 mipsisa32-*-elf* | mipsisa32el-*-elf*)
413 ;;
414 mipsisa32r2-*-elf* | mipsisa32r2el-*-elf*)
415 ;;
416 mipsisa64-*-elf* | mipsisa64el-*-elf*)
417 ;;
418 mipsisa64r2-*-elf* | mipsisa64r2el-*-elf*)
419 ;;
420 mipsisa64sr71k-*-elf*)
421 ;;
422 mipsisa64sb1-*-elf* | mipsisa64sb1el-*-elf*)
423 ;;
424 mips-*-elf* | mipsel-*-elf*)
425 ;;
426 mips64-*-elf* | mips64el-*-elf*)
427 ;;
428 mips64vr-*-elf* | mips64vrel-*-elf*)
429 ;;
430 mips64orion-*-elf* | mips64orionel-*-elf*)
431 ;;
432 mips*-*-rtems*)
433 ;;
434 mips-wrs-vxworks)
435 ;;
436 mipstx39-*-elf* | mipstx39el-*-elf*)
437 ;;
438 mmix-knuth-mmixware)
439 extra_parts="crti.o crtn.o crtbegin.o crtend.o"
440 tmake_file="${tmake_file} ${cpu_type}/t-${cpu_type}"
441 ;;
442 mn10300-*-*)
443 ;;
444 moxie-*-*)
445 tmake_file="moxie/t-moxie moxie/t-moxie-softfp"
446 extra_parts="crtbegin.o crtend.o crti.o crtn.o"
447 ;;
448 pdp11-*-*)
449 ;;
450 picochip-*-*)
451 ;;
452 powerpc-*-darwin*)
453 ;;
454 powerpc64-*-darwin*)
455 ;;
456 powerpc*-*-freebsd*)
457 ;;
458 powerpc-*-netbsd*)
459 ;;
460 powerpc-*-eabispe*)
461 ;;
462 powerpc-*-eabisimaltivec*)
463 ;;
464 powerpc-*-eabisim*)
465 ;;
466 powerpc-*-elf*)
467 ;;
468 powerpc-*-eabialtivec*)
469 ;;
470 powerpc-*-eabi*)
471 ;;
472 powerpc-*-rtems*)
473 ;;
474 powerpc-*-linux* | powerpc64-*-linux*)
475 tmake_file="${tmake_file} rs6000/t-ppccomm rs6000/t-ldbl128 t-softfp"
476 ;;
477 powerpc64-*-gnu*)
478 tmake_file="${tmake_file} rs6000/t-ldbl128 t-softfp"
479 ;;
480 powerpc-*-gnu-gnualtivec*)
481 tmake_file="${tmake_file} rs6000/t-ldbl128"
482 ;;
483 powerpc-*-gnu*)
484 tmake_file="${tmake_file} rs6000/t-ldbl128"
485 ;;
486 powerpc-wrs-vxworks|powerpc-wrs-vxworksae)
487 ;;
488 powerpc-*-lynxos*)
489 ;;
490 powerpcle-*-elf*)
491 ;;
492 powerpcle-*-eabisim*)
493 ;;
494 powerpcle-*-eabi*)
495 ;;
496 rs6000-ibm-aix4.[3456789]* | powerpc-ibm-aix4.[3456789]*)
497 ;;
498 rs6000-ibm-aix5.1.* | powerpc-ibm-aix5.1.*)
499 ;;
500 rs6000-ibm-aix[56789].* | powerpc-ibm-aix[56789].*)
501 ;;
502 rx-*-elf)
503 extra_parts="crtbegin.o crtend.o"
504 tmake_file="rx/t-rx"
505 ;;
506 s390-*-linux*)
507 tmake_file="${tmake_file} s390/t-crtstuff s390/t-linux s390/32/t-floattodi"
508 ;;
509 s390x-*-linux*)
510 tmake_file="${tmake_file} s390/t-crtstuff s390/t-linux"
511 ;;
512 s390x-ibm-tpf*)
513 tmake_file="${tmake_file} s390/t-crtstuff s390/t-tpf"
514 ;;
515 score-*-elf)
516 ;;
517 sh-*-elf* | sh[12346l]*-*-elf* | \
518 sh-*-symbianelf* | sh[12346l]*-*-symbianelf* | \
519 sh-*-linux* | sh[2346lbe]*-*-linux* | \
520 sh-*-netbsdelf* | shl*-*-netbsdelf* | sh5-*-netbsd* | sh5l*-*-netbsd* | \
521 sh64-*-netbsd* | sh64l*-*-netbsd*)
522 case ${host} in
523 sh*-*-linux*)
524 tmake_file="${tmake_file} sh/t-linux"
525 ;;
526 esac
527 ;;
528 sh-*-rtems*)
529 ;;
530 sh-wrs-vxworks)
531 ;;
532 sparc-*-netbsdelf*)
533 ;;
534 sparc64-*-openbsd*)
535 ;;
536 sparc-*-elf*)
537 ;;
538 sparc-*-linux*) # SPARC's running GNU/Linux, libc6
539 extra_parts="$extra_parts crtfastmath.o"
540 tmake_file="${tmake_file} sparc/t-crtfm"
541 ;;
542 sparc-*-rtems* | sparc64-*-rtems* )
543 ;;
544 sparc64-*-solaris2* | sparcv9-*-solaris2*)
545 ;;
546 sparc-*-solaris2*)
547 ;;
548 sparc64-*-elf*)
549 ;;
550 sparc-wrs-vxworks)
551 ;;
552 sparc64-*-freebsd*|ultrasparc-*-freebsd*)
553 ;;
554 sparc64-*-linux*) # 64-bit SPARC's running GNU/Linux
555 extra_parts="$extra_parts crtfastmath.o"
556 tmake_file="${tmake_file} sparc/t-crtfm"
557 ;;
558 sparc64-*-netbsd*)
559 ;;
560 spu-*-elf*)
561 ;;
562 v850e1-*-*)
563 ;;
564 v850e-*-*)
565 ;;
566 v850-*-*)
567 ;;
568 vax-*-linux*)
569 ;;
570 vax-*-netbsdelf*)
571 ;;
572 vax-*-netbsd*)
573 ;;
574 vax-*-openbsd*)
575 ;;
576 xstormy16-*-elf)
577 ;;
578 xtensa*-*-elf*)
579 ;;
580 xtensa*-*-linux*)
581 ;;
582 am33_2.0-*-linux*)
583 extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o"
584 ;;
585 m32c-*-elf*|m32c-*-rtems*)
586 ;;
587 mep*-*-*)
588 ;;
589 *)
590 echo "*** Configuration ${host} not supported" 1>&2
591 exit 1
592 ;;
593 esac
594
595 case ${host} in
596 i[34567]86-*-linux* | x86_64-*-linux* | \
597 i[34567]86-*-kfreebsd*-gnu | i[34567]86-*-knetbsd*-gnu | \
598 i[34567]86-*-gnu*)
599 tmake_file="${tmake_file} t-tls"
600 ;;
601 esac
602
603 case ${host} in
604 i[34567]86-*-darwin* | x86_64-*-darwin* | \
605 i[34567]86-*-kfreebsd*-gnu | x86_64-*-kfreebsd*-gnu | \
606 i[34567]86-*-linux* | x86_64-*-linux* | \
607 i[34567]86-*-gnu* | \
608 i[34567]86-*-solaris2* | \
609 i[34567]86-*-cygwin* | i[34567]86-*-mingw* | x86_64-*-mingw*)
610 if test "${host_address}" = 32; then
611 tmake_file="${tmake_file} t-softfp i386/${host_address}/t-fprules-softfp"
612 fi
613 ;;
614 esac
615
616 case ${host} in
617 i[34567]86-*-linux* | x86_64-*-linux*)
618 # Provide backward binary compatibility for 64bit Linux/x86.
619 if test "${host_address}" = 64; then
620 tmake_file="${tmake_file} i386/${host_address}/t-softfp-compat"
621 fi
622 ;;
623 esac