/
config.gcc
4445 lines (4326 loc) · 125 KB
/
config.gcc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# GCC target-specific configuration file.
# Copyright (C) 1997-2015 Free Software Foundation, Inc.
#This file is part of GCC.
#GCC is free software; you can redistribute it and/or modify it under
#the terms of the GNU General Public License as published by the Free
#Software Foundation; either version 3, or (at your option) any later
#version.
#GCC is distributed in the hope that it will be useful, but WITHOUT
#ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
#FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
#for more details.
#You should have received a copy of the GNU General Public License
#along with GCC; see the file COPYING3. If not see
#<http://www.gnu.org/licenses/>.
# This is the GCC target-specific configuration file
# where a configuration type is mapped to different system-specific
# definitions and files. This is invoked by the autoconf-generated
# configure script. Putting it in a separate shell file lets us skip
# running autoconf when modifying target-specific information.
# When you change the cases in the OS or target switches, consider
# updating ../libgcc/config.host also.
# This file switches on the shell variable ${target}, and also uses the
# following shell variables:
#
# with_* Various variables as set by configure.
#
# enable_threads Either the name, yes or no depending on whether
# threads support was requested.
#
# default_use_cxa_atexit
# The default value for the $enable___cxa_atexit
# variable. enable___cxa_atexit needs to be set to
# "yes" for the correct operation of C++ destructors
# but it relies upon the presence of a non-standard C
# library function called __cxa_atexit.
# Since not all C libraries provide __cxa_atexit the
# default value of $default_use_cxa_atexit is set to
# "no" except for targets which are known to be OK.
#
# default_gnu_indirect_function
# The default value for the $enable_gnu_indirect_function
# variable. enable_gnu_indirect_function relies
# upon the presence of a non-standard gnu ifunc support
# in the assembler, linker and dynamic linker.
# Since not all libraries provide the dynamic linking
# support, the default value of
# $default_gnu_indirect_function is set to
# "no" except for targets which are known to be OK.
#
# gas_flag Either yes or no depending on whether GNU as was
# requested.
#
# gnu_ld_flag Either yes or no depending on whether GNU ld was
# requested.
# This file sets the following shell variables for use by the
# autoconf-generated configure script:
#
# cpu_type The name of the cpu, if different from the first
# chunk of the canonical target name.
#
# tm_defines List of target macros to define for all compilations.
#
# tm_file A list of target macro files, if different from
# "$cpu_type/$cpu_type.h". Usually it's constructed
# per target in a way like this:
# tm_file="${tm_file} dbxelf.h elfos.h ${cpu_type.h}/elf.h"
# Note that the preferred order is:
# - specific target header "${cpu_type}/${cpu_type.h}"
# - generic headers like dbxelf.h elfos.h, etc.
# - specializing target headers like ${cpu_type.h}/elf.h
# This helps to keep OS specific stuff out of the CPU
# defining header ${cpu_type}/${cpu_type.h}.
#
# It is possible to include automatically-generated
# build-directory files by prefixing them with "./".
# All other files should relative to $srcdir/config.
#
# tm_p_file Location of file with declarations for functions
# in $out_file.
#
# out_file The name of the machine description C support
# file, if different from "$cpu_type/$cpu_type.c".
#
# common_out_file The name of the source file for code shared between
# the compiler proper and the driver.
#
# md_file The name of the machine-description file, if
# different from "$cpu_type/$cpu_type.md".
#
# tmake_file A list of machine-description-specific
# makefile-fragments, if different from
# "$cpu_type/t-$cpu_type".
#
# extra_modes The name of the file containing a list of extra
# machine modes, if necessary and different from
# "$cpu_type/$cpu_type-modes.def".
#
# extra_objs List of extra objects that should be linked into
# the compiler proper (cc1, cc1obj, cc1plus)
# depending on target.
#
# extra_gcc_objs List of extra objects that should be linked into
# the compiler driver (gcc) depending on target.
#
# extra_headers List of used header files from the directory
# config/${cpu_type}.
#
# user_headers_inc_next_pre
# List of header file names of internal gcc header
# files, which should be prefixed by an include_next.
# user_headers_inc_next_post
# List of header file names of internal gcc header
# files, which should be postfixed by an include_next.
# use_gcc_tgmath If set, add tgmath.h to the list of used header
# files.
#
# use_gcc_stdint If "wrap", install a version of stdint.h that
# wraps the system's copy for hosted compilations;
# if "provide", provide a version of systems without
# such a system header; otherwise "none", do not
# provide such a header at all.
#
# extra_programs List of extra executables compiled for this target
# machine, used when linking.
#
# extra_options List of target-dependent .opt files.
#
# c_target_objs List of extra target-dependent objects that be
# linked into the C compiler only.
#
# cxx_target_objs List of extra target-dependent objects that be
# linked into the C++ compiler only.
#
# fortran_target_objs List of extra target-dependent objects that be
# linked into the fortran compiler only.
#
# target_gtfiles List of extra source files with type information.
#
# xm_defines List of macros to define when compiling for the
# target machine.
#
# xm_file List of files to include when compiling for the
# target machine.
#
# use_collect2 Set to yes or no, depending on whether collect2
# will be used.
#
# target_cpu_default Set to override the default target model.
#
# gdb_needs_out_file_path
# Set to yes if gdb needs a dir command with
# `dirname $out_file`.
#
# thread_file Set to control which thread package to use.
#
# gas Set to yes or no depending on whether the target
# system normally uses GNU as.
#
# configure_default_options
# Set to an initializer for configure_default_options
# in configargs.h, based on --with-cpu et cetera.
#
# native_system_header_dir
# Where system header files are found for this
# target. This defaults to /usr/include. If
# the --with-sysroot configure option or the
# --sysroot command line option is used this
# will be relative to the sysroot.
# target_type_format_char
# The default character to be used for formatting
# the attribute in a
# .type symbol_name, ${t_t_f_c}<property>
# directive.
# The following variables are used in each case-construct to build up the
# outgoing variables:
#
# gnu_ld Set to yes or no depending on whether the target
# system normally uses GNU ld.
#
# target_has_targetcm Set to yes or no depending on whether the target
# has its own definition of targetcm.
#
# target_has_targetm_common Set to yes or no depending on whether the
# target has its own definition of targetm_common.
out_file=
common_out_file=
tmake_file=
extra_headers=
user_headers_inc_next_pre=
user_headers_inc_next_post=
use_gcc_tgmath=yes
use_gcc_stdint=none
extra_programs=
extra_objs=
extra_gcc_objs=
extra_options=
c_target_objs=
cxx_target_objs=
fortran_target_objs=
target_has_targetcm=no
target_has_targetm_common=yes
tm_defines=
xm_defines=
# Set this to force installation and use of collect2.
use_collect2=
# Set this to override the default target model.
target_cpu_default=
# Set this if gdb needs a dir command with `dirname $out_file`
gdb_needs_out_file_path=
# Set this to control which thread package will be used.
thread_file=
# Reinitialize these from the flag values every loop pass, since some
# configure entries modify them.
gas="$gas_flag"
gnu_ld="$gnu_ld_flag"
default_use_cxa_atexit=no
default_gnu_indirect_function=no
target_gtfiles=
need_64bit_isa=
native_system_header_dir=/usr/include
target_type_format_char='@'
# Don't carry these over build->host->target. Please.
xm_file=
md_file=
# Obsolete configurations.
case ${target} in
# Currently there are no obsolete targets.
nothing \
)
if test "x$enable_obsolete" != xyes; then
echo "*** Configuration ${target} is obsolete." >&2
echo "*** Specify --enable-obsolete to build it anyway." >&2
echo "*** Support will be REMOVED in the next major release of GCC," >&2
echo "*** unless a maintainer comes forward." >&2
exit 1
fi;;
esac
# Unsupported targets list. Do not put an entry in this list unless
# it would otherwise be caught by a more permissive pattern. The list
# should be in alphabetical order.
case ${target} in
# Avoid special cases that are not obsolete
arm*-*-*eabi* \
)
;;
arm*-wince-pe* \
| arm*-*-ecos-elf \
| arm*-*-elf \
| arm*-*-linux* \
| arm*-*-uclinux* \
| i[34567]86-go32-* \
| i[34567]86-*-go32* \
| m68k-*-uclinuxoldabi* \
| mips64orion*-*-rtems* \
| pdp11-*-bsd \
| sparc-hal-solaris2* \
| thumb-*-* \
| *-*-freebsd[12] | *-*-freebsd[12].* \
| *-*-freebsd*aout* \
| *-*-linux*aout* \
| *-*-linux*coff* \
| *-*-linux*libc1* \
| *-*-linux*oldld* \
| *-*-rtemsaout* \
| *-*-rtemscoff* \
| *-*-solaris2 \
| *-*-solaris2.[0-9] \
| *-*-solaris2.[0-9].* \
| *-*-sysv* \
| vax-*-vms* \
)
echo "*** Configuration ${target} not supported" 1>&2
exit 1
;;
esac
# Set default cpu_type, tm_file, tm_p_file and xm_file so it can be
# updated in each machine entry. Also set default extra_headers for some
# machines.
tm_p_file=
cpu_type=`echo ${target} | sed 's/-.*$//'`
cpu_is_64bit=
case ${target} in
m32c*-*-*)
cpu_type=m32c
tmake_file=m32c/t-m32c
target_has_targetm_common=no
;;
aarch64*-*-*)
cpu_type=aarch64
extra_headers="arm_neon.h arm_acle.h"
extra_objs="aarch64-builtins.o aarch-common.o"
target_gtfiles="\$(srcdir)/config/aarch64/aarch64-builtins.c"
target_has_targetm_common=yes
;;
alpha*-*-*)
cpu_type=alpha
extra_options="${extra_options} g.opt"
;;
am33_2.0-*-linux*)
cpu_type=mn10300
;;
arc*-*-*)
cpu_type=arc
;;
arm*-*-*)
cpu_type=arm
extra_objs="arm-builtins.o aarch-common.o"
extra_headers="mmintrin.h arm_neon.h arm_acle.h"
target_type_format_char='%'
c_target_objs="arm-c.o"
cxx_target_objs="arm-c.o"
extra_options="${extra_options} arm/arm-tables.opt"
target_gtfiles="\$(srcdir)/config/arm/arm-builtins.c"
;;
avr-*-*)
cpu_type=avr
c_target_objs="avr-c.o"
cxx_target_objs="avr-c.o"
;;
bfin*-*)
cpu_type=bfin
;;
crisv32-*)
cpu_type=cris
;;
frv*) cpu_type=frv
extra_options="${extra_options} g.opt"
;;
moxie*) cpu_type=moxie
target_has_targetm_common=no
;;
fido-*-*)
cpu_type=m68k
extra_headers=math-68881.h
extra_options="${extra_options} m68k/m68k-tables.opt"
;;
i[34567]86-*-*)
cpu_type=i386
c_target_objs="i386-c.o"
cxx_target_objs="i386-c.o"
extra_options="${extra_options} fused-madd.opt"
extra_headers="cpuid.h mmintrin.h mm3dnow.h xmmintrin.h emmintrin.h
pmmintrin.h tmmintrin.h ammintrin.h smmintrin.h
nmmintrin.h bmmintrin.h fma4intrin.h wmmintrin.h
immintrin.h x86intrin.h avxintrin.h xopintrin.h
ia32intrin.h cross-stdarg.h lwpintrin.h popcntintrin.h
lzcntintrin.h bmiintrin.h bmi2intrin.h tbmintrin.h
avx2intrin.h avx512fintrin.h fmaintrin.h f16cintrin.h
rtmintrin.h xtestintrin.h rdseedintrin.h prfchwintrin.h
adxintrin.h fxsrintrin.h xsaveintrin.h xsaveoptintrin.h
avx512cdintrin.h avx512erintrin.h avx512pfintrin.h
shaintrin.h clflushoptintrin.h xsavecintrin.h
xsavesintrin.h avx512dqintrin.h avx512bwintrin.h
avx512vlintrin.h avx512vlbwintrin.h avx512vldqintrin.h
avx512ifmaintrin.h avx512ifmavlintrin.h avx512vbmiintrin.h
avx512vbmivlintrin.h clwbintrin.h pcommitintrin.h mwaitxintrin.h"
;;
x86_64-*-*)
cpu_type=i386
c_target_objs="i386-c.o"
cxx_target_objs="i386-c.o"
extra_options="${extra_options} fused-madd.opt"
extra_headers="cpuid.h mmintrin.h mm3dnow.h xmmintrin.h emmintrin.h
pmmintrin.h tmmintrin.h ammintrin.h smmintrin.h
nmmintrin.h bmmintrin.h fma4intrin.h wmmintrin.h
immintrin.h x86intrin.h avxintrin.h xopintrin.h
ia32intrin.h cross-stdarg.h lwpintrin.h popcntintrin.h
lzcntintrin.h bmiintrin.h tbmintrin.h bmi2intrin.h
avx2intrin.h avx512fintrin.h fmaintrin.h f16cintrin.h
rtmintrin.h xtestintrin.h rdseedintrin.h prfchwintrin.h
adxintrin.h fxsrintrin.h xsaveintrin.h xsaveoptintrin.h
avx512cdintrin.h avx512erintrin.h avx512pfintrin.h
shaintrin.h clflushoptintrin.h xsavecintrin.h
xsavesintrin.h avx512dqintrin.h avx512bwintrin.h
avx512vlintrin.h avx512vlbwintrin.h avx512vldqintrin.h
avx512ifmaintrin.h avx512ifmavlintrin.h avx512vbmiintrin.h
avx512vbmivlintrin.h clwbintrin.h pcommitintrin.h mwaitxintrin.h"
;;
ia64-*-*)
extra_headers=ia64intrin.h
extra_options="${extra_options} g.opt fused-madd.opt"
;;
hppa*-*-*)
cpu_type=pa
;;
lm32*)
extra_options="${extra_options} g.opt"
;;
m32r*-*-*)
cpu_type=m32r
extra_options="${extra_options} g.opt"
;;
m68k-*-*)
extra_headers=math-68881.h
extra_options="${extra_options} m68k/m68k-tables.opt"
;;
microblaze*-*-*)
cpu_type=microblaze
extra_options="${extra_options} g.opt"
;;
mips*-*-*)
cpu_type=mips
extra_headers="loongson.h"
extra_options="${extra_options} g.opt mips/mips-tables.opt"
;;
nds32*)
cpu_type=nds32
extra_headers="nds32_intrinsic.h"
extra_objs="nds32-cost.o nds32-intrinsic.o nds32-isr.o nds32-md-auxiliary.o nds32-pipelines-auxiliary.o nds32-predicates.o nds32-memory-manipulation.o nds32-fp-as-gp.o"
;;
nios2-*-*)
cpu_type=nios2
extra_options="${extra_options} g.opt"
;;
nvptx-*-*)
cpu_type=nvptx
;;
or1k-*-*)
cpu_type=or1k
;;
or1knd-*-*)
cpu_type=or1k
;;
powerpc*-*-*)
cpu_type=rs6000
extra_headers="ppc-asm.h altivec.h spe.h ppu_intrinsics.h paired.h spu2vmx.h vec_types.h si2vmx.h htmintrin.h htmxlintrin.h"
case x$with_cpu in
xpowerpc64|xdefault64|x6[23]0|x970|xG5|xpower[345678]|xpower6x|xrs64a|xcell|xa2|xe500mc64|xe5500|Xe6500)
cpu_is_64bit=yes
;;
esac
extra_options="${extra_options} g.opt fused-madd.opt rs6000/rs6000-tables.opt"
;;
rs6000*-*-*)
extra_options="${extra_options} g.opt fused-madd.opt rs6000/rs6000-tables.opt"
;;
sparc*-*-*)
cpu_type=sparc
c_target_objs="sparc-c.o"
cxx_target_objs="sparc-c.o"
extra_headers="visintrin.h"
;;
spu*-*-*)
cpu_type=spu
;;
s390*-*-*)
cpu_type=s390
extra_options="${extra_options} fused-madd.opt"
extra_headers="s390intrin.h htmintrin.h htmxlintrin.h vecintrin.h"
;;
# Note the 'l'; we need to be able to match e.g. "shle" or "shl".
sh[123456789lbe]*-*-* | sh-*-*)
cpu_type=sh
extra_options="${extra_options} fused-madd.opt"
extra_objs="${extra_objs} sh_treg_combine.o sh-mem.o sh_optimize_sett_clrt.o"
;;
v850*-*-*)
cpu_type=v850
;;
tic6x-*-*)
cpu_type=c6x
extra_headers="c6x_intrinsics.h"
extra_options="${extra_options} c6x/c6x-tables.opt"
;;
xtensa*-*-*)
extra_options="${extra_options} fused-madd.opt"
;;
tilegx*-*-*)
cpu_type=tilegx
;;
tilepro*-*-*)
cpu_type=tilepro
;;
esac
tm_file=${cpu_type}/${cpu_type}.h
if test -f ${srcdir}/config/${cpu_type}/${cpu_type}-protos.h
then
tm_p_file=${cpu_type}/${cpu_type}-protos.h
fi
extra_modes=
if test -f ${srcdir}/config/${cpu_type}/${cpu_type}-modes.def
then
extra_modes=${cpu_type}/${cpu_type}-modes.def
fi
if test -f ${srcdir}/config/${cpu_type}/${cpu_type}.opt
then
extra_options="${extra_options} ${cpu_type}/${cpu_type}.opt"
fi
case ${target} in
aarch64*-*-*)
tm_p_file="${tm_p_file} arm/aarch-common-protos.h"
case ${with_abi} in
"")
if test "x$with_multilib_list" = xilp32; then
tm_file="aarch64/biarchilp32.h ${tm_file}"
else
tm_file="aarch64/biarchlp64.h ${tm_file}"
fi
;;
ilp32)
tm_file="aarch64/biarchilp32.h ${tm_file}"
;;
lp64)
tm_file="aarch64/biarchlp64.h ${tm_file}"
;;
*)
echo "Unknown ABI used in --with-abi=$with_abi"
exit 1
esac
;;
i[34567]86-*-*)
if test "x$with_abi" != x; then
echo "This target does not support --with-abi."
exit 1
fi
if test "x$enable_cld" = xyes; then
tm_defines="${tm_defines} USE_IX86_CLD=1"
fi
if test "x$enable_frame_pointer" = xyes; then
tm_defines="${tm_defines} USE_IX86_FRAME_POINTER=1"
fi
tm_file="vxworks-dummy.h ${tm_file}"
;;
x86_64-*-*)
case ${with_abi} in
"")
if test "x$with_multilib_list" = xmx32; then
tm_file="i386/biarchx32.h ${tm_file}"
else
tm_file="i386/biarch64.h ${tm_file}"
fi
;;
64 | m64)
tm_file="i386/biarch64.h ${tm_file}"
;;
x32 | mx32)
tm_file="i386/biarchx32.h ${tm_file}"
;;
*)
echo "Unknown ABI used in --with-abi=$with_abi"
exit 1
esac
if test "x$enable_cld" = xyes; then
tm_defines="${tm_defines} USE_IX86_CLD=1"
fi
if test "x$enable_frame_pointer" = xyes; then
tm_defines="${tm_defines} USE_IX86_FRAME_POINTER=1"
fi
tm_file="vxworks-dummy.h ${tm_file}"
;;
arm*-*-*)
tm_p_file="${tm_p_file} arm/aarch-common-protos.h"
tm_file="vxworks-dummy.h ${tm_file}"
;;
mips*-*-* | sh*-*-* | sparc*-*-*)
tm_file="vxworks-dummy.h ${tm_file}"
;;
esac
# On a.out targets, we need to use collect2.
case ${target} in
*-*-*aout*)
use_collect2=yes
;;
esac
# Common C libraries.
tm_defines="$tm_defines LIBC_GLIBC=1 LIBC_UCLIBC=2 LIBC_BIONIC=3 LIBC_MUSL=4"
# 32-bit x86 processors supported by --with-arch=. Each processor
# MUST be separated by exactly one space.
x86_archs="athlon athlon-4 athlon-fx athlon-mp athlon-tbird \
athlon-xp k6 k6-2 k6-3 geode c3 c3-2 winchip-c6 winchip2 i386 i486 \
i586 i686 pentium pentium-m pentium-mmx pentium2 pentium3 pentium3m \
pentium4 pentium4m pentiumpro prescott"
# 64-bit x86 processors supported by --with-arch=. Each processor
# MUST be separated by exactly one space.
x86_64_archs="amdfam10 athlon64 athlon64-sse3 barcelona bdver1 bdver2 \
bdver3 bdver4 btver1 btver2 k8 k8-sse3 opteron opteron-sse3 nocona \
core2 corei7 corei7-avx core-avx-i core-avx2 atom slm nehalem westmere \
sandybridge ivybridge haswell broadwell bonnell silvermont knl x86-64 \
native"
# Additional x86 processors supported by --with-cpu=. Each processor
# MUST be separated by exactly one space.
x86_cpus="generic intel"
# Common parts for widely ported systems.
case ${target} in
*-*-darwin*)
tmake_file="t-darwin ${cpu_type}/t-darwin"
tm_file="${tm_file} darwin.h"
case ${target} in
*-*-darwin9*)
tm_file="${tm_file} darwin9.h"
;;
*-*-darwin[12][0-9]*)
tm_file="${tm_file} darwin9.h darwin10.h"
;;
esac
tm_file="${tm_file} ${cpu_type}/darwin.h"
tm_p_file="${tm_p_file} darwin-protos.h"
target_gtfiles="\$(srcdir)/config/darwin.c"
extra_options="${extra_options} darwin.opt"
c_target_objs="${c_target_objs} darwin-c.o"
cxx_target_objs="${cxx_target_objs} darwin-c.o"
fortran_target_objs="darwin-f.o"
target_has_targetcm=yes
extra_objs="darwin.o"
extra_gcc_objs="darwin-driver.o"
default_use_cxa_atexit=yes
use_gcc_stdint=wrap
case ${enable_threads} in
"" | yes | posix) thread_file='posix' ;;
esac
;;
*-*-dragonfly*)
gas=yes
gnu_ld=yes
tmake_file="t-slibgcc"
case ${enable_threads} in
"" | yes | posix)
thread_file='posix'
;;
no | single)
# Let these non-posix thread selections fall through if requested
;;
*)
echo 'Unknown thread configuration for DragonFly BSD'
exit 1
;;
esac
extra_options="$extra_options rpath.opt dragonfly.opt"
default_use_cxa_atexit=yes
use_gcc_stdint=wrap
;;
*-*-freebsd*)
# This is the generic ELF configuration of FreeBSD. Later
# machine-specific sections may refine and add to this
# configuration.
#
# Due to tm_file entry ordering issues that vary between cpu
# architectures, we only define fbsd_tm_file to allow the
# machine-specific section to dictate the final order of all
# entries of tm_file with the minor exception that components
# of the tm_file set here will always be of the form:
#
# freebsd<version_number>.h [freebsd-<conf_option>.h ...] freebsd-spec.h freebsd.h
#
# The machine-specific section should not tamper with this
# ordering but may order all other entries of tm_file as it
# pleases around the provided core setting.
gas=yes
gnu_ld=yes
fbsd_major=`echo ${target} | sed -e 's/.*freebsd//g' | sed -e 's/\..*//g'`
tm_defines="${tm_defines} FBSD_MAJOR=${fbsd_major}"
tmake_file="t-slibgcc"
case ${enable_threads} in
no)
fbsd_tm_file="${fbsd_tm_file} freebsd-nthr.h"
;;
"" | yes | posix)
thread_file='posix'
;;
*)
echo 'Unknown thread configuration for FreeBSD'
exit 1
;;
esac
fbsd_tm_file="${fbsd_tm_file} freebsd-spec.h freebsd.h freebsd-stdint.h"
extra_options="$extra_options rpath.opt freebsd.opt"
case ${target} in
*-*-freebsd[345].*)
:;;
*)
default_use_cxa_atexit=yes;;
esac
use_gcc_stdint=wrap
;;
*-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu | *-*-gnu* | *-*-kopensolaris*-gnu)
extra_options="$extra_options gnu-user.opt"
gas=yes
gnu_ld=yes
case ${enable_threads} in
"" | yes | posix) thread_file='posix' ;;
esac
tmake_file="t-slibgcc"
case $target in
*-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu | *-*-kopensolaris*-gnu)
:;;
*-*-gnu*)
native_system_header_dir=/include
;;
esac
# Linux C libraries selection switch: glibc / uclibc / bionic.
# uclibc and bionic aren't usable for GNU/Hurd and neither for GNU/k*BSD.
case $target in
*linux*)
tm_p_file="${tm_p_file} linux-protos.h"
tmake_file="${tmake_file} t-linux"
extra_objs="${extra_objs} linux.o"
extra_options="${extra_options} linux.opt"
;;
esac
case $target in
*-*-*android*)
tm_defines="$tm_defines DEFAULT_LIBC=LIBC_BIONIC"
;;
*-*-*uclibc*)
tm_defines="$tm_defines DEFAULT_LIBC=LIBC_UCLIBC"
;;
*-*-*musl*)
tm_defines="$tm_defines DEFAULT_LIBC=LIBC_MUSL"
;;
*)
tm_defines="$tm_defines DEFAULT_LIBC=LIBC_GLIBC"
;;
esac
# Assume that glibc or uClibc or Bionic are being used and so __cxa_atexit
# is provided.
default_use_cxa_atexit=yes
use_gcc_tgmath=no
use_gcc_stdint=wrap
# Enable compilation for Android by default for *android* targets.
case $target in
*-*-*android*)
tm_defines="$tm_defines ANDROID_DEFAULT=1"
;;
*)
tm_defines="$tm_defines ANDROID_DEFAULT=0"
;;
esac
c_target_objs="${c_target_objs} glibc-c.o"
cxx_target_objs="${cxx_target_objs} glibc-c.o"
tmake_file="${tmake_file} t-glibc"
target_has_targetcm=yes
;;
*-*-netbsd*)
tmake_file="t-slibgcc"
gas=yes
gnu_ld=yes
# NetBSD 2.0 and later get POSIX threads enabled by default.
# Allow them to be explicitly enabled on any other version.
case ${enable_threads} in
"")
case ${target} in
*-*-netbsd[2-9]* | *-*-netbsdelf[2-9]*)
thread_file='posix'
tm_defines="${tm_defines} NETBSD_ENABLE_PTHREADS"
;;
esac
;;
yes | posix)
thread_file='posix'
tm_defines="${tm_defines} NETBSD_ENABLE_PTHREADS"
;;
esac
# NetBSD 2.0 and later provide __cxa_atexit(), which we use by
# default (unless overridden by --disable-__cxa_atexit).
case ${target} in
*-*-netbsd[2-9]* | *-*-netbsdelf[2-9]*)
default_use_cxa_atexit=yes
;;
esac
;;
*-*-openbsd*)
tmake_file="t-openbsd"
case ${enable_threads} in
yes)
thread_file='posix'
;;
esac
case ${target} in
*-*-openbsd2.*|*-*-openbsd3.[012])
tm_defines="${tm_defines} HAS_LIBC_R=1" ;;
esac
case ${target} in
*-*-openbsd4.[3-9]|*-*-openbsd[5-9]*)
default_use_cxa_atexit=yes
;;
esac
;;
*-*-rtems*)
case ${enable_threads} in
"" | yes | rtems) thread_file='rtems' ;;
posix) thread_file='posix' ;;
no) ;;
*)
echo 'Unknown thread configuration for RTEMS'
exit 1
;;
esac
tmake_file="${tmake_file} t-rtems"
extra_options="${extra_options} rtems.opt"
default_use_cxa_atexit=yes
use_gcc_stdint=wrap
;;
*-*-uclinux*)
extra_options="$extra_options gnu-user.opt"
use_gcc_stdint=wrap
tm_defines="$tm_defines DEFAULT_LIBC=LIBC_UCLIBC SINGLE_LIBC"
;;
*-*-rdos*)
use_gcc_stdint=wrap
;;
*-*-solaris2*)
# i?86-*-solaris2* needs to insert headers between cpu default and
# Solaris 2 specific ones.
sol2_tm_file_head="dbxelf.h elfos.h ${cpu_type}/sysv4.h"
sol2_tm_file_tail="${cpu_type}/sol2.h sol2.h"
sol2_tm_file="${sol2_tm_file_head} ${sol2_tm_file_tail}"
case ${target} in
*-*-solaris2.1[2-9]*)
# __cxa_atexit was introduced in Solaris 12.
default_use_cxa_atexit=yes
;;
esac
use_gcc_stdint=wrap
if test x$gnu_ld = xyes; then
tm_file="usegld.h ${tm_file}"
fi
if test x$gas = xyes; then
tm_file="usegas.h ${tm_file}"
fi
tm_p_file="${tm_p_file} sol2-protos.h"
tmake_file="${tmake_file} t-sol2 t-slibgcc"
c_target_objs="${c_target_objs} sol2-c.o"
cxx_target_objs="${cxx_target_objs} sol2-c.o sol2-cxx.o"
extra_objs="sol2.o sol2-stubs.o"
extra_options="${extra_options} sol2.opt"
case ${enable_threads}:${have_pthread_h}:${have_thread_h} in
"":yes:* | yes:yes:* )
thread_file=posix
;;
esac
;;
*-*-*vms*)
extra_options="${extra_options} vms/vms.opt"
xmake_file=vms/x-vms
tmake_file="vms/t-vms t-slibgcc"
extra_objs="vms.o"
target_gtfiles="$target_gtfiles \$(srcdir)/config/vms/vms.c"
tm_p_file="${tm_p_file} vms/vms-protos.h"
xm_file="vms/xm-vms.h"
c_target_objs="vms-c.o"
cxx_target_objs="vms-c.o"
fortran_target_objs="vms-f.o"
use_gcc_stdint=provide
tm_file="${tm_file} vms/vms-stdint.h"
if test x$gnu_ld != xyes; then
# Build wrappers for native case.
extra_programs="ld\$(exeext) ar\$(exeext)"
tmake_file="$tmake_file vms/t-vmsnative"
fi
;;
*-*-vxworks*)
tmake_file=t-vxworks
xm_defines=POSIX
extra_options="${extra_options} vxworks.opt"
extra_objs="$extra_objs vxworks.o"
case ${enable_threads} in
no) ;;
"" | yes | vxworks) thread_file='vxworks' ;;
*) echo 'Unknown thread configuration for VxWorks'; exit 1 ;;
esac
;;
*-*-elf|arc*-*-elf*)
# Assume that newlib is being used and so __cxa_atexit is provided.
default_use_cxa_atexit=yes
use_gcc_stdint=wrap
;;
esac
case ${target} in
aarch64*-*-elf)
tm_file="${tm_file} dbxelf.h elfos.h newlib-stdint.h"
tm_file="${tm_file} aarch64/aarch64-elf.h aarch64/aarch64-elf-raw.h"
tmake_file="${tmake_file} aarch64/t-aarch64"
use_gcc_stdint=wrap
case $target in
aarch64_be-*)
tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1"
;;
esac
aarch64_multilibs="${with_multilib_list}"
if test "$aarch64_multilibs" = "default"; then
aarch64_multilibs="lp64,ilp32"
fi
aarch64_multilibs=`echo $aarch64_multilibs | sed -e 's/,/ /g'`
for aarch64_multilib in ${aarch64_multilibs}; do
case ${aarch64_multilib} in
ilp32 | lp64 )
TM_MULTILIB_CONFIG="${TM_MULTILIB_CONFIG},${aarch64_multilib}"
;;
*)
echo "--with-multilib-list=${aarch64_multilib} not supported."
exit 1
esac
done
TM_MULTILIB_CONFIG=`echo $TM_MULTILIB_CONFIG | sed 's/^,//'`
;;
aarch64*-*-linux*)
tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h"
tm_file="${tm_file} aarch64/aarch64-elf.h aarch64/aarch64-linux.h"
tmake_file="${tmake_file} aarch64/t-aarch64 aarch64/t-aarch64-linux"
case $target in
aarch64_be-*)
tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1"
;;
esac
aarch64_multilibs="${with_multilib_list}"
if test "$aarch64_multilibs" = "default"; then
# TODO: turn on ILP32 multilib build after its support is mature.
# aarch64_multilibs="lp64,ilp32"
aarch64_multilibs="lp64"
fi
aarch64_multilibs=`echo $aarch64_multilibs | sed -e 's/,/ /g'`
for aarch64_multilib in ${aarch64_multilibs}; do
case ${aarch64_multilib} in
ilp32 | lp64 )
TM_MULTILIB_CONFIG="${TM_MULTILIB_CONFIG},${aarch64_multilib}"
;;
*)
echo "--with-multilib-list=${aarch64_multilib} not supported."
exit 1
esac
done
TM_MULTILIB_CONFIG=`echo $TM_MULTILIB_CONFIG | sed 's/^,//'`
;;
alpha*-*-linux*)
tm_file="elfos.h ${tm_file} alpha/elf.h alpha/linux.h alpha/linux-elf.h glibc-stdint.h"
tmake_file="${tmake_file} alpha/t-linux"
extra_options="${extra_options} alpha/elf.opt"
;;
alpha*-*-freebsd*)
tm_file="elfos.h ${tm_file} ${fbsd_tm_file} alpha/elf.h alpha/freebsd.h"
extra_options="${extra_options} alpha/elf.opt"
;;
alpha*-*-netbsd*)
tm_file="elfos.h ${tm_file} netbsd.h alpha/elf.h netbsd-elf.h alpha/netbsd.h"
extra_options="${extra_options} netbsd.opt netbsd-elf.opt \
alpha/elf.opt"
;;
alpha*-*-openbsd*)
tm_defines="${tm_defines} OBSD_HAS_DECLARE_FUNCTION_NAME OBSD_HAS_DECLARE_FUNCTION_SIZE OBSD_HAS_DECLARE_OBJECT"
tm_file="elfos.h alpha/alpha.h alpha/elf.h openbsd.h openbsd-stdint.h alpha/openbsd.h openbsd-libpthread.h"
extra_options="${extra_options} openbsd.opt alpha/elf.opt"
# default x-alpha is only appropriate for dec-osf.
;;
alpha*-dec-*vms*)
tm_file="${tm_file} vms/vms.h alpha/vms.h"
tmake_file="${tmake_file} alpha/t-vms"
;;
arc*-*-elf*)
extra_headers="arc-simd.h"
tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file}"
tmake_file="arc/t-arc-newlib arc/t-arc"
case x"${with_cpu}" in
xarc600|xarc601|xarc700)
target_cpu_default="TARGET_CPU_$with_cpu"
;;
esac
if test x${with_endian} = x; then
case ${target} in
arc*be-*-* | arc*eb-*-*) with_endian=big ;;
*) with_endian=little ;;
esac
fi
case ${with_endian} in
big|little) ;;
*) echo "with_endian=${with_endian} not supported."; exit 1 ;;
esac
case ${with_endian} in
big*) tm_defines="DRIVER_ENDIAN_SELF_SPECS=\\\"%{!EL:%{!mlittle-endian:-mbig-endian}}\\\" ${tm_defines}"
esac
;;
arc*-*-linux-uclibc*)
extra_headers="arc-simd.h"
tm_file="dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h ${tm_file}"
tmake_file="${tmake_file} arc/t-arc-uClibc arc/t-arc"
tm_defines="${tm_defines} TARGET_SDATA_DEFAULT=0"