arm: Optimize arm-mlib.h header inclusion [pr108505].
[official-gcc.git] / gcc / config.gcc
bloba5b854d68b5eee54d020617e81c7ab68aa960056
1 # SPDX-License-Identifier: GPL-3.0-or-later
2 # GCC target-specific configuration file.
3 # Copyright (C) 1997-2022 Free Software Foundation, Inc.
5 #This file is part of GCC.
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.
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.
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/>.
21 # This is the GCC target-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 target-specific information.
27 # When you change the cases in the OS or target switches, consider
28 # updating ../libgcc/config.host also.
30 # This file switches on the shell variable ${target}, and also uses the
31 # following shell variables:
33 #  with_*               Various variables as set by configure.
35 #  enable_threads       Either the name, yes or no depending on whether
36 #                       threads support was requested.
38 #  default_use_cxa_atexit
39 #                         The default value for the $enable___cxa_atexit
40 #                       variable.  enable___cxa_atexit needs to be set to
41 #                       "yes" for the correct operation of C++ destructors
42 #                       but it relies upon the presence of a non-standard C
43 #                       library function called __cxa_atexit.
44 #                         Since not all C libraries provide __cxa_atexit the
45 #                       default value of $default_use_cxa_atexit is set to
46 #                       "no" except for targets which are known to be OK.
48 #  default_gnu_indirect_function
49 #                       The default value for the $enable_gnu_indirect_function
50 #                       variable.  enable_gnu_indirect_function relies
51 #                       upon the presence of a non-standard gnu ifunc support
52 #                       in the assembler, linker and dynamic linker.
53 #                       Since not all libraries provide the dynamic linking
54 #                       support, the default value of
55 #                       $default_gnu_indirect_function is set to
56 #                       "no" except for targets which are known to be OK.
58 #  gas_flag             Either yes or no depending on whether GNU as was
59 #                       requested.
61 #  gnu_ld_flag          Either yes or no depending on whether GNU ld was
62 #                       requested.
64 # This file sets the following shell variables for use by the
65 # autoconf-generated configure script:
67 #  cpu_type             The name of the cpu, if different from the first
68 #                       chunk of the canonical target name.
70 #  tm_defines           List of target macros to define for all compilations.
72 #  tm_file              A list of target macro files, if different from
73 #                       "$cpu_type/$cpu_type.h". Usually it's constructed
74 #                       per target in a way like this:
75 #                       tm_file="${tm_file} dbxelf.h elfos.h ${cpu_type.h}/elf.h"
76 #                       Note that the preferred order is:
77 #                       - specific target header "${cpu_type}/${cpu_type.h}"
78 #                       - generic headers like dbxelf.h elfos.h, etc.
79 #                       - specializing target headers like ${cpu_type.h}/elf.h
80 #                       This helps to keep OS specific stuff out of the CPU
81 #                       defining header ${cpu_type}/${cpu_type.h}.
83 #                       It is possible to include automatically-generated
84 #                       build-directory files by prefixing them with "./".
85 #                       All other files should relative to $srcdir/config.
87 #  tm_p_file            Location of file with declarations for functions
88 #                       in $out_file.
90 #  tm_d_file            A list of headers with definitions of target hook
91 #                       macros for the D compiler.
93 #  out_file             The name of the machine description C support
94 #                       file, if different from "$cpu_type/$cpu_type.c".
96 #  common_out_file      The name of the source file for code shared between
97 #                       the compiler proper and the driver.
99 #  md_file              The name of the machine-description file, if
100 #                       different from "$cpu_type/$cpu_type.md".
102 #  tmake_file           A list of machine-description-specific
103 #                       makefile-fragments, if different from
104 #                       "$cpu_type/t-$cpu_type".
106 #  extra_modes          The name of the file containing a list of extra
107 #                       machine modes, if necessary and different from
108 #                       "$cpu_type/$cpu_type-modes.def".
110 #  extra_objs           List of extra objects that should be linked into
111 #                       the compiler proper (cc1, cc1obj, cc1plus)
112 #                       depending on target.
114 #  extra_gcc_objs       List of extra objects that should be linked into
115 #                       the compiler driver (gcc) depending on target.
117 #  extra_headers        List of used header files from the directory
118 #                       config/${cpu_type}.
120 #  user_headers_inc_next_pre
121 #                       List of header file names of internal gcc header
122 #                       files, which should be prefixed by an include_next.
123 #  user_headers_inc_next_post
124 #                       List of header file names of internal gcc header
125 #                       files, which should be postfixed by an include_next.
126 #  use_gcc_tgmath       If set, add tgmath.h to the list of used header
127 #                       files.
129 #  use_gcc_stdint       If "wrap", install a version of stdint.h that
130 #                       wraps the system's copy for hosted compilations;
131 #                       if "provide", provide a version of systems without
132 #                       such a system header; otherwise "none", do not
133 #                       provide such a header at all.
135 #  extra_programs       List of extra executables compiled for this target
136 #                       machine, used when linking.
138 #  extra_options        List of target-dependent .opt files.
140 #  c_target_objs        List of extra target-dependent objects that be
141 #                       linked into the C compiler only.
143 #  cxx_target_objs      List of extra target-dependent objects that be
144 #                       linked into the C++ compiler only.
146 #  d_target_objs        List of extra target-dependent objects that be
147 #                       linked into the D compiler only.
149 #  fortran_target_objs  List of extra target-dependent objects that be
150 #                       linked into the fortran compiler only.
152 #  target_gtfiles       List of extra source files with type information.
154 #  xm_defines           List of macros to define when compiling for the
155 #                       target machine.
157 #  xm_file              List of files to include when compiling for the
158 #                       target machine.
160 #  use_collect2         Set to yes or no, depending on whether collect2
161 #                       will be used.
163 #  target_cpu_default   Set to override the default target model.
165 #  gdb_needs_out_file_path
166 #                       Set to yes if gdb needs a dir command with
167 #                       `dirname $out_file`.
169 #  thread_file          Set to control which thread package to use.
171 #  gas                  Set to yes or no depending on whether the target
172 #                       system normally uses GNU as.
174 #  configure_default_options
175 #                       Set to an initializer for configure_default_options
176 #                       in configargs.h, based on --with-cpu et cetera.
178 #  native_system_header_dir
179 #                       Where system header files are found for this
180 #                       target.  This defaults to /usr/include.  If
181 #                       the --with-sysroot configure option or the
182 #                       --sysroot command line option is used this
183 #                       will be relative to the sysroot.
184 # target_type_format_char 
185 #                       The default character to be used for formatting
186 #                       the attribute in a
187 #                       .type symbol_name, ${t_t_f_c}<property>
188 #                       directive.
190 # The following variables are used in each case-construct to build up the
191 # outgoing variables:
193 #  gnu_ld               Set to yes or no depending on whether the target
194 #                       system normally uses GNU ld.
196 #  target_has_targetcm  Set to yes or no depending on whether the target
197 #                       has its own definition of targetcm.
199 #  target_has_targetm_common    Set to yes or no depending on whether the
200 #                       target has its own definition of targetm_common.
202 #  target_has_targetdm  Set to yes or no depending on whether the target
203 #                       has its own definition of targetdm.
205 out_file=
206 common_out_file=
207 tmake_file=
208 extra_headers=
209 user_headers_inc_next_pre=
210 user_headers_inc_next_post=
211 use_gcc_tgmath=yes
212 use_gcc_stdint=none
213 extra_programs=
214 extra_objs=
215 extra_gcc_objs=
216 extra_options=
217 c_target_objs=
218 cxx_target_objs=
219 d_target_objs=
220 fortran_target_objs=
221 target_has_targetcm=no
222 target_has_targetm_common=yes
223 target_has_targetdm=no
224 tm_defines=
225 xm_defines=
226 # Set this to force installation and use of collect2.
227 use_collect2=
228 # Set this to override the default target model.
229 target_cpu_default=
230 # Set this if gdb needs a dir command with `dirname $out_file`
231 gdb_needs_out_file_path=
232 # Set this to control which thread package will be used.
233 thread_file=
234 # Reinitialize these from the flag values every loop pass, since some
235 # configure entries modify them.
236 gas="$gas_flag"
237 gnu_ld="$gnu_ld_flag"
238 default_use_cxa_atexit=no
239 default_gnu_indirect_function=no
240 target_gtfiles=
241 need_64bit_isa=
242 native_system_header_dir=/usr/include
243 target_type_format_char='@'
245 # Don't carry these over build->host->target.  Please.
246 xm_file=
247 md_file=
249 # Obsolete configurations.
250 case ${target} in
251   tile*-*-*                             \
252  | cr16-*-*                             \
253  | hppa[12]*-*-hpux10*                  \
254  | hppa[12]*-*-hpux11*                  \
255  | m32c-*-rtems*                        \
257     if test "x$enable_obsolete" != xyes; then
258       echo "*** Configuration ${target} is obsolete." >&2
259       echo "*** Specify --enable-obsolete to build it anyway." >&2
260       echo "*** Support will be REMOVED in the next major release of GCC," >&2
261       echo "*** unless a maintainer comes forward." >&2
262       exit 1
263     fi;;
264 esac
266 # Unsupported targets list.  Do not put an entry in this list unless
267 # it would otherwise be caught by a more permissive pattern.  The list
268 # should be in alphabetical order.
269 case ${target} in
270  # Avoid special cases that are not obsolete
271    arm*-*-*eabi*                        \
273         ;;
274    arm*-wince-pe*                       \
275  | arm*-*-ecos-elf                      \
276  | arm*-*-elf                           \
277  | arm*-*-linux*                        \
278  | arm*-*-uclinux*                      \
279  | cris-*-linux*                        \
280  | crisv32-*-*                          \
281  | i[34567]86-go32-*                    \
282  | i[34567]86-*-go32*                   \
283  | m32r-*-linux*                        \
284  | m32rle-*-linux*                      \
285  | m68k*-*-openbsd*                     \
286  | m68k-*-uclinuxoldabi*                \
287  | mips64orion*-*-rtems*                \
288  | pdp11-*-bsd                          \
289  | powerpc*-*-linux*paired*             \
290  | powerpc*-*-*spe*                     \
291  | sparc-hal-solaris2*                  \
292  | spu*-*-*                             \
293  | thumb-*-*                            \
294  | *-*-freebsd[12] | *-*-freebsd[1234].* \
295  | *-*-freebsd*aout*                    \
296  | *-*-linux*aout*                      \
297  | *-*-linux*coff*                      \
298  | *-*-linux*libc1*                     \
299  | *-*-linux*oldld*                     \
300  | *-*-rtemsaout*                       \
301  | *-*-rtemscoff*                       \
302  | *-*-solaris2                         \
303  | *-*-solaris2.[0-9]                   \
304  | *-*-solaris2.[0-9].*                 \
305  | *-*-solaris2.10*                     \
306  | *-*-sysv*                            \
307  | vax-*-vms*                           \
309         echo "*** Configuration ${target} not supported" 1>&2
310         exit 1
311         ;;
312 esac
314 # Set default cpu_type, tm_file, tm_p_file and xm_file so it can be
315 # updated in each machine entry.  Also set default extra_headers for some
316 # machines.
317 tm_p_file=
318 cpu_type=`echo ${target} | sed 's/-.*$//'`
319 cpu_is_64bit=
320 case ${target} in
321 m32c*-*-*)
322         cpu_type=m32c
323         tmake_file=m32c/t-m32c
324         target_has_targetm_common=no
325         ;;
326 aarch64*-*-*)
327         cpu_type=aarch64
328         extra_headers="arm_fp16.h arm_neon.h arm_bf16.h arm_acle.h arm_sve.h"
329         c_target_objs="aarch64-c.o"
330         cxx_target_objs="aarch64-c.o"
331         d_target_objs="aarch64-d.o"
332         extra_objs="aarch64-builtins.o aarch-common.o aarch64-sve-builtins.o aarch64-sve-builtins-shapes.o aarch64-sve-builtins-base.o aarch64-sve-builtins-sve2.o cortex-a57-fma-steering.o aarch64-speculation.o falkor-tag-collision-avoidance.o aarch-bti-insert.o aarch64-cc-fusion.o"
333         target_gtfiles="\$(srcdir)/config/aarch64/aarch64-builtins.cc \$(srcdir)/config/aarch64/aarch64-sve-builtins.h \$(srcdir)/config/aarch64/aarch64-sve-builtins.cc"
334         target_has_targetm_common=yes
335         ;;
336 alpha*-*-*)
337         cpu_type=alpha
338         extra_options="${extra_options} g.opt"
339         ;;
340 amdgcn*)
341         cpu_type=gcn
342         use_gcc_stdint=wrap
343         ;;
344 am33_2.0-*-linux*)
345         cpu_type=mn10300
346         ;;
347 arc*-*-*)
348         cpu_type=arc
349         c_target_objs="arc-c.o"
350         cxx_target_objs="arc-c.o"
351         extra_options="${extra_options} arc/arc-tables.opt g.opt"
352         extra_headers="arc-simd.h"
353         ;;
354 arm*-*-*)
355         cpu_type=arm
356         extra_objs="arm-builtins.o arm-mve-builtins.o aarch-common.o aarch-bti-insert.o"
357         extra_headers="mmintrin.h arm_neon.h arm_acle.h arm_fp16.h arm_cmse.h arm_bf16.h arm_mve_types.h arm_mve.h arm_cde.h"
358         target_type_format_char='%'
359         c_target_objs="arm-c.o"
360         cxx_target_objs="arm-c.o"
361         d_target_objs="arm-d.o"
362         extra_options="${extra_options} arm/arm-tables.opt"
363         target_gtfiles="\$(srcdir)/config/arm/arm-builtins.cc \$(srcdir)/config/arm/arm-mve-builtins.h \$(srcdir)/config/arm/arm-mve-builtins.cc"
364         ;;
365 avr-*-*)
366         cpu_type=avr
367         c_target_objs="avr-c.o"
368         cxx_target_objs="avr-c.o"
369         ;;
370 bfin*-*)
371         cpu_type=bfin
372         ;;
373 bpf-*-*)
374         cpu_type=bpf
375         ;;
376 frv*)   cpu_type=frv
377         extra_options="${extra_options} g.opt"
378         ;;
379 ft32*)  cpu_type=ft32
380         target_has_targetm_common=no
381         ;;
382 moxie*) cpu_type=moxie
383         target_has_targetm_common=no
384         ;;
385 fido-*-*)
386         cpu_type=m68k
387         extra_headers=math-68881.h
388         extra_options="${extra_options} m68k/m68k-tables.opt"
389         ;;
390 i[34567]86-*-* | x86_64-*-*)
391         cpu_type=i386
392         c_target_objs="i386-c.o"
393         cxx_target_objs="i386-c.o"
394         d_target_objs="i386-d.o"
395         extra_objs="x86-tune-sched.o x86-tune-sched-bd.o x86-tune-sched-atom.o x86-tune-sched-core.o i386-options.o i386-builtins.o i386-expand.o i386-features.o"
396         target_gtfiles="\$(srcdir)/config/i386/i386-builtins.cc \$(srcdir)/config/i386/i386-expand.cc \$(srcdir)/config/i386/i386-options.cc"
397         extra_options="${extra_options} fused-madd.opt"
398         extra_headers="cpuid.h mmintrin.h mm3dnow.h xmmintrin.h emmintrin.h
399                        pmmintrin.h tmmintrin.h ammintrin.h smmintrin.h
400                        nmmintrin.h bmmintrin.h fma4intrin.h wmmintrin.h
401                        immintrin.h x86intrin.h avxintrin.h xopintrin.h
402                        ia32intrin.h cross-stdarg.h lwpintrin.h popcntintrin.h
403                        lzcntintrin.h bmiintrin.h bmi2intrin.h tbmintrin.h
404                        avx2intrin.h avx512fintrin.h fmaintrin.h f16cintrin.h
405                        rtmintrin.h xtestintrin.h rdseedintrin.h prfchwintrin.h
406                        adxintrin.h fxsrintrin.h xsaveintrin.h xsaveoptintrin.h
407                        avx512cdintrin.h avx512erintrin.h avx512pfintrin.h
408                        shaintrin.h clflushoptintrin.h xsavecintrin.h
409                        xsavesintrin.h avx512dqintrin.h avx512bwintrin.h
410                        avx512vlintrin.h avx512vlbwintrin.h avx512vldqintrin.h
411                        avx512ifmaintrin.h avx512ifmavlintrin.h avx512vbmiintrin.h
412                        avx512vbmivlintrin.h avx5124fmapsintrin.h avx5124vnniwintrin.h
413                        avx512vpopcntdqintrin.h clwbintrin.h mwaitxintrin.h
414                        clzerointrin.h pkuintrin.h sgxintrin.h cetintrin.h
415                        gfniintrin.h cet.h avx512vbmi2intrin.h
416                        avx512vbmi2vlintrin.h avx512vnniintrin.h
417                        avx512vnnivlintrin.h vaesintrin.h vpclmulqdqintrin.h
418                        avx512vpopcntdqvlintrin.h avx512bitalgintrin.h
419                        pconfigintrin.h wbnoinvdintrin.h movdirintrin.h
420                        waitpkgintrin.h cldemoteintrin.h avx512bf16vlintrin.h
421                        avx512bf16intrin.h enqcmdintrin.h serializeintrin.h
422                        avx512vp2intersectintrin.h avx512vp2intersectvlintrin.h
423                        tsxldtrkintrin.h amxtileintrin.h amxint8intrin.h
424                        amxbf16intrin.h x86gprintrin.h uintrintrin.h
425                        hresetintrin.h keylockerintrin.h avxvnniintrin.h
426                        mwaitintrin.h avx512fp16intrin.h avx512fp16vlintrin.h"
427         ;;
428 ia64-*-*)
429         extra_headers=ia64intrin.h
430         extra_options="${extra_options} g.opt fused-madd.opt"
431         ;;
432 hppa*-*-*)
433         cpu_type=pa
434         ;;
435 lm32*)
436         extra_options="${extra_options} g.opt"
437         ;;
438 m32r*-*-*)
439         cpu_type=m32r
440         extra_options="${extra_options} g.opt"
441         ;;
442 m68k-*-*)
443         extra_headers=math-68881.h
444         extra_options="${extra_options} m68k/m68k-tables.opt"
445         ;;
446 microblaze*-*-*)
447         cpu_type=microblaze
448         extra_options="${extra_options} g.opt"
449         ;;
450 mips*-*-*)
451         cpu_type=mips
452         d_target_objs="mips-d.o"
453         extra_headers="loongson.h loongson-mmiintrin.h msa.h"
454         extra_objs="frame-header-opt.o"
455         extra_options="${extra_options} g.opt fused-madd.opt mips/mips-tables.opt"
456         ;;
457 loongarch*-*-*)
458         cpu_type=loongarch
459         extra_headers="larchintrin.h"
460         extra_objs="loongarch-c.o loongarch-builtins.o loongarch-cpu.o loongarch-opts.o loongarch-def.o"
461         extra_gcc_objs="loongarch-driver.o loongarch-cpu.o loongarch-opts.o loongarch-def.o"
462         extra_options="${extra_options} g.opt fused-madd.opt"
463         ;;
464 nds32*)
465         cpu_type=nds32
466         extra_headers="nds32_intrinsic.h nds32_isr.h nds32_init.inc"
467         case ${target} in
468           nds32*-*-linux*)
469             extra_options="${extra_options} nds32/nds32-linux.opt"
470             ;;
471           nds32*-*-elf*)
472             extra_options="${extra_options} nds32/nds32-elf.opt"
473             ;;
474           *)
475             ;;
476         esac
477         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 nds32-relax-opt.o nds32-utils.o"
478         ;;
479 nios2-*-*)
480         cpu_type=nios2
481         extra_options="${extra_options} g.opt"
482         ;;
483 nvptx-*-*)
484         cpu_type=nvptx
485         c_target_objs="nvptx-c.o"
486         cxx_target_objs="nvptx-c.o"
487         extra_options="${extra_options} nvptx/nvptx-gen.opt"
488         ;;
489 or1k*-*-*)
490         cpu_type=or1k
491         ;;
492 powerpc*-*-*)
493         cpu_type=rs6000
494         extra_objs="rs6000-string.o rs6000-p8swap.o rs6000-logue.o"
495         extra_objs="${extra_objs} rs6000-call.o rs6000-pcrel-opt.o"
496         extra_objs="${extra_objs} rs6000-builtins.o rs6000-builtin.o"
497         extra_headers="ppc-asm.h altivec.h htmintrin.h htmxlintrin.h"
498         extra_headers="${extra_headers} bmi2intrin.h bmiintrin.h"
499         extra_headers="${extra_headers} xmmintrin.h mm_malloc.h emmintrin.h"
500         extra_headers="${extra_headers} mmintrin.h x86intrin.h"
501         extra_headers="${extra_headers} pmmintrin.h tmmintrin.h smmintrin.h"
502         extra_headers="${extra_headers} nmmintrin.h immintrin.h x86gprintrin.h"
503         extra_headers="${extra_headers} ppu_intrinsics.h spu2vmx.h vec_types.h si2vmx.h"
504         extra_headers="${extra_headers} amo.h"
505         case x$with_cpu in
506             xpowerpc64|xdefault64|x6[23]0|x970|xG5|xpower[3456789]|xpower10|xpower6x|xrs64a|xcell|xa2|xe500mc64|xe5500|xe6500)
507                 cpu_is_64bit=yes
508                 ;;
509         esac
510         extra_options="${extra_options} g.opt fused-madd.opt rs6000/rs6000-tables.opt"
511         target_gtfiles="$target_gtfiles \$(srcdir)/config/rs6000/rs6000-logue.cc \$(srcdir)/config/rs6000/rs6000-call.cc"
512         target_gtfiles="$target_gtfiles \$(srcdir)/config/rs6000/rs6000-pcrel-opt.cc"
513         target_gtfiles="$target_gtfiles ./rs6000-builtins.h"
514         ;;
515 pru-*-*)
516         cpu_type=pru
517         ;;
518 riscv*)
519         cpu_type=riscv
520         extra_objs="riscv-builtins.o riscv-c.o riscv-sr.o riscv-shorten-memrefs.o"
521         d_target_objs="riscv-d.o"
522         ;;
523 rs6000*-*-*)
524         extra_options="${extra_options} g.opt fused-madd.opt rs6000/rs6000-tables.opt"
525         extra_objs="rs6000-string.o rs6000-p8swap.o rs6000-logue.o"
526         extra_objs="${extra_objs} rs6000-call.o rs6000-pcrel-opt.o"
527         target_gtfiles="$target_gtfiles \$(srcdir)/config/rs6000/rs6000-logue.cc \$(srcdir)/config/rs6000/rs6000-call.cc"
528         target_gtfiles="$target_gtfiles \$(srcdir)/config/rs6000/rs6000-pcrel-opt.cc"
529         ;;
530 sparc*-*-*)
531         cpu_type=sparc
532         c_target_objs="sparc-c.o"
533         cxx_target_objs="sparc-c.o"
534         d_target_objs="sparc-d.o"
535         extra_headers="visintrin.h"
536         ;;
537 s390*-*-*)
538         cpu_type=s390
539         d_target_objs="s390-d.o"
540         extra_options="${extra_options} fused-madd.opt"
541         extra_headers="s390intrin.h htmintrin.h htmxlintrin.h vecintrin.h"
542         ;;
543 # Note the 'l'; we need to be able to match e.g. "shle" or "shl".
544 sh[123456789lbe]*-*-* | sh-*-*)
545         cpu_type=sh
546         extra_options="${extra_options} fused-madd.opt"
547         extra_objs="${extra_objs} sh_treg_combine.o sh-mem.o sh_optimize_sett_clrt.o"
548         ;;
549 v850*-*-*)
550         cpu_type=v850
551         ;;
552 tic6x-*-*)
553         cpu_type=c6x
554         extra_headers="c6x_intrinsics.h"
555         extra_options="${extra_options} c6x/c6x-tables.opt"
556         ;;
557 xtensa*-*-*)
558         extra_options="${extra_options} fused-madd.opt"
559         ;;
560 tilegx*-*-*)
561         cpu_type=tilegx
562         ;;
563 tilepro*-*-*)
564         cpu_type=tilepro
565         ;;
566 esac
568 tm_file=${cpu_type}/${cpu_type}.h
569 if test -f ${srcdir}/config/${cpu_type}/${cpu_type}-protos.h
570 then
571         tm_p_file=${cpu_type}/${cpu_type}-protos.h
574 tm_d_file=
575 if test -f ${srcdir}/config/${cpu_type}/${cpu_type}-d.h
576 then
577         tm_d_file="${tm_d_file} ${cpu_type}/${cpu_type}-d.h"
580 extra_modes=
581 if test -f ${srcdir}/config/${cpu_type}/${cpu_type}-modes.def
582 then
583         extra_modes=${cpu_type}/${cpu_type}-modes.def
585 if test -f ${srcdir}/config/${cpu_type}/${cpu_type}.opt
586 then
587         extra_options="${extra_options} ${cpu_type}/${cpu_type}.opt"
590 case ${target} in
591 aarch64*-*-*)
592         tm_p_file="${tm_p_file} arm/aarch-common-protos.h"
593         case ${with_abi} in
594         "")
595                 if test "x$with_multilib_list" = xilp32; then
596                         tm_file="aarch64/biarchilp32.h ${tm_file}"
597                 else
598                         tm_file="aarch64/biarchlp64.h ${tm_file}"
599                 fi
600                 ;;
601         ilp32)
602                 tm_file="aarch64/biarchilp32.h ${tm_file}"
603                 ;;
604         lp64)
605                 tm_file="aarch64/biarchlp64.h ${tm_file}"
606                 ;;
607         *)
608                 echo "Unknown ABI used in --with-abi=$with_abi"
609                 exit 1
610         esac
611         ;;
612 i[34567]86-*-*)
613         if test "x$with_abi" != x; then
614                 echo "This target does not support --with-abi."
615                 exit 1
616         fi
617         ;;
618 x86_64-*-darwin*)
619         ;;
620 x86_64-*-*)
621         case ${with_abi} in
622         "")
623                 if test "x$with_multilib_list" = xmx32; then
624                         tm_file="i386/biarchx32.h ${tm_file}"
625                 else
626                         tm_file="i386/biarch64.h ${tm_file}"
627                 fi
628                 ;;
629         64 | m64)
630                 tm_file="i386/biarch64.h ${tm_file}"
631                 ;;
632         x32 | mx32)
633                 tm_file="i386/biarchx32.h ${tm_file}"
634                 ;;
635         *)
636                 echo "Unknown ABI used in --with-abi=$with_abi"
637                 exit 1
638         esac
639         ;;
640 arm*-*-*)
641         tm_p_file="arm/arm-flags.h ${tm_p_file} arm/aarch-common-protos.h"
642         ;;
643 esac
645 # On a.out targets, we need to use collect2.
646 case ${target} in
647 *-*-*aout*)
648         use_collect2=yes
649         ;;
650 esac
652 # Common C libraries.
653 tm_defines="$tm_defines LIBC_GLIBC=1 LIBC_UCLIBC=2 LIBC_BIONIC=3 LIBC_MUSL=4"
655 # 32-bit x86 processors supported by --with-arch=.  Each processor
656 # MUST be separated by exactly one space.
657 x86_archs="athlon athlon-4 athlon-fx athlon-mp athlon-tbird \
658 athlon-xp k6 k6-2 k6-3 geode c3 c3-2 winchip-c6 winchip2 i386 i486 \
659 i586 i686 pentium pentium-m pentium-mmx pentium2 pentium3 pentium3m \
660 pentium4 pentium4m pentiumpro prescott lakemont samuel-2 nehemiah \
661 c7 esther"
663 # 64-bit x86 processors supported by --with-arch=.  Each processor
664 # MUST be separated by exactly one space.
665 x86_64_archs="amdfam10 athlon64 athlon64-sse3 barcelona bdver1 bdver2 \
666 bdver3 bdver4 znver1 znver2 znver3 znver4 btver1 btver2 k8 k8-sse3 opteron \
667 opteron-sse3 nocona core2 corei7 corei7-avx core-avx-i core-avx2 atom \
668 slm nehalem westmere sandybridge ivybridge haswell broadwell bonnell \
669 silvermont knl knm skylake-avx512 cannonlake icelake-client icelake-server \
670 skylake goldmont goldmont-plus tremont cascadelake tigerlake cooperlake \
671 sapphirerapids alderlake rocketlake eden-x2 nano nano-1000 nano-2000 nano-3000 \
672 nano-x2 eden-x4 nano-x4 x86-64 x86-64-v2 x86-64-v3 x86-64-v4 native"
674 # Additional x86 processors supported by --with-cpu=.  Each processor
675 # MUST be separated by exactly one space.
676 x86_cpus="generic intel"
678 # Common parts for widely ported systems.
679 case ${target} in
680 *-*-darwin*)
681   tmake_file="t-darwin "
682   tm_file="${tm_file} darwin.h"
683   darwin_os=`echo ${target} | sed 's/.*darwin\([0-9.]*\).*$/\1/'`
684   darwin_maj=`expr "$darwin_os" : '\([0-9]*\).*'`
685   macos_min=`expr "$darwin_os" : '[0-9]*\.\([0-9]*\).*'`
686   macos_maj=10
687   if test x"${macos_min}" = x; then
688     macos_min=0
689   fi
690   def_ld64=85.2
691   # Tools hosted on earlier versions of Darwin constrained all object
692   # alignment to be 2^15 or smaller.  From Darwin11 (macOS 10.7) the
693   # alignment of non-common is allowed to be up to 2^28.  Note that the
694   # larger alignment is permitted when targeting 10.6 from 10.7 so that
695   # the constraint only need be applied per host (and only if the host
696   # is Darwin).
697   case ${host} in
698       *-*-darwin[4-9]* | *-*-darwin10*)
699           tm_defines="$tm_defines L2_MAX_OFILE_ALIGNMENT=15U"
700           ;;
701       *)
702           tm_defines="$tm_defines L2_MAX_OFILE_ALIGNMENT=28U"
703           ;;
704   esac
705   case ${target} in
706       # Darwin 4 to 19 correspond to macOS 10.0 to 10.15
707       *-*-darwin[4-9]* | *-*-darwin1[0-9]*)
708         macos_min=`expr $darwin_maj - 4`
709         ;;
710       *-*-darwin2*)
711         # Darwin 20 corresponds to macOS 11, Darwin 21 to macOS 12.
712         macos_maj=`expr $darwin_maj - 9`
713         def_ld64=609.0
714         ;;
715       *-*-darwin)
716         case ${cpu_type} in
717           aarch64) macos_maj=11 ;;
718           x86_64) macos_min=6 ;;
719           *)  macos_min=5 ;;
720           esac
721           case ${host} in
722             *-*-darwin*) tm_defines="$tm_defines DARWIN_USE_KERNEL_VERS" ;;
723             *)
724               # If configuring a cross-compiler then we will have set some
725               # default above, but it is probably not what was intended.
726               echo "Warning: Using ${target} is only suitable for Darwin hosts" 1>&2
727               echo "configure with an explicit target version" 1>&2
728               ;;
729           esac
730         ;;
731       *)
732         echo "Error: configuring for an unreleased macOS version ${target}" 1>&2
733         exit 1
734         ;;
735   esac
736   tm_defines="$tm_defines DEF_MIN_OSX_VERSION=\\\"${macos_maj}.${macos_min}\\\""
737   tm_defines="$tm_defines DEF_LD64=\\\"${def_ld64}\\\""
738   tm_file="${tm_file} ${cpu_type}/darwin.h"
739   tm_p_file="${tm_p_file} darwin-protos.h"
740   target_gtfiles="$target_gtfiles \$(srcdir)/config/darwin.cc"
741   extra_options="${extra_options} rpath.opt darwin.opt"
742   c_target_objs="${c_target_objs} darwin-c.o"
743   cxx_target_objs="${cxx_target_objs} darwin-c.o"
744   d_target_objs="${d_target_objs} darwin-d.o"
745   fortran_target_objs="darwin-f.o"
746   target_has_targetcm=yes
747   target_has_targetdm=yes
748   extra_objs="${extra_objs} darwin.o"
749   extra_gcc_objs="darwin-driver.o"
750   default_use_cxa_atexit=yes
751   use_gcc_stdint=wrap
752   case ${enable_threads} in
753     "" | yes | posix) thread_file='posix' ;;
754   esac
755   ;;
756 *-*-dragonfly*)
757   gas=yes
758   gnu_ld=yes
759   tmake_file="t-slibgcc"
760   case ${enable_threads} in
761     "" | yes | posix)
762       thread_file='posix'
763       ;;
764     no | single)
765       # Let these non-posix thread selections fall through if requested
766       ;;
767     *)
768       echo 'Unknown thread configuration for DragonFly BSD'
769       exit 1
770       ;;
771   esac
772   extra_options="$extra_options rpath.opt dragonfly.opt"
773   default_use_cxa_atexit=yes
774   use_gcc_stdint=wrap
775   d_target_objs="${d_target_objs} dragonfly-d.o"
776   tmake_file="${tmake_file} t-dragonfly"
777   target_has_targetdm=yes
778   ;;
779 *-*-freebsd*)
780   # This is the generic ELF configuration of FreeBSD.  Later
781   # machine-specific sections may refine and add to this
782   # configuration.
783   #
784   # Due to tm_file entry ordering issues that vary between cpu
785   # architectures, we only define fbsd_tm_file to allow the
786   # machine-specific section to dictate the final order of all
787   # entries of tm_file with the minor exception that components
788   # of the tm_file set here will always be of the form:
789   #
790   # freebsd<version_number>.h [freebsd-<conf_option>.h ...] freebsd-spec.h freebsd.h
791   #
792   # The machine-specific section should not tamper with this
793   # ordering but may order all other entries of tm_file as it
794   # pleases around the provided core setting.
795   gas=yes
796   gnu_ld=yes
797   fbsd_major=`echo ${target} | sed -e 's/.*freebsd//g' | sed -e 's/\..*//g'`
798   if test "$fbsd_major" = ""; then
799     echo "Specify the major version number of the targeted FreeBSD release"
800     echo "like this: --target=amd64-unknown-freebsd10.1"
801     exit 1
802   fi
803   tm_defines="${tm_defines} FBSD_MAJOR=${fbsd_major}"
804   tmake_file="t-slibgcc"
805   case ${enable_threads} in
806     no)
807       fbsd_tm_file="${fbsd_tm_file} freebsd-nthr.h"
808       ;;
809     "" | yes | posix)
810       thread_file='posix'
811       ;;
812     *)
813       echo 'Unknown thread configuration for FreeBSD'
814       exit 1
815       ;;
816   esac
817   fbsd_tm_file="${fbsd_tm_file} freebsd-spec.h freebsd.h freebsd-stdint.h"
818   extra_options="$extra_options rpath.opt freebsd.opt"
819   case ${target} in
820     *-*-freebsd[345].*)
821       :;;
822     *)
823       default_use_cxa_atexit=yes;;
824   esac
825   use_gcc_stdint=wrap
826   d_target_objs="${d_target_objs} freebsd-d.o"
827   tmake_file="${tmake_file} t-freebsd"
828   target_has_targetdm=yes
829   ;;
830 *-*-fuchsia*)
831   native_system_header_dir=/include
832   ;;
833 *-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-gnu* | *-*-kopensolaris*-gnu | *-*-uclinuxfdpiceabi)
834   extra_options="$extra_options gnu-user.opt"
835   gas=yes
836   gnu_ld=yes
837   case ${enable_threads} in
838     "" | yes | posix) thread_file='posix' ;;
839   esac
840   tmake_file="t-slibgcc"
841   case $target in
842     *-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-kopensolaris*-gnu)
843       :;;
844     *-*-gnu*)
845       native_system_header_dir=/include
846       ;;
847   esac
848   # Linux C libraries selection switch: glibc / uclibc / bionic.
849   # uclibc and bionic aren't usable for GNU/Hurd and neither for GNU/k*BSD.
850   case $target in
851     *linux*)
852       tm_p_file="${tm_p_file} linux-protos.h"
853       tmake_file="${tmake_file} t-linux"
854       extra_objs="${extra_objs} linux.o"
855       extra_options="${extra_options} linux.opt"
856       ;;
857   esac
858   case $target in
859     *-*-*android*)
860       tm_defines="$tm_defines DEFAULT_LIBC=LIBC_BIONIC"
861       ;;
862     *-*-*uclibc* | *-*-uclinuxfdpiceabi)
863       tm_defines="$tm_defines DEFAULT_LIBC=LIBC_UCLIBC"
864       ;;
865     *-*-*musl*)
866       tm_defines="$tm_defines DEFAULT_LIBC=LIBC_MUSL"
867       ;;
868     *)
869       tm_defines="$tm_defines DEFAULT_LIBC=LIBC_GLIBC"
870       ;;
871   esac
872   # Assume that glibc or uClibc or Bionic are being used and so __cxa_atexit
873   # is provided.
874   default_use_cxa_atexit=yes
875   use_gcc_tgmath=no
876   use_gcc_stdint=wrap
877   # Enable compilation for Android by default for *android* targets.
878   case $target in
879     *-*-*android*)
880       tm_defines="$tm_defines ANDROID_DEFAULT=1"
881       ;;
882     *)
883       tm_defines="$tm_defines ANDROID_DEFAULT=0"
884       ;;
885   esac
886   c_target_objs="${c_target_objs} glibc-c.o"
887   cxx_target_objs="${cxx_target_objs} glibc-c.o"
888   d_target_objs="${d_target_objs} glibc-d.o"
889   tmake_file="${tmake_file} t-glibc"
890   target_has_targetcm=yes
891   target_has_targetdm=yes
892   case $target in
893     *-*-*uclibc* | *-*-uclinuxfdpiceabi)
894       ;;
895     *)
896       # Linux targets always support .init_array.
897       gcc_cv_initfini_array=yes
898       ;;
899   esac
900   ;;
901 *-*-netbsd*)
902   tm_p_file="${tm_p_file} netbsd-protos.h"
903   tmake_file="t-netbsd t-slibgcc"
904   extra_objs="${extra_objs} netbsd.o"
905   d_target_objs="${d_target_objs} netbsd-d.o"
906   gas=yes
907   gnu_ld=yes
908   use_gcc_stdint=wrap
909   case ${enable_threads} in
910     "" | yes | posix) thread_file='posix' ;;
911   esac
912   nbsd_tm_file="netbsd.h netbsd-stdint.h netbsd-elf.h"
913   default_use_cxa_atexit=yes
914   target_has_targetdm=yes
915   case ${target} in
916     arm*-* | i[34567]86-* | powerpc*-* | sparc*-* | x86_64-*)
917       default_gnu_indirect_function=yes
918       ;;
919   esac
920   ;;
921 *-*-openbsd*)
922   tmake_file="t-openbsd"
923   case ${enable_threads} in
924     yes)
925       thread_file='posix'
926       ;;
927   esac
928   case ${target} in
929     *-*-openbsd4.[3-9]|*-*-openbsd[5-9]*)
930       default_use_cxa_atexit=yes
931       ;;
932   esac
933   d_target_objs="${d_target_objs} openbsd-d.o"
934   target_has_targetdm=yes
935   ;;
936 *-*-phoenix*)
937   gas=yes
938   gnu_ld=yes
939   default_use_cxa_atexit=yes
940   ;;
941 *-*-rtems*)
942   case ${enable_threads} in
943     "" | yes | rtems) thread_file='rtems' ;;
944     posix) thread_file='posix' ;;
945     no) ;;
946     *)
947       echo 'Unknown thread configuration for RTEMS'
948       exit 1
949       ;;
950   esac
951   tmake_file="${tmake_file} t-rtems"
952   extra_options="${extra_options} rtems.opt"
953   default_use_cxa_atexit=yes
954   use_gcc_stdint=wrap
955   ;;
956 *-*-uclinux*)
957   extra_options="$extra_options gnu-user.opt"
958   use_gcc_stdint=wrap
959   case ${enable_threads} in
960     "" | yes | posix) thread_file='posix' ;;
961   esac
962   tm_defines="$tm_defines DEFAULT_LIBC=LIBC_UCLIBC SINGLE_LIBC"
963   ;;
964 *-*-rdos*)
965   use_gcc_stdint=wrap
966   ;;
967 *-*-solaris2*)
968   # i?86-*-solaris2* needs to insert headers between cpu default and
969   # Solaris 2 specific ones.
970   sol2_tm_file_head="dbxelf.h elfos.h ${cpu_type}/sysv4.h"
971   sol2_tm_file_tail="${cpu_type}/sol2.h sol2.h"
972   sol2_tm_file="${sol2_tm_file_head} ${sol2_tm_file_tail}"
973   case ${target} in
974     *-*-solaris2.1[1-9]*)
975       # __cxa_atexit was introduced in Solaris 11.4.
976       default_use_cxa_atexit=yes
977       ;;
978   esac
979   use_gcc_stdint=wrap
980   if test x$gnu_ld = xyes; then
981     tm_file="usegld.h ${tm_file}"
982   fi
983   if test x$gas = xyes; then
984     tm_file="usegas.h ${tm_file}"
985   fi
986   tm_p_file="${tm_p_file} sol2-protos.h"
987   tmake_file="${tmake_file} t-sol2 t-slibgcc"
988   c_target_objs="${c_target_objs} sol2-c.o"
989   cxx_target_objs="${cxx_target_objs} sol2-c.o sol2-cxx.o"
990   d_target_objs="${d_target_objs} sol2-d.o"
991   extra_objs="${extra_objs} sol2.o sol2-stubs.o"
992   extra_options="${extra_options} sol2.opt"
993   case ${enable_threads}:${have_pthread_h}:${have_thread_h} in
994     "":yes:* | yes:yes:* )
995       thread_file=posix
996       ;;
997   esac
998   target_has_targetdm=yes
999   ;;
1000 *-*-*vms*)
1001   extra_options="${extra_options} vms/vms.opt"
1002   xmake_file=vms/x-vms
1003   tmake_file="vms/t-vms t-slibgcc"
1004   extra_objs="vms.o"
1005   target_gtfiles="$target_gtfiles \$(srcdir)/config/vms/vms.cc"
1006   tm_p_file="${tm_p_file} vms/vms-protos.h"
1007   xm_file="vms/xm-vms.h"
1008   c_target_objs="vms-c.o"
1009   cxx_target_objs="vms-c.o"
1010   fortran_target_objs="vms-f.o"
1011   use_gcc_stdint=provide
1012   tm_file="${tm_file} vms/vms-stdint.h"
1013   if test x$gnu_ld != xyes; then
1014     # Build wrappers for native case.
1015     extra_programs="ld\$(exeext) ar\$(exeext)"
1016     tmake_file="$tmake_file vms/t-vmsnative"
1017   fi
1018   ;;
1019 *-*-vxworks*)
1020   tmake_file=t-vxworks
1021   xm_defines=POSIX
1023   extra_options="${extra_options} vxworks.opt"
1024   extra_objs="$extra_objs vxworks.o"
1026   c_target_objs="${c_target_objs} vxworks-c.o"
1027   cxx_target_objs="${cxx_target_objs} vxworks-c.o"
1028   extra_headers="${extra_headers} ../vxworks/vxworks-predef.h"
1029   target_has_targetcm="yes"
1031   # This private header exposes a consistent interface for checks on
1032   # the VxWorks version our runtime header files need to perform, based on
1033   # what the system headers adverstise:
1035   extra_headers="${extra_headers} ../vxworks/_vxworks-versions.h"
1037   # Starting from VxWorks 7, the system comes with a Dinkumware
1038   # environment which requires the inclusion of "yvals.h" before other
1039   # system headers.  We provide wrapped versions of a few headers to
1040   # accomodate such constraints:
1042   extra_headers="${extra_headers} ../vxworks/_yvals.h"
1043   extra_headers="${extra_headers} ../vxworks/_yvals-wrapper.h"
1045   extra_headers="${extra_headers} ../vxworks/math.h ../vxworks/complex.h"
1046   extra_headers="${extra_headers} ../vxworks/inttypes.h ../vxworks/setjmp.h"
1048   # We provide (a tailored version of) stdint.h
1049   tm_file="${tm_file} vxworks-stdint.h"
1050   use_gcc_stdint=provide
1052   case ${enable_threads} in
1053     no) ;;
1054     "" | yes | vxworks) thread_file='vxworks' ;;
1055     *) echo 'Unknown thread configuration for VxWorks'; exit 1 ;;
1056   esac
1058   # A few common macro definitions conveying general characteristics
1059   # of the configuration at hand. Note that by VxWorks 7, we mean the
1060   # the SR6xx major update or beyond in vendor parlance:
1062   case $target in
1063     *-*-vxworks7*)
1064       tm_defines="$tm_defines TARGET_VXWORKS7=1"
1065       ;;
1066   esac
1067   case $target in
1068     *64-*-vxworks*)
1069       tm_defines="$tm_defines TARGET_VXWORKS64=1"
1070       ;;
1071   esac
1073   # Then a few build configuration controls for VxWorks 7, which
1074   # has specificities on top of which we aim to provide more complete
1075   # C++ support:
1077   case $target in
1078     *-*-vxworks7*)
1079       # VxWorks 7 always has init/fini_array support and it is simpler to
1080       # just leverage this, sticking to what the system toolchain does:
1081       gcc_cv_initfini_array=yes
1082       ;;
1083   esac
1084   ;;
1085 *-*-elf|arc*-*-elf*)
1086   # Assume that newlib is being used and so __cxa_atexit is provided.
1087   default_use_cxa_atexit=yes
1088   use_gcc_stdint=wrap
1089   ;;
1090 esac
1092 case ${target} in
1093 aarch64*-*-elf | aarch64*-*-fuchsia* | aarch64*-*-rtems*)
1094         tm_file="${tm_file} dbxelf.h elfos.h newlib-stdint.h"
1095         tm_file="${tm_file} aarch64/aarch64-elf.h aarch64/aarch64-errata.h aarch64/aarch64-elf-raw.h"
1096         tmake_file="${tmake_file} aarch64/t-aarch64"
1097         case $target in
1098         aarch64-*-elf*)
1099                 use_gcc_stdint=wrap
1100                 ;;
1101         aarch64-*-fuchsia*)
1102                 tm_file="${tm_file} fuchsia.h"
1103                 ;;
1104         aarch64-*-rtems*)
1105                 tm_file="${tm_file} aarch64/rtems.h rtems.h"
1106                 ;;
1107         esac
1108         case $target in
1109         aarch64_be-*)
1110                 tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1"
1111                 ;;
1112         esac
1113         aarch64_multilibs="${with_multilib_list}"
1114         if test "$aarch64_multilibs" = "default"; then
1115                 aarch64_multilibs="lp64,ilp32"
1116         fi
1117         aarch64_multilibs=`echo $aarch64_multilibs | sed -e 's/,/ /g'`
1118         for aarch64_multilib in ${aarch64_multilibs}; do
1119                 case ${aarch64_multilib} in
1120                 ilp32 | lp64 )
1121                         TM_MULTILIB_CONFIG="${TM_MULTILIB_CONFIG},${aarch64_multilib}"
1122                         ;;
1123                 *)
1124                         echo "--with-multilib-list=${aarch64_multilib} not supported."
1125                         exit 1
1126                 esac
1127         done
1128         TM_MULTILIB_CONFIG=`echo $TM_MULTILIB_CONFIG | sed 's/^,//'`
1129         ;;
1130 aarch64*-*-freebsd*)
1131         tm_file="${tm_file} dbxelf.h elfos.h ${fbsd_tm_file}"
1132         tm_file="${tm_file} aarch64/aarch64-elf.h aarch64/aarch64-errata.h aarch64/aarch64-freebsd.h"
1133         tmake_file="${tmake_file} aarch64/t-aarch64 aarch64/t-aarch64-freebsd"
1134         tm_defines="${tm_defines}  TARGET_DEFAULT_ASYNC_UNWIND_TABLES=1"
1135         ;;
1136 aarch64*-*-netbsd*)
1137         tm_file="${tm_file} dbxelf.h elfos.h ${nbsd_tm_file}"
1138         tm_file="${tm_file} aarch64/aarch64-elf.h aarch64/aarch64-errata.h aarch64/aarch64-netbsd.h"
1139         tmake_file="${tmake_file} aarch64/t-aarch64 aarch64/t-aarch64-netbsd"
1140         extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
1141         ;;
1142 aarch64*-*-linux*)
1143         tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h"
1144         tm_file="${tm_file} aarch64/aarch64-elf.h aarch64/aarch64-errata.h aarch64/aarch64-linux.h"
1145         tmake_file="${tmake_file} aarch64/t-aarch64 aarch64/t-aarch64-linux"
1146         tm_defines="${tm_defines}  TARGET_DEFAULT_ASYNC_UNWIND_TABLES=1"
1147         case $target in
1148         aarch64_be-*)
1149                 tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1"
1150                 ;;
1151         esac
1152         aarch64_multilibs="${with_multilib_list}"
1153         if test "$aarch64_multilibs" = "default"; then
1154                 # TODO: turn on ILP32 multilib build after its support is mature.
1155                 # aarch64_multilibs="lp64,ilp32"
1156                 aarch64_multilibs="lp64"
1157         fi
1158         aarch64_multilibs=`echo $aarch64_multilibs | sed -e 's/,/ /g'`
1159         for aarch64_multilib in ${aarch64_multilibs}; do
1160                 case ${aarch64_multilib} in
1161                 ilp32 | lp64 )
1162                         TM_MULTILIB_CONFIG="${TM_MULTILIB_CONFIG},${aarch64_multilib}"
1163                         ;;
1164                 *)
1165                         echo "--with-multilib-list=${aarch64_multilib} not supported."
1166                         exit 1
1167                 esac
1168         done
1169         TM_MULTILIB_CONFIG=`echo $TM_MULTILIB_CONFIG | sed 's/^,//'`
1170         ;;
1171 aarch64*-wrs-vxworks*)
1172         tm_file="${tm_file} elfos.h aarch64/aarch64-elf.h"
1173         tm_file="${tm_file} vx-common.h vxworks.h aarch64/aarch64-vxworks.h"
1174         tmake_file="${tmake_file} aarch64/t-aarch64 aarch64/t-aarch64-vxworks"
1175         ;;
1176 alpha*-*-linux*)
1177         tm_file="elfos.h ${tm_file} alpha/elf.h alpha/linux.h alpha/linux-elf.h glibc-stdint.h"
1178         tmake_file="${tmake_file} alpha/t-linux alpha/t-alpha"
1179         extra_options="${extra_options} alpha/elf.opt"
1180         ;;
1181 alpha*-*-netbsd*)
1182         tm_file="elfos.h ${tm_file} ${nbsd_tm_file} alpha/elf.h alpha/netbsd.h"
1183         tmake_file="${tmake_file} alpha/t-alpha"
1184         extra_options="${extra_options} netbsd.opt netbsd-elf.opt \
1185                        alpha/elf.opt"
1186         ;;
1187 alpha*-*-openbsd*)
1188         tm_defines="${tm_defines} OBSD_HAS_DECLARE_FUNCTION_NAME OBSD_HAS_DECLARE_FUNCTION_SIZE OBSD_HAS_DECLARE_OBJECT"
1189         tm_file="elfos.h alpha/alpha.h alpha/elf.h openbsd.h openbsd-stdint.h alpha/openbsd.h openbsd-libpthread.h"
1190         tmake_file="${tmake_file} alpha/t-alpha"
1191         extra_options="${extra_options} openbsd.opt alpha/elf.opt"
1192         # default x-alpha is only appropriate for dec-osf.
1193         ;;
1194 alpha*-dec-*vms*)
1195         tm_file="${tm_file} vms/vms.h alpha/vms.h"
1196         tmake_file="${tmake_file} alpha/t-vms alpha/t-alpha"
1197         ;;
1198 arc*-*-elf*)
1199         tm_file="arc/arc-arch.h dbxelf.h elfos.h newlib-stdint.h arc/elf.h ${tm_file}"
1200         tmake_file="arc/t-multilib arc/t-arc"
1201         extra_gcc_objs="driver-arc.o"
1202         if test "x$with_cpu" != x; then
1203                 tm_defines="${tm_defines} TARGET_CPU_BUILD=PROCESSOR_$with_cpu"
1204         fi
1205         if test x${with_endian} = x; then
1206                 case ${target} in
1207                 arc*be-*-* | arc*eb-*-*)        with_endian=big ;;
1208                 *)                              with_endian=little ;;
1209                 esac
1210         fi
1211         case ${with_endian} in
1212         big|little)             ;;
1213         *)      echo "with_endian=${with_endian} not supported."; exit 1 ;;
1214         esac
1215         case ${with_endian} in
1216         big*)   tm_file="arc/big.h ${tm_file}"
1217         esac
1218         ;;
1219 arc*-*-linux*)
1220         tm_file="arc/arc-arch.h dbxelf.h elfos.h gnu-user.h linux.h linux-android.h glibc-stdint.h arc/linux.h ${tm_file}"
1221         tmake_file="${tmake_file} arc/t-multilib-linux arc/t-arc"
1222         extra_gcc_objs="driver-arc.o"
1223         if test "x$with_cpu" != x; then
1224                 tm_defines="${tm_defines} TARGET_CPU_BUILD=PROCESSOR_$with_cpu"
1225         fi
1226         if test x${with_endian} = x; then
1227                 case ${target} in
1228                 arc*be-*-* | arc*eb-*-*)        with_endian=big ;;
1229                 *)                              with_endian=little ;;
1230                 esac
1231         fi
1232         case ${with_endian} in
1233         big|little)             ;;
1234         *)      echo "with_endian=${with_endian} not supported."; exit 1 ;;
1235         esac
1236         case ${with_endian} in
1237         big*)   tm_file="arc/big.h ${tm_file}"
1238         esac
1239         # Force .init_array support.  The configure script cannot always
1240         # automatically detect that GAS supports it, yet we require it.
1241         gcc_cv_initfini_array=yes
1242         ;;
1243 arm-wrs-vxworks7*)
1244         # We only support VxWorks 7 now on ARM, post SR600.  Pre SR600
1245         # VxWorks 7 was transitory and major versions prior to 7 were based
1246         # on long deprecated ABI, not supported at all any more regardless
1247         # of VxWorks.
1248         extra_options="${extra_options} arm/vxworks.opt"
1249         tmake_file="${tmake_file} arm/t-arm arm/t-vxworks arm/t-bpabi"
1250         tm_file="elfos.h arm/elf.h arm/bpabi.h arm/aout.h ${tm_file}"
1251         tm_file="${tm_file} vx-common.h vxworks.h arm/vxworks.h"
1252         target_cpu_cname="generic-armv7-a"
1253         need_64bit_hwint=yes
1254         ;;
1255 arm*-*-freebsd*)                # ARM FreeBSD EABI
1256         tm_file="dbxelf.h elfos.h ${fbsd_tm_file} arm/elf.h"
1257         case $target in
1258         arm*b-*-freebsd*)
1259             tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1"
1260             ;;
1261         esac
1262         tmake_file="${tmake_file} arm/t-arm arm/t-bpabi"
1263         tm_file="${tm_file} arm/bpabi.h arm/freebsd.h arm/aout.h arm/arm.h"
1264         case $target in
1265         armv6*-*-freebsd*)
1266             target_cpu_cname="arm1176jzf-s"
1267             if test $fbsd_major -ge 11; then
1268                tm_defines="${tm_defines} TARGET_FREEBSD_ARM_HARD_FLOAT=1"
1269             fi
1270             ;;
1271         armv7*-*-freebsd*)
1272             target_cpu_cname="generic-armv7-a"
1273             tm_defines="${tm_defines} TARGET_FREEBSD_ARM_HARD_FLOAT=1"
1274             ;;
1275         *)
1276             target_cpu_cname="arm9"
1277             ;;
1278         esac
1279         with_tls=${with_tls:-gnu}
1280         ;;
1281 arm*-*-netbsdelf*)
1282         target_cpu_cname="strongarm"
1283         tmake_file="${tmake_file} arm/t-arm"
1284         tm_file="dbxelf.h elfos.h ${nbsd_tm_file} arm/elf.h"
1285         extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
1286         case ${target} in
1287         arm*eb-*) tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1" ;;
1288         esac
1289         case ${target} in
1290         arm*-*-netbsdelf-*eabi*)
1291             tm_file="$tm_file arm/bpabi.h arm/netbsd-elf.h arm/netbsd-eabi.h"
1292             tmake_file="$tmake_file arm/t-bpabi arm/t-netbsdeabi"
1293             ;;
1294         *)
1295             tm_file="$tm_file arm/netbsd-elf.h"
1296             tmake_file="$tmake_file arm/t-netbsd"
1297             ;;
1298         esac
1299         tm_file="${tm_file} arm/aout.h arm/arm.h"
1300         case ${target} in
1301         arm*-*-netbsdelf-*eabihf*)
1302             # Hard-float requires at least Arm v5te
1303             target_cpu_cname="arm10e"
1304             tm_defines="${tm_defines} TARGET_DEFAULT_FLOAT_ABI=ARM_FLOAT_ABI_HARD"
1305             ;;
1306         esac
1307         case ${target} in
1308         armv6*) target_cpu_cname="arm1176jzf-s";;
1309         armv7*) target_cpu_cname="generic-armv7-a";;
1310         esac
1311         ;;
1312 arm*-*-linux-* | arm*-*-uclinuxfdpiceabi)
1313         tm_file="dbxelf.h elfos.h gnu-user.h linux.h linux-android.h glibc-stdint.h arm/elf.h arm/linux-gas.h arm/linux-elf.h"
1314         extra_options="${extra_options} linux-android.opt"
1315         case $target in
1316         arm*b-*-linux*)
1317             tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1"
1318             ;;
1319         esac
1320         tmake_file="${tmake_file} arm/t-arm arm/t-arm-elf arm/t-bpabi arm/t-linux-eabi"
1321         tm_file="$tm_file arm/bpabi.h arm/linux-eabi.h arm/aout.h arm/arm.h"
1322         case $target in
1323         arm*-*-uclinuxfdpiceabi)
1324             tm_file="$tm_file arm/uclinuxfdpiceabi.h"
1325             ;;
1326         esac
1327         # Generation of floating-point instructions requires at least ARMv5te.
1328         if [ "$with_float" = "hard" -o "$with_float" = "softfp" ] ; then
1329             target_cpu_cname="arm10e"
1330         else
1331             target_cpu_cname="arm10tdmi"
1332         fi
1333         # Define multilib configuration for arm-linux-androideabi.
1334         case ${target} in
1335         *-androideabi)
1336             tmake_file="$tmake_file arm/t-linux-androideabi"
1337             ;;
1338         esac
1339         # The EABI requires the use of __cxa_atexit.
1340         default_use_cxa_atexit=yes
1341         with_tls=${with_tls:-gnu}
1342         ;;
1343 arm*-*-uclinux*eabi*)           # ARM ucLinux
1344         tm_file="dbxelf.h elfos.h arm/unknown-elf.h arm/elf.h arm/linux-gas.h arm/uclinux-elf.h glibc-stdint.h"
1345         tmake_file="${tmake_file} arm/t-arm arm/t-arm-elf arm/t-bpabi"
1346         tm_file="$tm_file arm/bpabi.h arm/uclinux-eabi.h arm/aout.h arm/arm.h"
1347         target_cpu_cname="arm7tdmi"
1348         # The EABI requires the use of __cxa_atexit.
1349         default_use_cxa_atexit=yes
1350         ;;
1351 arm*-*-phoenix*)
1352         tm_file="elfos.h arm/unknown-elf.h arm/elf.h arm/bpabi.h"
1353         tm_file="${tm_file} newlib-stdint.h phoenix.h"
1354         tm_file="${tm_file} arm/aout.h arm/arm.h"
1355         tmake_file="${tmake_file} arm/t-arm arm/t-bpabi arm/t-phoenix"
1356         target_cpu_cname="arm7tdmi"
1357         ;;
1358 arm*-*-eabi* | arm*-*-symbianelf* | arm*-*-rtems* | arm*-*-fuchsia*)
1359         case ${target} in
1360         arm*eb-*-eabi*)
1361           tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1"
1362         esac
1363         default_use_cxa_atexit=yes
1364         tm_file="dbxelf.h elfos.h arm/unknown-elf.h arm/elf.h arm/bpabi.h"
1365         tmake_file="${tmake_file} arm/t-arm arm/t-arm-elf"
1366         target_cpu_cname="arm7tdmi"
1367         case ${target} in
1368         arm*-*-eabi*)
1369           tm_file="$tm_file newlib-stdint.h"
1370           tmake_file="${tmake_file} arm/t-bpabi"
1371           use_gcc_stdint=wrap
1372           ;;
1373         arm*-*-fuchsia*)
1374           tm_file="${tm_file} fuchsia.h arm/fuchsia-elf.h glibc-stdint.h"
1375           tmake_file="${tmake_file} arm/t-bpabi arm/t-fuchsia"
1376           target_cpu_cname="generic-armv7-a"
1377           ;;
1378         arm*-*-rtems*)
1379           tm_file="${tm_file} arm/rtems.h rtems.h newlib-stdint.h"
1380           tmake_file="${tmake_file} arm/t-bpabi arm/t-rtems"
1381           ;;
1382         arm*-*-symbianelf*)
1383           tm_file="${tm_file} arm/symbian.h"
1384           # We do not include t-bpabi for Symbian OS because the system
1385           # provides its own implementation of the BPABI functions.
1386           tmake_file="${tmake_file} arm/t-symbian"
1387           target_cpu_cname="arm10tdmi"
1388           ;;
1389         esac
1390         tm_file="${tm_file} arm/aout.h arm/arm.h"
1391         ;;
1392 avr-*-*)
1393         tm_file="elfos.h avr/elf.h avr/avr-arch.h avr/avr.h avr/specs.h dbxelf.h avr/avr-stdint.h"
1394         if test x${with_avrlibc} != xno; then
1395             tm_file="${tm_file} ${cpu_type}/avrlibc.h"
1396             tm_defines="${tm_defines} WITH_AVRLIBC"
1397         fi
1398         # Work out avr_double_comparison which is 2 or 3 and is used in
1399         # target hook FLOAT_LIB_COMPARE_RETURNS_BOOL to determine whether
1400         # DFmode comparisons return 3-state or 2-state results.
1401         case y${with_double_comparison} in
1402             y | ytristate)
1403                 avr_double_comparison=3
1404                 ;;
1405             ybool | ylibf7)
1406                 avr_double_comparison=2
1407                 ;;
1408             *)
1409                 echo "Error: --with-double-comparison= can only be used with: 'tristate', 'bool', 'libf7'" 1>&2
1410                 exit 1
1411                 ;;
1412         esac
1413         case "y${with_libf7}" in
1414             yno)
1415                 # avr_double_comparison as set above.
1416                 ;;
1417             ylibgcc)
1418                 avr_double_comparison=2
1419                 tm_defines="${tm_defines} WITH_LIBF7_LIBGCC"
1420                 ;;
1421             y | yyes | ymath-symbols)
1422                 avr_double_comparison=2
1423                 tm_defines="${tm_defines} WITH_LIBF7_LIBGCC"
1424                 tm_defines="${tm_defines} WITH_LIBF7_MATH"
1425                 tm_defines="${tm_defines} WITH_LIBF7_MATH_SYMBOLS"
1426                 ;;
1427             ymath)
1428                 avr_double_comparison=2
1429                 tm_defines="${tm_defines} WITH_LIBF7_LIBGCC"
1430                 tm_defines="${tm_defines} WITH_LIBF7_MATH"
1431                 ;;
1432             *)
1433                 echo "Error: --with-libf7=${with_libf7} but can only be used with: 'libgcc', 'math', 'math-symbols', 'yes', 'no'" 1>&2
1434                 exit 1
1435                 ;;
1436         esac
1437         tm_defines="${tm_defines} WITH_DOUBLE_COMPARISON=${avr_double_comparison}"
1438         case y${with_double} in
1439             y32)
1440                 avr_double=32
1441                 tm_defines="${tm_defines} HAVE_DOUBLE32"
1442                 ;;
1443             y64)
1444                 avr_double=64
1445                 tm_defines="${tm_defines} HAVE_DOUBLE64"
1446                 ;;
1447             y64,32)
1448                 avr_double=64
1449                 avr_double_multilib=1
1450                 tm_defines="${tm_defines} HAVE_DOUBLE32"
1451                 tm_defines="${tm_defines} HAVE_DOUBLE64"
1452                 tm_defines="${tm_defines} HAVE_DOUBLE_MULTILIB"
1453                 ;;
1454             y | y32,64)
1455                 avr_double=32
1456                 avr_double_multilib=1
1457                 tm_defines="${tm_defines} HAVE_DOUBLE32"
1458                 tm_defines="${tm_defines} HAVE_DOUBLE64"
1459                 tm_defines="${tm_defines} HAVE_DOUBLE_MULTILIB"
1460                 ;;
1461             *)
1462                 echo "Error: --with-double= can only be used with: '32', '32,64', '64,32', '64'" 1>&2
1463                 exit 1
1464                 ;;
1465         esac
1466         case y${with_long_double} in
1467             y32)
1468                 avr_long_double=32
1469                 tm_defines="${tm_defines} HAVE_LONG_DOUBLE32"
1470                 ;;
1471             y64)
1472                 avr_long_double=64
1473                 tm_defines="${tm_defines} HAVE_LONG_DOUBLE64"
1474                 ;;
1475             y | y64,32)
1476                 avr_long_double=64
1477                 avr_long_double_multilib=1
1478                 tm_defines="${tm_defines} HAVE_LONG_DOUBLE32"
1479                 tm_defines="${tm_defines} HAVE_LONG_DOUBLE64"
1480                 tm_defines="${tm_defines} HAVE_LONG_DOUBLE_MULTILIB"
1481                 ;;
1482             y32,64)
1483                 avr_long_double=32
1484                 avr_long_double_multilib=1
1485                 tm_defines="${tm_defines} HAVE_LONG_DOUBLE32"
1486                 tm_defines="${tm_defines} HAVE_LONG_DOUBLE64"
1487                 tm_defines="${tm_defines} HAVE_LONG_DOUBLE_MULTILIB"
1488                 ;;
1489             ydouble)
1490                 avr_long_double=${avr_double}
1491                 tm_defines="${tm_defines} HAVE_LONG_DOUBLE_IS_DOUBLE"
1492                 if test y${avr_double_multilib} = y1; then
1493                     tm_defines="${tm_defines} HAVE_LONG_DOUBLE32"
1494                     tm_defines="${tm_defines} HAVE_LONG_DOUBLE64"
1495                 else
1496                     tm_defines="${tm_defines} HAVE_LONG_DOUBLE${avr_long_double}"
1497                 fi
1498                 ;;
1499             *)
1500                 echo "Error: --with-long_double= can only be used with: '32', '32,64', '64,32', '64', 'double'" 1>&2
1501                 exit 1
1502                 ;;
1503         esac
1504         if test ${avr_long_double}x${avr_long_double_multilib}y${avr_double_multilib}z = 32xy1z; then
1505             if test y${with_long_double} != ydouble; then
1506                 echo "Error: --with-double=${with_double} requests a multilib for double, but long double is always 32 bits wide due to --with-long-double=${with_long_double}" 1>&2
1507                 exit 1
1508             fi
1509         fi
1510         if test ${avr_double}x${avr_long_double_multilib}y${avr_double_multilib}z = 64x1yz; then
1511             echo "Error: --with-long-double=${with_long_double} requests a multilib for long double, but double is always 64 bits wide due to --with-double=64" 1>&2
1512             exit 1
1513         fi
1514         if test y${avr_double}${avr_long_double} = y6432; then
1515             echo "Error: double default of 64 bits from --with-double=${with_double} conflicts with default of 32 bits for long double from --with-long-double=${with_long_double}" 1>&2
1516             exit 1
1517         fi
1518         tm_defines="${tm_defines} WITH_DOUBLE${avr_double}"
1519         tm_defines="${tm_defines} WITH_LONG_DOUBLE${avr_long_double}"
1520         tmake_file="${tmake_file} avr/t-avr avr/t-multilib"
1521         use_gcc_stdint=wrap
1522         extra_gcc_objs="driver-avr.o avr-devices.o"
1523         extra_objs="avr-devices.o avr-log.o"
1524         ;;
1525 bfin*-elf*)
1526         tm_file="${tm_file} dbxelf.h elfos.h newlib-stdint.h bfin/elf.h"
1527         tmake_file=bfin/t-bfin-elf
1528         use_collect2=no
1529         ;;
1530 bfin*-uclinux*)
1531         tm_file="${tm_file} dbxelf.h elfos.h bfin/elf.h gnu-user.h linux.h glibc-stdint.h bfin/uclinux.h"
1532         tmake_file=bfin/t-bfin-uclinux
1533         use_collect2=no
1534         ;;
1535 bfin*-linux-uclibc*)
1536         tm_file="${tm_file} dbxelf.h elfos.h bfin/elf.h gnu-user.h linux.h glibc-stdint.h bfin/linux.h ./linux-sysroot-suffix.h"
1537         tmake_file="${tmake_file} bfin/t-bfin-linux"
1538         use_collect2=no
1539         ;;
1540 bfin*-rtems*)
1541         tm_file="${tm_file} dbxelf.h elfos.h bfin/elf.h bfin/rtems.h rtems.h newlib-stdint.h"
1542         tmake_file="${tmake_file} bfin/t-rtems"
1543         ;;
1544 bfin*-*)
1545         tm_file="${tm_file} dbxelf.h elfos.h newlib-stdint.h bfin/elf.h"
1546         use_collect2=no
1547         use_gcc_stdint=wrap
1548         ;;
1549 bpf-*-*)
1550         tm_file="elfos.h ${tm_file}"
1551         tmake_file="${tmake_file} bpf/t-bpf"
1552         use_collect2=no
1553         extra_headers="bpf-helpers.h"
1554         use_gcc_stdint=provide
1555         extra_objs="coreout.o"
1556         target_gtfiles="$target_gtfiles \$(srcdir)/config/bpf/coreout.cc"
1557         ;;
1558 cr16-*-elf)
1559         tm_file="elfos.h ${tm_file} newlib-stdint.h"
1560         tmake_file="${tmake_file} cr16/t-cr16 "
1561         use_collect2=no
1562         ;;
1563 cris-*-elf | cris-*-none)
1564         tm_file="elfos.h newlib-stdint.h ${tm_file}"
1565         tmake_file="cris/t-cris cris/t-elfmulti"
1566         gas=yes
1567         extra_options="${extra_options} cris/elf.opt"
1568         use_gcc_stdint=wrap
1569         ;;
1570 csky-*-*)
1571         if test x${with_endian} != x; then
1572             case ${with_endian} in
1573                 big|little)             ;;
1574                 *)
1575                     echo "with_endian=${with_endian} not supported."
1576                     exit 1
1577                     ;;
1578             esac
1579         fi
1580         if test x${with_float} != x; then
1581             case ${with_float} in
1582                 soft | hard) ;;
1583                 *) echo
1584                     "Unknown floating point type used in --with-float=$with_float"
1585                     exit 1
1586                     ;;
1587             esac
1588         fi
1589         tm_file="csky/csky.h"
1590         md_file="csky/csky.md"
1591         out_file="csky/csky.cc"
1592         tm_p_file="${tm_p_file} csky/csky-protos.h"
1593         extra_options="${extra_options} csky/csky_tables.opt"
1595         if test x${enable_tpf_debug} = xyes; then
1596             tm_defines="${tm_defines} ENABLE_TPF_DEBUG"
1597         fi
1599         case ${target} in
1600             csky-*-elf*)
1601                 tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file} csky/csky-elf.h"
1602                 tmake_file="csky/t-csky csky/t-csky-elf"
1603                 default_use_cxa_atexit=no
1604                 use_gcc_stdint=wrap
1605                 ;;
1606             csky-*-linux*)
1607                 tm_file="dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h ${tm_file} csky/csky-linux-elf.h"
1608                 tmake_file="${tmake_file} csky/t-csky csky/t-csky-linux"
1610                 case ${target} in
1611                     csky-*-linux-gnu*)
1612                         tm_defines="$tm_defines DEFAULT_LIBC=LIBC_GLIBC"
1613                         # Force .init_array support.  The configure script cannot always
1614                         # automatically detect that GAS supports it, yet we require it.
1615                         gcc_cv_initfini_array=yes
1616                         ;;
1617                     csky-*-linux-uclibc*)
1618                         tm_defines="$tm_defines DEFAULT_LIBC=LIBC_UCLIBC"
1619                         default_use_cxa_atexit=no
1620                         ;;
1621                     *)
1622                         echo "Unknown target $target"
1623                         exit 1
1624                         ;;
1625                 esac
1626                 ;;
1627             *)
1628                 echo "Unknown target $target"
1629                 exit 1
1630                 ;;
1631         esac
1632         ;;
1633 epiphany-*-elf | epiphany-*-rtems*)
1634         tm_file="dbxelf.h elfos.h ${tm_file}"
1635         tmake_file="${tmake_file} epiphany/t-epiphany"
1636         case ${target} in
1637         epiphany-*-rtems*)
1638           tm_file="${tm_file} epiphany/rtems.h rtems.h newlib-stdint.h"
1639           ;;
1640         *)
1641           tm_file="${tm_file} newlib-stdint.h"
1642           ;;
1643         esac
1644         extra_options="${extra_options} fused-madd.opt"
1645         extra_objs="${extra_objs} mode-switch-use.o resolve-sw-modes.o"
1646         tm_defines="${tm_defines} EPIPHANY_STACK_OFFSET=${with_stack_offset:-8}"
1647         extra_headers="epiphany_intrinsics.h"
1648         ;;
1649 fr30-*-elf)
1650         tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file}"
1651         ;;
1652 frv-*-elf)
1653         tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file}"
1654         tmake_file=frv/t-frv
1655         ;;
1656 frv-*-*linux*)
1657         tm_file="dbxelf.h elfos.h ${tm_file} \
1658                  gnu-user.h linux.h glibc-stdint.h frv/linux.h"
1659         tmake_file="${tmake_file} frv/t-frv frv/t-linux"
1660         ;;
1661 ft32-*-elf)
1662         gas=yes
1663         gnu_ld=yes
1664         tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file}"
1665         tmake_file="${tmake_file} ft32/t-ft32"
1666         ;;
1667 amdgcn-*-amdhsa)
1668         tm_file="elfos.h gcn/gcn-hsa.h gcn/gcn.h newlib-stdint.h"
1669         tmake_file="gcn/t-gcn-hsa"
1670         native_system_header_dir=/include
1671         extra_modes=gcn/gcn-modes.def
1672         extra_objs="${extra_objs} gcn-tree.o"
1673         extra_gcc_objs="driver-gcn.o"
1674         case "$host" in
1675         x86_64*-*-linux-gnu )
1676                 if test "$ac_cv_search_dlopen" != no; then
1677                         extra_programs="${extra_programs} gcn-run\$(exeext)"
1678                 fi
1679                 ;;
1680         esac
1681         if test x$enable_as_accelerator = xyes; then
1682                 extra_programs="${extra_programs} mkoffload\$(exeext)"
1683                 tm_file="${tm_file} gcn/offload.h"
1684         fi
1685         # Force .init_array support.
1686         gcc_cv_initfini_array=yes
1687         thread_file=gcn
1688         ;;
1689 moxie-*-elf)
1690         gas=yes
1691         gnu_ld=yes
1692         tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file}"
1693         tmake_file="${tmake_file} moxie/t-moxie"
1694         ;;
1695 moxie-*-uclinux*)
1696         gas=yes
1697         gnu_ld=yes
1698         tm_file="dbxelf.h elfos.h ${tm_file} gnu-user.h linux.h glibc-stdint.h moxie/uclinux.h"
1699         tmake_file="${tmake_file} moxie/t-moxie"
1700         ;;
1701 moxie-*-rtems*)
1702         tmake_file="${tmake_file} moxie/t-moxie"
1703         tm_file="moxie/moxie.h dbxelf.h elfos.h moxie/rtems.h rtems.h newlib-stdint.h"
1704         ;;
1705 moxie-*-moxiebox*)
1706         gas=yes
1707         gnu_ld=yes
1708         tm_file="${tm_file} dbxelf.h elfos.h moxie/moxiebox.h newlib-stdint.h"
1709         tmake_file="${tmake_file} moxie/t-moxiebox"
1710         ;;
1711 h8300-*-elf*)
1712         tmake_file="h8300/t-h8300"
1713         tm_file="h8300/h8300.h elfos.h newlib-stdint.h h8300/elf.h"
1714         ;;
1715 h8300-*-linux*)
1716         tmake_file="${tmake_file} h8300/t-h8300 h8300/t-linux"
1717         tm_file="h8300/h8300.h elfos.h gnu-user.h linux.h glibc-stdint.h h8300/linux.h"
1718         ;;
1719 hppa*64*-*-linux*)
1720         target_cpu_default="MASK_PA_11|MASK_PA_20"
1721         tm_file="pa/pa64-start.h ${tm_file} dbxelf.h elfos.h gnu-user.h linux.h \
1722                  glibc-stdint.h pa/pa-linux.h pa/pa64-regs.h pa/pa-64.h \
1723                  pa/pa64-linux.h"
1724         tmake_file="${tmake_file} pa/t-pa pa/t-linux"
1725         d_target_objs="${d_target_objs} pa-d.o"
1726         gas=yes gnu_ld=yes
1727         ;;
1728 hppa*-*-linux*)
1729         target_cpu_default="MASK_PA_11|MASK_NO_SPACE_REGS|MASK_CALLER_COPIES"
1730         tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h pa/pa-linux.h \
1731                  pa/pa32-regs.h pa/pa32-linux.h"
1732         tmake_file="${tmake_file} pa/t-pa pa/t-linux"
1733         d_target_objs="${d_target_objs} pa-d.o"
1734         ;;
1735 hppa*-*-openbsd*)
1736         target_cpu_default="MASK_PA_11"
1737         tm_file="${tm_file} dbxelf.h elfos.h openbsd.h openbsd-stdint.h openbsd-libpthread.h \
1738                  pa/pa-openbsd.h pa/pa32-regs.h pa/pa32-openbsd.h"
1739         extra_options="${extra_options} openbsd.opt"
1740         tmake_file="pa/t-pa"
1741         d_target_objs="${d_target_objs} pa-d.o"
1742         gas=yes
1743         gnu_ld=yes
1744         ;;
1745 hppa*-*-netbsd*)
1746         target_cpu_default="MASK_PA_11|MASK_NO_SPACE_REGS"
1747         tm_file="${tm_file} dbxelf.h elfos.h ${nbsd_tm_file} \
1748                  pa/pa-netbsd.h pa/pa32-regs.h pa/pa32-netbsd.h"
1749         tmake_file="${tmake_file}"
1750         tm_defines="${tm_defines} CHAR_FAST8=1 SHORT_FAST16=1"
1751         extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
1752         ;;
1753 hppa[12]*-*-hpux10*)
1754         case ${target} in
1755         hppa1.1-*-* | hppa2*-*-*)
1756                 target_cpu_default="MASK_PA_11"
1757                 ;;
1758         esac
1759         tm_file="${tm_file} pa/pa32-regs.h dbxelf.h pa/som.h \
1760                  pa/pa-hpux.h pa/pa-hpux10.h"
1761         extra_options="${extra_options} pa/pa-hpux.opt pa/pa-hpux10.opt"
1762         case ${target} in
1763         *-*-hpux10.[1-9]*)
1764                 tm_file="${tm_file} pa/pa-hpux1010.h"
1765                 extra_options="${extra_options} pa/pa-hpux1010.opt"
1766                 ;;
1767         esac
1768         use_gcc_stdint=provide
1769         tm_file="${tm_file} hpux-stdint.h"
1770         tmake_file="pa/t-pa t-slibgcc"
1771         d_target_objs="${d_target_objs} pa-d.o"
1772         case ${enable_threads} in
1773           "")
1774             if test x$have_pthread_h = xyes ; then
1775               tmake_file="${tmake_file} pa/t-dce-thr"
1776             fi
1777             ;;
1778           yes | dce)
1779             tmake_file="${tmake_file} pa/t-dce-thr"
1780             ;;
1781         esac
1782         use_collect2=yes
1783         gas=yes
1784         if test "x$with_dwarf2" != x; then
1785                 echo "Warning: dwarf2 debug format is not supported for this target, --with-dwarf2 ignored" 1>&2
1786                 dwarf2=no
1787         fi
1788         ;;
1789 hppa*64*-*-hpux11*)
1790         target_cpu_default="MASK_PA_11|MASK_PA_20"
1791         if test x$gnu_ld = xyes
1792         then
1793                 target_cpu_default="${target_cpu_default}|MASK_GNU_LD"
1794         fi
1795         tm_file="pa/pa64-start.h ${tm_file} dbxelf.h elfos.h \
1796                  pa/pa64-regs.h pa/pa-hpux.h pa/pa-hpux1010.h \
1797                  pa/pa-hpux11.h"
1798         case ${target} in
1799         *-*-hpux11.[12]*)
1800                 tm_file="${tm_file} pa/pa-hpux1111.h pa/pa-64.h pa/pa64-hpux.h"
1801                 extra_options="${extra_options} pa/pa-hpux1111.opt"
1802                 ;;
1803         *-*-hpux11.[3-9]*)
1804                 tm_file="${tm_file} pa/pa-hpux1131.h pa/pa-64.h pa/pa64-hpux.h"
1805                 extra_options="${extra_options} pa/pa-hpux1131.opt"
1806                 ;;
1807         *)
1808                 tm_file="${tm_file} pa/pa-64.h pa/pa64-hpux.h"
1809                 ;;
1810         esac
1811         extra_options="${extra_options} pa/pa-hpux.opt \
1812                        pa/pa-hpux1010.opt pa/pa64-hpux.opt hpux11.opt"
1813         tmake_file="pa/t-pa t-slibgcc"
1814         d_target_objs="${d_target_objs} pa-d.o"
1815         case x${enable_threads} in
1816         x | xyes | xposix )
1817                 thread_file=posix
1818                 ;;
1819         esac
1820         gas=yes
1821         case ${target} in
1822           *-*-hpux11.[01]*)
1823                 use_gcc_stdint=provide
1824                 tm_file="${tm_file} hpux-stdint.h"
1825                 ;;
1826           *-*-hpux11.[23]*)
1827                 use_gcc_stdint=wrap
1828                 tm_file="${tm_file} hpux-stdint.h"
1829                 ;;
1830         esac
1831         ;;
1832 hppa[12]*-*-hpux11*)
1833         case ${target} in
1834         hppa1.1-*-* | hppa2*-*-*)
1835                 target_cpu_default="MASK_PA_11"
1836                 ;;
1837         esac
1838         tm_file="${tm_file} pa/pa32-regs.h dbxelf.h pa/som.h \
1839                  pa/pa-hpux.h pa/pa-hpux1010.h pa/pa-hpux11.h"
1840         extra_options="${extra_options} pa/pa-hpux.opt pa/pa-hpux1010.opt \
1841                        hpux11.opt"
1842         case ${target} in
1843         *-*-hpux11.[12]*)
1844                 tm_file="${tm_file} pa/pa-hpux1111.h"
1845                 extra_options="${extra_options} pa/pa-hpux1111.opt"
1846                 ;;
1847         *-*-hpux11.[3-9]*)
1848                 tm_file="${tm_file} pa/pa-hpux1131.h"
1849                 extra_options="${extra_options} pa/pa-hpux1131.opt"
1850                 ;;
1851         esac
1852         tmake_file="pa/t-pa t-slibgcc"
1853         d_target_objs="${d_target_objs} pa-d.o"
1854         case x${enable_threads} in
1855         x | xyes | xposix )
1856                 thread_file=posix
1857                 ;;
1858         esac
1859         use_collect2=yes
1860         gas=yes
1861         case ${target} in
1862           *-*-hpux11.[01]*)
1863                 use_gcc_stdint=provide
1864                 tm_file="${tm_file} hpux-stdint.h"
1865                 ;;
1866           *-*-hpux11.[23]*)
1867                 use_gcc_stdint=wrap
1868                 tm_file="${tm_file} hpux-stdint.h"
1869                 ;;
1870         esac
1871         if test "x$with_dwarf2" != x; then
1872                 echo "Warning: dwarf2 debug format is not supported for this target, --with-dwarf2 ignored" 1>&2
1873                 dwarf2=no
1874         fi
1875         ;;
1876 i[34567]86-*-darwin1[89]* | i[34567]86-*-darwin2*)
1877         echo "Error: 32bit target is not supported after Darwin17" 1>&2
1878         ;;
1879 i[34567]86-*-darwin*)
1880         need_64bit_isa=yes
1881         # Baseline choice for a machine that allows m64 support.
1882         with_cpu=${with_cpu:-core2}
1883         tmake_file="${tmake_file} ${cpu_type}/t-darwin32-biarch t-slibgcc"
1884         tm_file="${cpu_type}/darwin32-biarch.h ${tm_file} "
1885         ;;
1886 x86_64-*-darwin1[89]* | x86_64-*-darwin2*)
1887         # Only 64b from now
1888         tm_defines="${tm_defines} TARGET_64BIT_DEFAULT=(OPTION_MASK_ISA_64BIT|OPTION_MASK_ABI_64)"
1889         tm_defines="${tm_defines} TARGET_BI_ARCH=0"
1890         with_cpu=${with_cpu:-core2}
1891         tmake_file="${tmake_file} t-slibgcc"
1892         ;;
1893 x86_64-*-darwin*)
1894         with_cpu=${with_cpu:-core2}
1895         tmake_file="${tmake_file} ${cpu_type}/t-darwin64-biarch t-slibgcc"
1896         tm_file="${cpu_type}/darwin64-biarch.h ${tm_file} "
1897         ;;
1898 i[34567]86-*-elfiamcu)
1899         tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h newlib-stdint.h i386/iamcu.h"
1900         ;;
1901 i[34567]86-*-elf*)
1902         tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h newlib-stdint.h i386/i386elf.h"
1903         ;;
1904 x86_64-*-elf*)
1905         tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h newlib-stdint.h i386/i386elf.h i386/x86-64.h"
1906         ;;
1907 x86_64-*-rtems*)
1908         tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h newlib-stdint.h i386/i386elf.h i386/x86-64.h i386/rtemself.h rtems.h"
1909         ;;
1910 i[34567]86-*-rdos*)
1911     tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h newlib-stdint.h i386/i386elf.h i386/rdos.h"
1912     ;;
1913 x86_64-*-rdos*)
1914     tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h newlib-stdint.h i386/i386elf.h i386/x86-64.h i386/rdos.h i386/rdos64.h"
1915     tmake_file="i386/t-i386elf t-svr4"
1916     ;;
1917 i[34567]86-*-dragonfly*)
1918         tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h dragonfly.h dragonfly-stdint.h i386/dragonfly.h"
1919         tmake_file="${tmake_file} i386/t-crtstuff"
1920         ;;
1921 x86_64-*-dragonfly*)
1922         tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h dragonfly.h dragonfly-stdint.h i386/x86-64.h i386/dragonfly.h"
1923         tmake_file="${tmake_file} i386/t-crtstuff"
1924         ;;
1925 i[34567]86-*-freebsd*)
1926         tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h ${fbsd_tm_file} i386/freebsd.h"
1927         ;;
1928 x86_64-*-freebsd*)
1929         tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h ${fbsd_tm_file} i386/x86-64.h i386/freebsd.h i386/freebsd64.h"
1930         ;;
1931 i[34567]86-*-netbsdelf*)
1932         tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h ${nbsd_tm_file} i386/netbsd-elf.h"
1933         extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
1934         ;;
1935 x86_64-*-netbsd*)
1936         tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h ${nbsd_tm_file} i386/x86-64.h i386/netbsd64.h"
1937         extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
1938         ;;
1939 i[34567]86-*-openbsd*)
1940         tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h"
1941         tm_file="${tm_file} openbsd.h openbsd-stdint.h openbsd-libpthread.h i386/openbsdelf.h"
1942         extra_options="${extra_options} openbsd.opt"
1943         gas=yes
1944         gnu_ld=yes
1945         ;;
1946 x86_64-*-openbsd*)
1947         tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h"
1948         tm_file="${tm_file} openbsd.h openbsd-stdint.h openbsd-libpthread.h i386/x86-64.h i386/openbsdelf.h"
1949         extra_options="${extra_options} openbsd.opt"
1950         gas=yes
1951         gnu_ld=yes
1952         ;;
1953 i[34567]86-*-linux* | i[34567]86-*-kfreebsd*-gnu | i[34567]86-*-gnu* | i[34567]86-*-kopensolaris*-gnu)
1954                         # Intel 80386's running GNU/*
1955                         # with ELF format using glibc 2
1956         tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h gnu-user.h glibc-stdint.h"
1957         case ${target} in
1958         i[34567]86-*-linux*)
1959                 tm_file="${tm_file} linux.h linux-android.h"
1960                 extra_options="${extra_options} linux-android.opt"
1961                 if test x$enable_targets = xall; then
1962                         tm_file="${tm_file} i386/x86-64.h i386/gnu-user-common.h i386/gnu-user64.h i386/linux-common.h i386/linux64.h"
1963                         tm_defines="${tm_defines} TARGET_BI_ARCH=1"
1964                         tmake_file="${tmake_file} i386/t-linux64"
1965                         x86_multilibs="${with_multilib_list}"
1966                         if test "$x86_multilibs" = "default"; then
1967                                 x86_multilibs="m64,m32"
1968                         fi
1969                         x86_multilibs=`echo $x86_multilibs | sed -e 's/,/ /g'`
1970                         for x86_multilib in ${x86_multilibs}; do
1971                                 case ${x86_multilib} in
1972                                 m32 | m64 | mx32)
1973                                         TM_MULTILIB_CONFIG="${TM_MULTILIB_CONFIG},${x86_multilib}"
1974                                         ;;
1975                                 *)
1976                                         echo "--with-multilib-list=${x86_with_multilib} not supported."
1977                                         exit 1
1978                                 esac
1979                         done
1980                         TM_MULTILIB_CONFIG=`echo $TM_MULTILIB_CONFIG | sed 's/^,//'`
1981                         need_64bit_isa=yes
1982                         if test x$with_cpu = x; then
1983                                 if test x$with_cpu_64 = x; then
1984                                         with_cpu_64=generic
1985                                 fi
1986                         else
1987                                 case " $x86_cpus $x86_archs $x86_64_archs " in
1988                                 *" $with_cpu "*)
1989                                         ;;
1990                                 *)
1991                                         echo "Unsupported CPU used in --with-cpu=$with_cpu, supported values:" 1>&2
1992                                         echo "$x86_cpus $x86_archs $x86_64_archs " 1>&2
1993                                         exit 1
1994                                         ;;
1995                                 esac
1996                         fi
1997                 else
1998                         tm_file="${tm_file} i386/gnu-user-common.h i386/gnu-user.h i386/linux-common.h i386/linux.h"
1999                 fi
2000                 ;;
2001         i[34567]86-*-kfreebsd*-gnu)
2002                 tm_file="${tm_file} i386/gnu-user-common.h i386/gnu-user.h kfreebsd-gnu.h i386/kfreebsd-gnu.h"
2003                 ;;
2004         i[34567]86-*-kopensolaris*-gnu)
2005                 tm_file="${tm_file} i386/gnu-user-common.h i386/gnu-user.h kopensolaris-gnu.h i386/kopensolaris-gnu.h"
2006                 ;;
2007         i[34567]86-*-gnu*)
2008                 tm_file="$tm_file i386/gnu-user-common.h i386/gnu-user.h gnu.h i386/gnu.h"
2009                 ;;
2010         esac
2011         ;;
2012 x86_64-*-linux* | x86_64-*-kfreebsd*-gnu)
2013         tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h gnu-user.h glibc-stdint.h \
2014                  i386/x86-64.h i386/gnu-user-common.h i386/gnu-user64.h"
2015         case ${target} in
2016         x86_64-*-linux*)
2017                 tm_file="${tm_file} linux.h linux-android.h i386/linux-common.h i386/linux64.h"
2018                 extra_options="${extra_options} linux-android.opt"
2019                 ;;
2020         x86_64-*-kfreebsd*-gnu)
2021                 tm_file="${tm_file} kfreebsd-gnu.h i386/kfreebsd-gnu64.h"
2022                 ;;
2023         esac
2024         tmake_file="${tmake_file} i386/t-linux64"
2025         x86_multilibs="${with_multilib_list}"
2026         if test "$x86_multilibs" = "default"; then
2027                 case ${with_abi} in
2028                 x32 | mx32)
2029                         x86_multilibs="mx32"
2030                         ;;
2031                 *)
2032                         x86_multilibs="m64,m32"
2033                         ;;
2034                 esac
2035         fi
2036         x86_multilibs=`echo $x86_multilibs | sed -e 's/,/ /g'`
2037         for x86_multilib in ${x86_multilibs}; do
2038                 case ${x86_multilib} in
2039                 m32 | m64 | mx32)
2040                         TM_MULTILIB_CONFIG="${TM_MULTILIB_CONFIG},${x86_multilib}"
2041                         ;;
2042                 *)
2043                         echo "--with-multilib-list=${x86_with_multilib} not supported."
2044                         exit 1
2045                 esac
2046         done
2047         TM_MULTILIB_CONFIG=`echo $TM_MULTILIB_CONFIG | sed 's/^,//'`
2048         ;;
2049 i[34567]86-pc-msdosdjgpp*)
2050         xm_file=i386/xm-djgpp.h
2051         tm_file="dbxcoff.h ${tm_file} i386/unix.h i386/bsd.h i386/gas.h i386/djgpp.h i386/djgpp-stdint.h"
2052         native_system_header_dir=/dev/env/DJDIR/include
2053         extra_options="${extra_options} i386/djgpp.opt"
2054         gnu_ld=yes
2055         gas=yes
2056         use_gcc_stdint=wrap
2057         ;;
2058 i[34567]86-*-lynxos*)
2059         xm_defines=POSIX
2060         tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h i386/lynx.h lynx.h"
2061         tmake_file="${tmake_file} t-lynx"
2062         extra_options="${extra_options} lynx.opt"
2063         thread_file=lynx
2064         gnu_ld=yes
2065         gas=yes
2066         ;;
2067 i[34567]86-*-nto-qnx*)
2068         tm_file="${tm_file} i386/att.h dbxelf.h tm-dwarf2.h elfos.h i386/unix.h i386/nto.h"
2069         extra_options="${extra_options} i386/nto.opt"
2070         gnu_ld=yes
2071         gas=yes
2072         ;;
2073 i[34567]86-*-rtems*)
2074         tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h i386/i386elf.h i386/rtemself.h rtems.h newlib-stdint.h"
2075         tmake_file="${tmake_file} i386/t-rtems"
2076         ;;
2077 i[34567]86-*-solaris2* | x86_64-*-solaris2*)
2078         # Set default arch_32 to pentium4, tune_32 to generic like the other
2079         # i386 targets, although config.guess defaults to i386-pc-solaris2*.
2080         with_arch_32=${with_arch_32:-pentium4}
2081         with_tune_32=${with_tune_32:-generic}
2082         tm_file="${tm_file} i386/unix.h i386/att.h ${sol2_tm_file_head} i386/x86-64.h ${sol2_tm_file_tail}"
2083         tm_defines="${tm_defines} TARGET_BI_ARCH=1"
2084         tmake_file="$tmake_file i386/t-sol2"
2085         need_64bit_isa=yes
2086         if test x$with_cpu = x; then
2087                 if test x$with_cpu_64 = x; then
2088                         with_cpu_64=generic
2089                 fi
2090         else
2091                 case " $x86_cpus $x86_archs $x86_64_archs " in
2092                 *" $with_cpu "*)
2093                         ;;
2094                 *)
2095                         echo "Unsupported CPU used in --with-cpu=$with_cpu, supported values:" 1>&2
2096                         echo "$x86_cpus $x86_archs $x86_64_archs" 1>&2
2097                         exit 1
2098                         ;;
2099                 esac
2100         fi
2101         ;;
2102 i[4567]86-wrs-vxworks*|x86_64-wrs-vxworks7*)
2103         tm_file="${tm_file} i386/unix.h i386/att.h elfos.h"
2104         case ${target} in
2105           x86_64-*)
2106             need_64bit_isa=yes
2107             tm_file="${tm_file} i386/x86-64.h"
2108             ;;
2109         esac
2110         tm_file="${tm_file} vx-common.h"
2111         case ${target} in
2112           *-vxworksae*)
2113             tm_file="${tm_file} vxworksae.h i386/vxworks.h i386/vxworksae.h"
2114             tmake_file="${tmake_file} i386/t-vxworks i386/t-vxworksae"
2115             ;;
2116           *)
2117             tm_file="${tm_file} vxworks.h i386/vxworks.h"
2118             tmake_file="${tmake_file} i386/t-vxworks"
2119             ;;
2120         esac
2121         ;;
2122 i[34567]86-*-cygwin*)
2123         tm_file="${tm_file} i386/unix.h i386/bsd.h i386/gas.h dbxcoff.h i386/cygming.h i386/cygwin.h i386/cygwin-stdint.h"
2124         xm_file=i386/xm-cygwin.h
2125         tmake_file="${tmake_file} i386/t-cygming t-slibgcc"
2126         target_gtfiles="$target_gtfiles \$(srcdir)/config/i386/winnt.cc"
2127         extra_options="${extra_options} i386/cygming.opt i386/cygwin.opt"
2128         extra_objs="${extra_objs} winnt.o winnt-stubs.o"
2129         c_target_objs="${c_target_objs} msformat-c.o"
2130         cxx_target_objs="${cxx_target_objs} winnt-cxx.o msformat-c.o"
2131         d_target_objs="${d_target_objs} winnt-d.o"
2132         target_has_targetdm="yes"
2133         if test x$enable_threads = xyes; then
2134                 thread_file='posix'
2135         fi
2136         default_use_cxa_atexit=yes
2137         use_gcc_stdint=wrap
2138         ;;
2139 x86_64-*-cygwin*)
2140         need_64bit_isa=yes
2141         tm_file="${tm_file} i386/unix.h i386/bsd.h i386/gas.h dbxcoff.h i386/cygming.h i386/cygwin.h i386/cygwin-w64.h i386/cygwin-stdint.h"
2142         xm_file=i386/xm-cygwin.h
2143         tmake_file="${tmake_file} i386/t-cygming t-slibgcc i386/t-cygwin-w64"
2144         target_gtfiles="$target_gtfiles \$(srcdir)/config/i386/winnt.cc"
2145         extra_options="${extra_options} i386/cygming.opt i386/cygwin.opt"
2146         extra_objs="${extra_objs} winnt.o winnt-stubs.o"
2147         c_target_objs="${c_target_objs} msformat-c.o"
2148         cxx_target_objs="${cxx_target_objs} winnt-cxx.o msformat-c.o"
2149         d_target_objs="${d_target_objs} winnt-d.o"
2150         target_has_targetdm="yes"
2151         if test x$enable_threads = xyes; then
2152                 thread_file='posix'
2153         fi
2154         default_use_cxa_atexit=yes
2155         use_gcc_stdint=wrap
2156         tm_defines="${tm_defines} TARGET_CYGWIN64=1"
2157         ;;
2158 i[34567]86-*-mingw* | x86_64-*-mingw*)
2159         tm_file="${tm_file} i386/unix.h i386/bsd.h i386/gas.h dbxcoff.h i386/cygming.h"
2160         xm_file=i386/xm-mingw32.h
2161         c_target_objs="${c_target_objs} winnt-c.o"
2162         cxx_target_objs="${cxx_target_objs} winnt-c.o"
2163         d_target_objs="${d_target_objs} winnt-d.o"
2164         target_has_targetcm="yes"
2165         target_has_targetdm="yes"
2166         case ${target} in
2167                 x86_64-*-* | *-w64-*)
2168                         need_64bit_isa=yes
2169                         ;;
2170                 *)
2171                         ;;
2172         esac
2173         if test x$enable_threads = xposix ; then
2174                 tm_file="${tm_file} i386/mingw-pthread.h"
2175         fi
2176         tm_file="${tm_file} i386/mingw32.h"
2177         # This makes the logic if mingw's or the w64 feature set has to be used
2178         case ${target} in
2179                 *-w64-*)
2180                         user_headers_inc_next_post="${user_headers_inc_next_post} float.h"
2181                         user_headers_inc_next_pre="${user_headers_inc_next_pre} stddef.h stdarg.h"
2182                         tm_file="${tm_file} i386/mingw-w64.h"
2183                         if test x$enable_targets = xall; then
2184                                 tm_defines="${tm_defines} TARGET_BI_ARCH=1"
2185                                 if test x$with_cpu = x; then
2186                                         if test x$with_cpu_64 = x; then
2187                                                 with_cpu_64=generic
2188                                         fi
2189                                 else
2190                                         case " $x86_cpus $x86_archs $x86_64_archs " in
2191                                         *" $with_cpu "*)
2192                                                 ;;
2193                                         *)
2194                                                 echo "Unsupported CPU used in --with-cpu=$with_cpu, supported values:" 1>&2
2195                                                 echo "$x86_cpus $x86_archs $x86_64_archs" 1>&2
2196                                                 exit 1
2197                                                 ;;
2198                                         esac
2199                                 fi
2200                         fi
2201                         ;;
2202                 *)
2203                         ;;
2204         esac
2205         tm_file="${tm_file} i386/mingw-stdint.h"
2206         tmake_file="${tmake_file} t-winnt i386/t-cygming t-slibgcc"
2207         case ${target} in
2208                x86_64-w64-*)
2209                         tmake_file="${tmake_file} i386/t-mingw-w64"
2210                         ;;
2211                i[34567]86-w64-*)
2212                         tmake_file="${tmake_file} i386/t-mingw-w32"
2213                         ;;
2214         esac
2215         native_system_header_dir=/mingw/include
2216         target_gtfiles="$target_gtfiles \$(srcdir)/config/i386/winnt.cc"
2217         extra_options="${extra_options} i386/cygming.opt i386/mingw.opt"
2218         case ${target} in
2219                 *-w64-*)
2220                         extra_options="${extra_options} i386/mingw-w64.opt"
2221                         ;;
2222                 *)
2223                         ;;
2224         esac
2225         extra_objs="${extra_objs} winnt.o winnt-stubs.o"
2226         c_target_objs="${c_target_objs} msformat-c.o"
2227         cxx_target_objs="${cxx_target_objs} winnt-cxx.o msformat-c.o"
2228         gas=yes
2229         gnu_ld=yes
2230         default_use_cxa_atexit=yes
2231         use_gcc_stdint=wrap
2232         case ${enable_threads} in
2233           "" | yes | win32)
2234             thread_file='win32'
2235             ;;
2236           posix)
2237             thread_file='posix'
2238             ;;
2239         esac
2240         case ${target} in
2241                 *mingw32crt*)
2242                         tm_file="${tm_file} i386/crtdll.h"
2243                         ;;
2244                 *mingw32msv* | *mingw*)
2245                         ;;
2246         esac
2247         ;;
2248 x86_64-*-fuchsia*)
2249         tmake_file="${tmake_file} i386/t-x86_64-elf"
2250         tm_file="${tm_file} i386/unix.h i386/att.h elfos.h newlib-stdint.h i386/i386elf.h i386/x86-64.h fuchsia.h"
2251         ;;
2252 ia64*-*-elf*)
2253         tm_file="${tm_file} dbxelf.h elfos.h newlib-stdint.h ia64/sysv4.h ia64/elf.h"
2254         tmake_file="ia64/t-ia64"
2255         target_cpu_default="0"
2256         if test x$gas = xyes
2257         then
2258                 target_cpu_default="${target_cpu_default}|MASK_GNU_AS"
2259         fi
2260         if test x$gnu_ld = xyes
2261         then
2262                 target_cpu_default="${target_cpu_default}|MASK_GNU_LD"
2263         fi
2264         ;;
2265 ia64*-*-freebsd*)
2266         tm_file="${tm_file} dbxelf.h elfos.h ${fbsd_tm_file} ia64/sysv4.h ia64/freebsd.h"
2267         target_cpu_default="MASK_GNU_AS|MASK_GNU_LD"
2268         tmake_file="${tmake_file} ia64/t-ia64"
2269         ;;
2270 ia64*-*-linux*)
2271         tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h ia64/sysv4.h ia64/linux.h"
2272         tmake_file="${tmake_file} ia64/t-ia64 ia64/t-linux t-libunwind"
2273         target_cpu_default="MASK_GNU_AS|MASK_GNU_LD"
2274         ;;
2275 ia64*-*-hpux*)
2276         tm_file="${tm_file} dbxelf.h elfos.h ia64/sysv4.h ia64/hpux.h"
2277         tmake_file="ia64/t-ia64 ia64/t-hpux t-slibgcc"
2278         target_cpu_default="MASK_GNU_AS"
2279         case x$enable_threads in
2280         x | xyes | xposix )
2281                 thread_file=posix
2282                 ;;
2283         esac
2284         use_collect2=no
2285         c_target_objs="ia64-c.o"
2286         cxx_target_objs="ia64-c.o"
2287         extra_options="${extra_options} ia64/ilp32.opt hpux11.opt"
2288         use_gcc_stdint=wrap
2289         tm_file="${tm_file} hpux-stdint.h"
2290         case ${target} in
2291         *-*-hpux11.3*)
2292                 tm_file="${tm_file} ia64/hpux-unix2003.h"
2293                 ;;
2294         esac
2295         ;;
2296 ia64-hp-*vms*)
2297         tm_file="${tm_file} elfos.h ia64/sysv4.h vms/vms.h ia64/vms.h"
2298         tmake_file="${tmake_file} ia64/t-ia64"
2299         target_cpu_default="0"
2300         if test x$gas = xyes
2301         then
2302                 target_cpu_default="${target_cpu_default}|MASK_GNU_AS"
2303         fi
2304         extra_options="${extra_options} ia64/vms.opt"
2305         ;;
2306 iq2000*-*-elf*)
2307         tm_file="elfos.h newlib-stdint.h iq2000/iq2000.h"
2308         out_file=iq2000/iq2000.cc
2309         md_file=iq2000/iq2000.md
2310         ;;
2311 lm32-*-elf*)
2312         tm_file="dbxelf.h elfos.h ${tm_file} newlib-stdint.h"
2313         tmake_file="${tmake_file} lm32/t-lm32"
2314         ;;
2315 lm32-*-rtems*)
2316         tm_file="dbxelf.h elfos.h ${tm_file} lm32/rtems.h rtems.h newlib-stdint.h"
2317         tmake_file="${tmake_file} lm32/t-lm32"
2318         tmake_file="${tmake_file} lm32/t-rtems"
2319          ;;
2320 lm32-*-uclinux*)
2321         tm_file="dbxelf.h elfos.h ${tm_file} gnu-user.h linux.h lm32/uclinux-elf.h"
2322         tmake_file="${tmake_file} lm32/t-lm32"
2323         ;;
2324 m32r-*-elf*)
2325         tm_file="elfos.h newlib-stdint.h ${tm_file}"
2326         ;;
2327 m32rle-*-elf*)
2328         tm_file="elfos.h newlib-stdint.h m32r/little.h ${tm_file}"
2329         ;;
2330 m68k-*-elf* | fido-*-elf*)
2331         case ${target} in
2332         fido-*-elf*)
2333                 # Check that $with_cpu makes sense.
2334                 case $with_cpu in
2335                 "" | "fidoa")
2336                         ;;
2337                 *)
2338                         echo "Cannot accept --with-cpu=$with_cpu"
2339                         exit 1
2340                         ;;
2341                 esac
2342                 with_cpu=fidoa
2343                 ;;
2344         *)
2345                 default_m68k_cpu=68020
2346                 default_cf_cpu=5206
2347                 ;;
2348         esac
2349         tm_file="${tm_file} m68k/m68k-none.h m68k/m68kelf.h dbxelf.h elfos.h newlib-stdint.h m68k/m68kemb.h m68k/m68020-elf.h"
2350         tm_defines="${tm_defines} MOTOROLA=1"
2351         tmake_file="m68k/t-floatlib m68k/t-m68kbare m68k/t-m68kelf"
2352         # Add multilibs for targets other than fido.
2353         case ${target} in
2354         fido-*-elf*)
2355                 ;;
2356         *)
2357                 tmake_file="$tmake_file m68k/t-mlibs"
2358                 ;;
2359         esac
2360         ;;
2361 m68k*-*-netbsdelf*)
2362         default_m68k_cpu=68020
2363         default_cf_cpu=5475
2364         tm_file="${tm_file} dbxelf.h elfos.h ${nbsd_tm_file} m68k/netbsd-elf.h"
2365         extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
2366         tm_defines="${tm_defines} MOTOROLA=1 CHAR_FAST8=1 SHORT_FAST16=1"
2367         ;;
2368 m68k-*-uclinux*)                # Motorola m68k/ColdFire running uClinux
2369                                 # with uClibc, using the new GNU/Linux-style
2370                                 # ABI.
2371         default_m68k_cpu=68020
2372         default_cf_cpu=5206
2373         tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h flat.h m68k/linux.h m68k/uclinux.h ./sysroot-suffix.h"
2374         extra_options="${extra_options} m68k/uclinux.opt"
2375         tm_defines="${tm_defines} MOTOROLA=1"
2376         tmake_file="m68k/t-floatlib m68k/t-uclinux m68k/t-mlibs"
2377         ;;
2378 m68k-*-linux*)                  # Motorola m68k's running GNU/Linux
2379                                 # with ELF format using glibc 2
2380                                 # aka the GNU/Linux C library 6.
2381         default_m68k_cpu=68020
2382         default_cf_cpu=5475
2383         with_arch=${with_arch:-m68k}
2384         tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h m68k/linux.h ./sysroot-suffix.h"
2385         extra_options="${extra_options} m68k/ieee.opt"
2386         tm_defines="${tm_defines} MOTOROLA=1"
2387         tmake_file="${tmake_file} m68k/t-floatlib m68k/t-linux m68k/t-mlibs"
2388         ;;
2389 m68k-*-rtems*)
2390         default_m68k_cpu=68020
2391         default_cf_cpu=5206
2392         tmake_file="${tmake_file} m68k/t-floatlib m68k/t-m68kbare m68k/t-crtstuff m68k/t-rtems m68k/t-mlibs"
2393         tm_file="${tm_file} m68k/m68k-none.h m68k/m68kelf.h dbxelf.h elfos.h m68k/m68kemb.h m68k/m68020-elf.h m68k/rtemself.h rtems.h newlib-stdint.h"
2394         tm_defines="${tm_defines} MOTOROLA=1"
2395         ;;
2396 mcore-*-elf)
2397         tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file} mcore/mcore-elf.h"
2398         tmake_file=mcore/t-mcore
2399         inhibit_libc=true
2400         ;;
2401 microblaze*-linux*)
2402         case $target in
2403                 microblazeel-*)
2404                         tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=0"
2405                         ;;
2406                 microblaze-*)
2407                         tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=4321"
2408                         ;;
2409         esac
2410         tm_file="${tm_file} dbxelf.h gnu-user.h linux.h microblaze/linux.h"
2411         tm_file="${tm_file} glibc-stdint.h"
2412         c_target_objs="${c_target_objs} microblaze-c.o"
2413         cxx_target_objs="${cxx_target_objs} microblaze-c.o"
2414         tmake_file="${tmake_file} microblaze/t-microblaze"
2415         tmake_file="${tmake_file} microblaze/t-microblaze-linux"
2416         ;;
2417 microblaze*-*-rtems*)
2418         case $target in
2419                 microblazeel-*)
2420                         tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=0"
2421                         ;;
2422                 microblaze-*)
2423                         tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=4321"
2424                         ;;
2425         esac
2426         tm_file="${tm_file} dbxelf.h"
2427         tm_file="${tm_file} microblaze/rtems.h rtems.h newlib-stdint.h"
2428         c_target_objs="${c_target_objs} microblaze-c.o"
2429         cxx_target_objs="${cxx_target_objs} microblaze-c.o"
2430         tmake_file="${tmake_file} microblaze/t-microblaze"
2431         tmake_file="${tmake_file} microblaze/t-rtems"
2432         ;;
2433 microblaze*-*-elf)
2434         case $target in
2435                 microblazeel-*)
2436                         tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=0"
2437                         ;;
2438                 microblaze-*)
2439                         tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=4321"
2440                         ;;
2441         esac
2442         tm_file="${tm_file} dbxelf.h newlib-stdint.h"
2443         c_target_objs="${c_target_objs} microblaze-c.o"
2444         cxx_target_objs="${cxx_target_objs} microblaze-c.o"
2445         tmake_file="${tmake_file} microblaze/t-microblaze"
2446         ;;
2447 riscv*-*-linux*)
2448         tm_file="elfos.h gnu-user.h linux.h glibc-stdint.h ${tm_file} riscv/linux.h"
2449         case "x${enable_multilib}" in
2450         xno) ;;
2451         xyes) tmake_file="${tmake_file} riscv/t-linux-multilib" ;;
2452         *) echo "Unknown value for enable_multilib"; exit 1
2453         esac
2454         tmake_file="${tmake_file} riscv/t-riscv riscv/t-linux"
2455         gnu_ld=yes
2456         gas=yes
2457         case $target in
2458         riscv32be-*|riscv64be-*)
2459                 tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1"
2460                 ;;
2461         esac
2462         # Force .init_array support.  The configure script cannot always
2463         # automatically detect that GAS supports it, yet we require it.
2464         gcc_cv_initfini_array=yes
2465         ;;
2466 riscv*-*-elf* | riscv*-*-rtems*)
2467         tm_file="elfos.h newlib-stdint.h ${tm_file} riscv/elf.h"
2468         case ${target} in
2469         *-*-rtems*)
2470           tm_file="${tm_file} riscv/rtems.h rtems.h"
2471           tmake_file="${tmake_file} riscv/t-rtems"
2472           ;;
2473         *)
2474           if test "x${with_multilib_generator}" == xdefault; then
2475                   case "x${enable_multilib}" in
2476                   xno) ;;
2477                   xyes) tmake_file="${tmake_file} riscv/t-elf-multilib" ;;
2478                   *) echo "Unknown value for enable_multilib"; exit 1
2479                   esac
2480           fi
2481         esac
2482         tmake_file="${tmake_file} riscv/t-riscv"
2483         gnu_ld=yes
2484         gas=yes
2485         case $target in
2486         riscv32be-*|riscv64be-*)
2487                 tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1"
2488                 ;;
2489         esac
2490         # Force .init_array support.  The configure script cannot always
2491         # automatically detect that GAS supports it, yet we require it.
2492         gcc_cv_initfini_array=yes
2493         ;;
2494 riscv*-*-freebsd*)
2495         tm_file="${tm_file} elfos.h ${fbsd_tm_file} riscv/freebsd.h"
2496         tmake_file="${tmake_file} riscv/t-riscv"
2497         gnu_ld=yes
2498         gas=yes
2499         case $target in
2500         riscv32be-*|riscv64be-*)
2501                 tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1"
2502                 ;;
2503         esac
2504         # Force .init_array support.  The configure script cannot always
2505         # automatically detect that GAS supports it, yet we require it.
2506         gcc_cv_initfini_array=yes
2507         ;;
2509 loongarch*-*-linux*)
2510         tm_file="dbxelf.h elfos.h gnu-user.h linux.h linux-android.h glibc-stdint.h ${tm_file}"
2511         tm_file="${tm_file} loongarch/gnu-user.h loongarch/linux.h"
2512         extra_options="${extra_options} linux-android.opt"
2513         tmake_file="${tmake_file} loongarch/t-linux"
2514         gnu_ld=yes
2515         gas=yes
2517         # Force .init_array support.  The configure script cannot always
2518         # automatically detect that GAS supports it, yet we require it.
2519         gcc_cv_initfini_array=yes
2520         ;;
2522 mips*-*-netbsd*)                        # NetBSD/mips, either endian.
2523         target_cpu_default="MASK_ABICALLS"
2524         tm_file="elfos.h ${tm_file} mips/elf.h ${nbsd_tm_file} mips/netbsd.h"
2525         extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
2526         ;;
2527 mips*-img-linux*)
2528         tm_file="dbxelf.h elfos.h gnu-user.h linux.h linux-android.h glibc-stdint.h ${tm_file} mips/gnu-user.h mips/linux.h mips/linux-common.h mips/mti-linux.h"
2529         extra_options="${extra_options} linux-android.opt"
2530         tmake_file="${tmake_file} mips/t-img-linux"
2531         tm_defines="${tm_defines} MIPS_ISA_DEFAULT=MIPS_ISA_MIPS32R6 MIPS_ABI_DEFAULT=ABI_32"
2532         with_arch_32="mips32r6"
2533         with_arch_64="mips64r6"
2534         gnu_ld=yes
2535         gas=yes
2536         ;;
2537 mips*-mti-linux*)
2538         tm_file="dbxelf.h elfos.h gnu-user.h linux.h linux-android.h glibc-stdint.h ${tm_file} mips/gnu-user.h mips/linux.h mips/linux-common.h mips/mti-linux.h"
2539         extra_options="${extra_options} linux-android.opt"
2540         tmake_file="${tmake_file} mips/t-mti-linux"
2541         tm_defines="${tm_defines} MIPS_ISA_DEFAULT=MIPS_ISA_MIPS32R2 MIPS_ABI_DEFAULT=ABI_32"
2542         with_arch_32="mips32r2"
2543         with_arch_64="mips64r2"
2544         gnu_ld=yes
2545         gas=yes
2546         ;;
2547 mips*-*-linux*)                         # Linux MIPS, either endian.
2548         tm_file="dbxelf.h elfos.h gnu-user.h linux.h linux-android.h glibc-stdint.h ${tm_file} mips/gnu-user.h mips/linux.h mips/linux-common.h"
2549         extra_options="${extra_options} linux-android.opt"
2550         case ${target} in
2551                 mipsisa32r6*)
2552                         default_mips_arch=mips32r6
2553                         ;;
2554                 mipsisa32r2*)
2555                         default_mips_arch=mips32r2
2556                         ;;
2557                 mipsisa32*)
2558                         default_mips_arch=mips32
2559                         ;;
2560                 mips64el-st-linux-gnu)
2561                         default_mips_abi=n32
2562                         tm_file="${tm_file} mips/st.h"
2563                         tmake_file="${tmake_file} mips/t-st"
2564                         enable_mips_multilibs="yes"
2565                         ;;
2566                 mips64octeon*-*-linux*)
2567                         default_mips_abi=n32
2568                         tm_defines="${tm_defines} MIPS_CPU_STRING_DEFAULT=\\\"octeon\\\""
2569                         target_cpu_default=MASK_SOFT_FLOAT_ABI
2570                         enable_mips_multilibs="yes"
2571                         ;;
2572                 mipsisa64r6*-*-linux-gnuabi64)
2573                         default_mips_abi=64
2574                         default_mips_arch=mips64r6
2575                         enable_mips_multilibs="yes"
2576                         ;;
2577                 mipsisa64r6*-*-linux*)
2578                         default_mips_abi=n32
2579                         default_mips_arch=mips64r6
2580                         enable_mips_multilibs="yes"
2581                         ;;
2582                 mipsisa64r2*-*-linux-gnuabi64)
2583                         default_mips_abi=64
2584                         default_mips_arch=mips64r2
2585                         enable_mips_multilibs="yes"
2586                         ;;
2587                 mipsisa64r2*-*-linux*)
2588                         default_mips_abi=n32
2589                         default_mips_arch=mips64r2
2590                         enable_mips_multilibs="yes"
2591                         ;;
2592                 mips64*-*-linux-gnuabi64 | mipsisa64*-*-linux-gnuabi64)
2593                         default_mips_abi=64
2594                         enable_mips_multilibs="yes"
2595                         ;;
2596                 mips64*-*-linux* | mipsisa64*-*-linux*)
2597                         default_mips_abi=n32
2598                         enable_mips_multilibs="yes"
2599                         ;;
2600         esac
2601         if test x$enable_targets = xall; then
2602                 enable_mips_multilibs="yes"
2603         fi
2604         if test x$enable_mips_multilibs = xyes; then
2605                 tmake_file="${tmake_file} mips/t-linux64"
2606         fi
2607         ;;
2608 mips*-mti-elf*)
2609         tm_file="elfos.h newlib-stdint.h ${tm_file} mips/elf.h mips/n32-elf.h mips/sde.h mips/mti-elf.h"
2610         tmake_file="mips/t-mti-elf"
2611         tm_defines="${tm_defines} MIPS_ISA_DEFAULT=MIPS_ISA_MIPS32R2 MIPS_ABI_DEFAULT=ABI_32"
2612         with_arch_32="mips32r2"
2613         with_arch_64="mips64r2"
2614         ;;
2615 mips*-img-elf*)
2616         tm_file="elfos.h newlib-stdint.h ${tm_file} mips/elf.h mips/n32-elf.h mips/sde.h mips/mti-elf.h"
2617         tmake_file="mips/t-img-elf"
2618         tm_defines="${tm_defines} MIPS_ISA_DEFAULT=MIPS_ISA_MIPS32R6 MIPS_ABI_DEFAULT=ABI_32"
2619         with_arch_32="mips32r6"
2620         with_arch_64="mips64r6"
2621         ;;
2622 mips*-sde-elf*)
2623         tm_file="elfos.h newlib-stdint.h ${tm_file} mips/elf.h mips/n32-elf.h mips/sde.h"
2624         tmake_file="mips/t-sde"
2625         extra_options="${extra_options} mips/sde.opt"
2626         case "${with_newlib}" in
2627           yes)
2628             # newlib / libgloss.
2629             ;;
2630           *)
2631             # MIPS toolkit libraries.
2632             tm_file="$tm_file mips/sdemtk.h"
2633             tmake_file="$tmake_file mips/t-sdemtk"
2634             case ${enable_threads} in
2635               "" | yes | mipssde)
2636                 thread_file='mipssde'
2637                 ;;
2638             esac
2639             ;;
2640         esac
2641         case ${target} in
2642           mipsisa32r6*)
2643             tm_defines="MIPS_ISA_DEFAULT=MIPS_ISA_MIPS32R6 MIPS_ABI_DEFAULT=ABI_32"
2644             ;;
2645           mipsisa32r2*)
2646             tm_defines="MIPS_ISA_DEFAULT=MIPS_ISA_MIPS32R2 MIPS_ABI_DEFAULT=ABI_32"
2647             ;;
2648           mipsisa32*)
2649             tm_defines="MIPS_ISA_DEFAULT=MIPS_ISA_MIPS32 MIPS_ABI_DEFAULT=ABI_32"
2650             ;;
2651           mipsisa64r6*)
2652             tm_defines="MIPS_ISA_DEFAULT=MIPS_ISA_MIPS64R6 MIPS_ABI_DEFAULT=ABI_N32"
2653             ;;
2654           mipsisa64r2*)
2655             tm_defines="MIPS_ISA_DEFAULT=MIPS_ISA_MIPS64R2 MIPS_ABI_DEFAULT=ABI_N32"
2656             ;;
2657           mipsisa64*)
2658             tm_defines="MIPS_ISA_DEFAULT=MIPS_ISA_MIPS64 MIPS_ABI_DEFAULT=ABI_N32"
2659             ;;
2660         esac
2661         ;;
2662 mipsisa32-*-elf* | mipsisa32el-*-elf* | \
2663 mipsisa32r2-*-elf* | mipsisa32r2el-*-elf* | \
2664 mipsisa32r6-*-elf* | mipsisa32r6el-*-elf* | \
2665 mipsisa64-*-elf* | mipsisa64el-*-elf* | \
2666 mipsisa64r2-*-elf* | mipsisa64r2el-*-elf* | \
2667 mipsisa64r6-*-elf* | mipsisa64r6el-*-elf*)
2668         tm_file="elfos.h newlib-stdint.h ${tm_file} mips/elf.h"
2669         tmake_file="mips/t-isa3264"
2670         case ${target} in
2671           mipsisa32r6*)
2672             tm_defines="${tm_defines} MIPS_ISA_DEFAULT=MIPS_ISA_MIPS32R6"
2673             ;;
2674           mipsisa32r2*)
2675             tm_defines="${tm_defines} MIPS_ISA_DEFAULT=MIPS_ISA_MIPS32R2"
2676             ;;
2677           mipsisa32*)
2678             tm_defines="${tm_defines} MIPS_ISA_DEFAULT=MIPS_ISA_MIPS32"
2679             ;;
2680           mipsisa64r6*)
2681             tm_defines="${tm_defines} MIPS_ISA_DEFAULT=MIPS_ISA_MIPS64R6"
2682             ;;
2683           mipsisa64r2*)
2684             tm_defines="${tm_defines} MIPS_ISA_DEFAULT=MIPS_ISA_MIPS64R2"
2685             ;;
2686           mipsisa64*)
2687             tm_defines="${tm_defines} MIPS_ISA_DEFAULT=MIPS_ISA_MIPS64"
2688             ;;
2689         esac
2690         case ${target} in
2691           mipsisa32*-*-elfoabi*)
2692             tm_defines="${tm_defines} MIPS_ABI_DEFAULT=ABI_32"
2693             tm_file="${tm_file} mips/elfoabi.h"
2694             ;;
2695           mipsisa64*-*-elfoabi*)
2696             tm_defines="${tm_defines} MIPS_ABI_DEFAULT=ABI_O64"
2697             tm_file="${tm_file} mips/elfoabi.h"
2698             ;;
2699           *-*-elf*)
2700             tm_defines="${tm_defines} MIPS_ABI_DEFAULT=ABI_EABI"
2701             ;;
2702         esac
2703         ;;
2704 mipsisa64sr71k-*-elf*)
2705         tm_file="elfos.h newlib-stdint.h ${tm_file} mips/elf.h"
2706         tmake_file=mips/t-sr71k
2707         tm_defines="${tm_defines} MIPS_ISA_DEFAULT=MIPS_ISA_MIPS64 MIPS_CPU_STRING_DEFAULT=\\\"sr71000\\\" MIPS_ABI_DEFAULT=ABI_EABI"
2708         ;;
2709 mipsisa64sb1-*-elf* | mipsisa64sb1el-*-elf*)
2710         tm_file="elfos.h newlib-stdint.h ${tm_file} mips/elf.h"
2711         tmake_file="mips/t-elf mips/t-sb1"
2712         tm_defines="${tm_defines} MIPS_ISA_DEFAULT=MIPS_ISA_MIPS64 MIPS_CPU_STRING_DEFAULT=\\\"sb1\\\" MIPS_ABI_DEFAULT=ABI_O64"
2713         ;;
2714 mips-*-elf* | mipsel-*-elf* | mipsr5900-*-elf* | mipsr5900el-*-elf*)
2715         tm_file="elfos.h newlib-stdint.h ${tm_file} mips/elf.h"
2716         tmake_file="mips/t-elf"
2717         ;;
2718 mips64r5900-*-elf* | mips64r5900el-*-elf*)
2719         tm_file="elfos.h newlib-stdint.h ${tm_file} mips/elf.h mips/n32-elf.h"
2720         tmake_file="mips/t-elf"
2721         tm_defines="${tm_defines} MIPS_ISA_DEFAULT=MIPS_ISA_MIPS3 MIPS_ABI_DEFAULT=ABI_N32"
2722         ;;
2723 mips64-*-elf* | mips64el-*-elf*)
2724         tm_file="elfos.h newlib-stdint.h ${tm_file} mips/elf.h"
2725         tmake_file="mips/t-elf"
2726         tm_defines="${tm_defines} MIPS_ISA_DEFAULT=MIPS_ISA_MIPS3 MIPS_ABI_DEFAULT=ABI_O64"
2727         ;;
2728 mips64vr-*-elf* | mips64vrel-*-elf*)
2729         tm_file="elfos.h newlib-stdint.h ${tm_file} mips/vr.h mips/elf.h"
2730         tmake_file=mips/t-vr
2731         tm_defines="${tm_defines} MIPS_ABI_DEFAULT=ABI_EABI"
2732         ;;
2733 mips64orion-*-elf* | mips64orionel-*-elf*)
2734         tm_file="elfos.h newlib-stdint.h ${tm_file} mips/elforion.h mips/elf.h"
2735         tmake_file="mips/t-elf"
2736         tm_defines="${tm_defines} MIPS_ISA_DEFAULT=MIPS_ISA_MIPS3 MIPS_ABI_DEFAULT=ABI_O64"
2737         ;;
2738 mips*-*-rtems*)
2739         tm_file="elfos.h newlib-stdint.h ${tm_file} mips/elf.h mips/rtems.h rtems.h"
2740         tmake_file="${tmake_file} mips/t-elf mips/t-rtems"
2741         ;;
2742 mips-wrs-vxworks)
2743         tm_file="elfos.h ${tm_file} mips/elf.h vx-common.h vxworks.h mips/vxworks.h"
2744         tmake_file="${tmake_file} mips/t-vxworks"
2745         ;;
2746 mipstx39-*-elf* | mipstx39el-*-elf*)
2747         tm_file="elfos.h newlib-stdint.h ${tm_file} mips/r3900.h mips/elf.h"
2748         tmake_file="mips/t-r3900"
2749         ;;
2750 mmix-knuth-mmixware)
2751         tm_file="${tm_file} newlib-stdint.h"
2752         use_gcc_stdint=wrap
2753         ;;
2754 mn10300-*-*)
2755         tm_file="elfos.h newlib-stdint.h ${tm_file}"
2756         use_collect2=no
2757         use_gcc_stdint=wrap
2758         ;;
2759 msp430-*-*)
2760         tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file}"
2761         c_target_objs="msp430-c.o"
2762         cxx_target_objs="msp430-c.o"
2763         tmake_file="${tmake_file} msp430/t-msp430"
2764         extra_objs="${extra_objs} msp430-devices.o"
2765         extra_gcc_objs="driver-msp430.o msp430-devices.o"
2766         # Enable .init_array unless it has been explicitly disabled.
2767         # The MSP430 EABI mandates the use of .init_array, and the Newlib CRT
2768         # code since mid-2019 expects it.
2769         if test x${disable_initfini_array} != xyes; then
2770                 gcc_cv_initfini_array=yes
2771         fi
2772         case ${target} in
2773           msp430-*-elfbare)
2774             # __cxa_atexit increases code size, and we don't need to support
2775             # dynamic shared objects on MSP430, so regular Newlib atexit is a
2776             # fine replacement as it also supports registration of more than 32
2777             # functions.
2778             default_use_cxa_atexit=no
2779             # This target does not match the generic *-*-elf case above which
2780             # sets use_gcc_stdint=wrap, so explicitly set it here.
2781             use_gcc_stdint=wrap
2782             ;;
2783         esac
2784         ;;
2785 nds32*-*-*)
2786         target_cpu_default="0"
2787         tm_defines="${tm_defines}"
2788         case ${target} in
2789           nds32le*-*-*)
2790             ;;
2791           nds32be-*-*)
2792             target_cpu_default="${target_cpu_default}|MASK_BIG_ENDIAN"
2793             tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1"
2794             ;;
2795         esac
2796         case ${target} in
2797           nds32*-*-elf*)
2798             tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file} nds32/elf.h nds32/nds32_intrinsic.h"
2799             tmake_file="nds32/t-nds32 nds32/t-elf"
2800             ;;
2801           nds32*-*-linux*)
2802             tm_file="dbxelf.h elfos.h ${tm_file} gnu-user.h linux.h glibc-stdint.h nds32/linux.h nds32/nds32_intrinsic.h"
2803             tmake_file="${tmake_file} nds32/t-nds32 nds32/t-linux"
2804             gcc_cv_initfini_array=yes
2805             ;;
2806         esac
2808         # Handle --enable-default-relax setting.
2809         if test x${enable_default_relax} = xyes; then
2810                 tm_defines="${tm_defines} TARGET_DEFAULT_RELAX=1"
2811         fi
2812         # Handle --with-ext-dsp
2813         if test x${with_ext_dsp} = xyes; then
2814                 tm_defines="${tm_defines} TARGET_DEFAULT_EXT_DSP=1"
2815         fi
2816         ;;
2817 nios2-*-*)
2818         tm_file="elfos.h ${tm_file}"
2819         tmake_file="${tmake_file} nios2/t-nios2"
2820         case ${target} in
2821         nios2-*-linux*)
2822                 tm_file="${tm_file} gnu-user.h linux.h glibc-stdint.h nios2/linux.h "
2823                 ;;
2824         nios2-*-elf*)
2825                 tm_file="${tm_file} newlib-stdint.h nios2/elf.h"
2826                 extra_options="${extra_options} nios2/elf.opt"
2827                 ;;
2828         nios2-*-rtems*)
2829                 tm_file="${tm_file} newlib-stdint.h nios2/rtems.h rtems.h"
2830                 tmake_file="${tmake_file} t-rtems nios2/t-rtems"
2831                 ;;
2832         esac
2833         ;;
2834 nvptx-*)
2835         tm_file="${tm_file} newlib-stdint.h"
2836         use_gcc_stdint=wrap
2837         tmake_file="nvptx/t-nvptx"
2838         if test x$enable_as_accelerator = xyes; then
2839                 extra_programs="${extra_programs} mkoffload\$(exeext)"
2840                 tm_file="${tm_file} nvptx/offload.h"
2841         fi
2842         ;;
2843 or1k*-*-*)
2844         tm_file="elfos.h ${tm_file}"
2845         tmake_file="${tmake_file} or1k/t-or1k"
2846         # Force .init_array support.  The configure script cannot always
2847         # automatically detect that GAS supports it, yet we require it.
2848         gcc_cv_initfini_array=yes
2850         # Handle --with-multilib-list=...
2851         or1k_multilibs="${with_multilib_list}"
2852         if test "$or1k_multilibs" = "default"; then
2853                 or1k_multilibs="mcmov,msoft-mul,msoft-div"
2854         fi
2855         or1k_multilibs=`echo $or1k_multilibs | sed -e 's/,/ /g'`
2856         for or1k_multilib in ${or1k_multilibs}; do
2857                 case ${or1k_multilib} in
2858                 mcmov | msext | msfimm | \
2859                 mror | mrori | \
2860                 mhard-float | mdouble-float | munordered-float | msoft-float | \
2861                 mhard-div | mhard-mul | \
2862                 msoft-div | msoft-mul )
2863                         TM_MULTILIB_CONFIG="${TM_MULTILIB_CONFIG},${or1k_multilib}"
2864                         ;;
2865                 *)
2866                         echo "--with-multilib-list=${with_multilib_list} not supported."
2867                         exit 1
2868                 esac
2869         done
2870         TM_MULTILIB_CONFIG=`echo $TM_MULTILIB_CONFIG | sed 's/^,//'`
2872         case ${target} in
2873         or1k*-*-linux*)
2874                 tm_file="${tm_file} gnu-user.h linux.h glibc-stdint.h"
2875                 tm_file="${tm_file} or1k/linux.h"
2876                 ;;
2877         or1k*-*-elf*)
2878                 tm_file="${tm_file} newlib-stdint.h or1k/elf.h"
2879                 extra_options="${extra_options} or1k/elf.opt"
2880                 ;;
2881         or1k*-*-rtems*)
2882                 tm_file="${tm_file} newlib-stdint.h or1k/rtems.h rtems.h"
2883                 tmake_file="${tmake_file} or1k/t-rtems"
2884                 ;;
2885         esac
2886         ;;
2887 pdp11-*-*)
2888         tm_file="${tm_file} newlib-stdint.h"
2889         use_gcc_stdint=wrap
2890         ;;
2891 # port not yet contributed
2892 #powerpc-*-openbsd*)
2893 #       tmake_file="${tmake_file} rs6000/t-fprules"
2894 #       extra_headers=
2895 #       ;;
2896 powerpc-*-darwin*)
2897         extra_options="${extra_options} ${cpu_type}/darwin.opt"
2898         case ${target} in
2899           *-darwin1[0-9]* | *-darwin9*)
2900             tmake_file="${tmake_file} ${cpu_type}/t-darwin32-biarch"
2901             tm_file="${tm_file} ${cpu_type}/darwin32-biarch.h"
2902             ;;
2903           *-darwin8*)
2904             tmake_file="${tmake_file} ${cpu_type}/t-darwin32-biarch"
2905             tm_file="${tm_file} ${cpu_type}/darwin32-biarch.h"
2906             ;;
2907           *-darwin7*)
2908             tm_file="${tm_file} ${cpu_type}/darwin7.h"
2909             ;;
2910           *-darwin[456]*)
2911             # Earlier - ingle arch, with 32b only
2912             # OS X 10.0, the first edition is Darwin4
2913             ;;
2914         esac
2915         tmake_file="${tmake_file} t-slibgcc"
2916         ;;
2917 powerpc64-*-darwin*)
2918         extra_options="${extra_options} ${cpu_type}/darwin.opt"
2919         tmake_file="${tmake_file} ${cpu_type}/t-darwin64-biarch t-slibgcc"
2920         tm_file="${tm_file} ${cpu_type}/darwin64-biarch.h"
2921         ;;
2922 powerpc*-*-freebsd*)
2923         tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h ${fbsd_tm_file} rs6000/sysv4.h"
2924         extra_options="${extra_options} rs6000/sysv4.opt"
2925         tmake_file="rs6000/t-fprules rs6000/t-ppcos ${tmake_file} rs6000/t-ppccomm"
2926         case ${target} in
2927             powerpc*le-*-*)
2928                 tm_file="${tm_file} rs6000/sysv4le.h" ;;
2929         esac
2930         case ${target} in
2931              powerpc64*)
2932                 tm_file="${tm_file} rs6000/default64.h rs6000/freebsd64.h"
2933                 tmake_file="${tmake_file} rs6000/t-freebsd64"
2934                 extra_options="${extra_options} rs6000/linux64.opt"
2935                 if test $fbsd_major -ge 13; then
2936                     tm_defines="${tm_defines} TARGET_FREEBSD32_SECURE_PLT=1"
2937                 fi
2938                 ;;
2939              *)
2940                 if test $fbsd_major -ge 13; then
2941                     tm_file="rs6000/secureplt.h ${tm_file}"
2942                 fi
2943                 tm_file="${tm_file} rs6000/freebsd.h"
2944                 ;;
2945         esac
2946         ;;
2947 powerpc-*-netbsd*)
2948         tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h ${nbsd_tm_file} freebsd-spec.h rs6000/sysv4.h rs6000/netbsd.h"
2949         extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
2950         tmake_file="${tmake_file} rs6000/t-netbsd"
2951         extra_options="${extra_options} rs6000/sysv4.opt"
2952         ;;
2953 powerpc-*-eabisimaltivec*)
2954         tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h freebsd-spec.h newlib-stdint.h rs6000/sysv4.h rs6000/eabi.h rs6000/eabisim.h rs6000/eabialtivec.h"
2955         extra_options="${extra_options} rs6000/sysv4.opt"
2956         tmake_file="rs6000/t-fprules rs6000/t-ppcendian rs6000/t-ppccomm"
2957         use_gcc_stdint=wrap
2958         ;;
2959 powerpc-*-eabisim*)
2960         tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h usegas.h freebsd-spec.h newlib-stdint.h rs6000/sysv4.h rs6000/eabi.h rs6000/eabisim.h"
2961         extra_options="${extra_options} rs6000/sysv4.opt"
2962         tmake_file="rs6000/t-fprules rs6000/t-ppcgas rs6000/t-ppccomm"
2963         use_gcc_stdint=wrap
2964         ;;
2965 powerpc-*-elf*)
2966         tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h usegas.h freebsd-spec.h newlib-stdint.h rs6000/sysv4.h"
2967         extra_options="${extra_options} rs6000/sysv4.opt"
2968         tmake_file="rs6000/t-fprules rs6000/t-ppcgas rs6000/t-ppccomm"
2969         ;;
2970 powerpc-*-eabialtivec*)
2971         tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h freebsd-spec.h newlib-stdint.h rs6000/sysv4.h rs6000/eabi.h rs6000/eabialtivec.h"
2972         extra_options="${extra_options} rs6000/sysv4.opt"
2973         tmake_file="rs6000/t-fprules rs6000/t-ppcendian rs6000/t-ppccomm"
2974         use_gcc_stdint=wrap
2975         ;;
2976 powerpc-*-eabi*)
2977         tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h usegas.h freebsd-spec.h newlib-stdint.h rs6000/sysv4.h rs6000/eabi.h"
2978         extra_options="${extra_options} rs6000/sysv4.opt"
2979         tmake_file="rs6000/t-fprules rs6000/t-ppcgas rs6000/t-ppccomm"
2980         use_gcc_stdint=wrap
2981         ;;
2982 powerpc-*-rtems*)
2983         tm_file="rs6000/biarch64.h ${tm_file} dbxelf.h elfos.h gnu-user.h freebsd-spec.h newlib-stdint.h rs6000/sysv4.h rs6000/rtems.h rtems.h"
2984         extra_options="${extra_options} rs6000/sysv4.opt rs6000/linux64.opt"
2985         tmake_file="${tmake_file} rs6000/t-fprules rs6000/t-rtems rs6000/t-ppccomm"
2986         ;;
2987 powerpc*-*-linux*)
2988         tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h linux.h freebsd-spec.h rs6000/sysv4.h"
2989         extra_options="${extra_options} rs6000/sysv4.opt"
2990         tmake_file="${tmake_file} rs6000/t-fprules rs6000/t-ppccomm"
2991         extra_objs="$extra_objs rs6000-linux.o"
2992         case ${target} in
2993             powerpc*le-*-*)
2994                 tm_file="${tm_file} rs6000/sysv4le.h" ;;
2995         esac
2996         case ${target}:${with_cpu} in
2997             powerpc64*: | powerpc64*:native) cpu_is_64bit=yes ;;
2998         esac
2999         maybe_biarch=${cpu_is_64bit}
3000         case ${enable_targets} in
3001             *powerpc64*) maybe_biarch=yes ;;
3002             all) maybe_biarch=yes ;;
3003         esac
3004         case ${target}:${enable_targets}:${maybe_biarch} in
3005             powerpc64-* | powerpc-*:*:yes | *:*powerpc64-*:yes | *:all:yes \
3006             | powerpc64le*:*powerpcle* | powerpc64le*:*powerpc-* \
3007             | powerpcle-*:*powerpc64le*:yes)
3008                 if test x$cpu_is_64bit = xyes; then
3009                     tm_file="${tm_file} rs6000/default64.h"
3010                 fi
3011                 tm_file="rs6000/biarch64.h ${tm_file} rs6000/linux64.h glibc-stdint.h"
3012                 tmake_file="$tmake_file rs6000/t-linux64"
3013                 case ${target} in
3014                     powerpc*le-*-*)
3015                         tmake_file="$tmake_file rs6000/t-linux64le"
3016                         case ${enable_targets} in
3017                             all | *powerpc64-* | *powerpc-*)
3018                                 tmake_file="$tmake_file rs6000/t-linux64lebe" ;;
3019                         esac ;;
3020                     *)
3021                         case ${enable_targets} in
3022                             all | *powerpc64le-* | *powerpcle-*)
3023                                 tmake_file="$tmake_file rs6000/t-linux64bele" ;;
3024                         esac ;;
3025                 esac
3026                 extra_options="${extra_options} rs6000/linux64.opt"
3027                 ;;
3028             powerpc64*)
3029                 tm_file="${tm_file} rs6000/default64.h rs6000/linux64.h glibc-stdint.h"
3030                 extra_options="${extra_options} rs6000/linux64.opt"
3031                 tmake_file="${tmake_file} rs6000/t-linux"
3032                 ;;
3033             *)
3034                 tm_file="${tm_file} rs6000/linux.h glibc-stdint.h"
3035                 tmake_file="${tmake_file} rs6000/t-ppcos rs6000/t-linux"
3036                 ;;
3037         esac
3038         case ${target} in
3039             powerpc*-*-linux*ppc476*)
3040                 tm_file="${tm_file} rs6000/476.h"
3041                 extra_options="${extra_options} rs6000/476.opt" ;;
3042             powerpc*-*-linux*altivec*)
3043                 tm_file="${tm_file} rs6000/linuxaltivec.h" ;;
3044         esac
3045         case ${target} in
3046             *-linux*-musl*)
3047                 enable_secureplt=yes ;;
3048         esac
3049         if test x${enable_secureplt} = xyes; then
3050                 tm_file="rs6000/secureplt.h ${tm_file}"
3051         fi
3052         ;;
3053 powerpc*-wrs-vxworks7r*)
3055         # Wind River 7 post SR0600 is mostly like Linux so we setup
3056         # our config in a very similar fashion and adjust to a few
3057         # specificities.
3059         # The system compiler is configured with secureplt by default.
3060         tm_file="${tm_file} rs6000/secureplt.h"
3062         tm_file="${tm_file} elfos.h gnu-user.h linux.h freebsd-spec.h"
3063         tm_file="${tm_file} rs6000/sysv4.h rs6000/biarch64.h rs6000/default64.h rs6000/linux64.h"
3064         tm_file="${tm_file} vx-common.h vxworks.h rs6000/vxworks.h"
3066         extra_options="${extra_options} rs6000/sysv4.opt linux.opt rs6000/linux64.opt"
3068         tmake_file="${tmake_file} t-linux rs6000/t-linux64 rs6000/t-fprules rs6000/t-ppccomm"
3069         tmake_file="${tmake_file} rs6000/t-vxworks"
3071         tm_defines="$tm_defines DEFAULT_LIBC=LIBC_GLIBC"
3072         extra_objs="$extra_objs linux.o rs6000-linux.o"
3073         ;;
3074 powerpc-wrs-vxworks*)
3075         tm_file="${tm_file} elfos.h gnu-user.h freebsd-spec.h rs6000/sysv4.h"
3076         tmake_file="${tmake_file} rs6000/t-fprules rs6000/t-ppccomm rs6000/t-vxworks"
3077         extra_options="${extra_options} rs6000/sysv4.opt"
3078         extra_headers="${extra_headers} ppc-asm.h"
3079         case ${target} in
3080           *-vxworksmils*)
3081             tm_file="${tm_file} vx-common.h vxworksae.h rs6000/vxworks.h rs6000/vxworksmils.h"
3082             tmake_file="${tmake_file} rs6000/t-vxworksmils"
3083             ;;
3084           *-vxworksae*)
3085             tm_file="${tm_file} vx-common.h vxworksae.h rs6000/vxworks.h rs6000/vxworksae.h"
3086             tmake_file="${tmake_file} rs6000/t-vxworksae"
3087             ;;
3088           *-vxworks*)
3089             tm_file="${tm_file} vx-common.h vxworks.h rs6000/vxworks.h"
3090             ;;
3091         esac
3092         ;;
3093 powerpc-*-lynxos*)
3094         xm_defines=POSIX
3095         tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h rs6000/sysv4.h rs6000/lynx.h lynx.h"
3096         tmake_file="t-lynx rs6000/t-lynx"
3097         extra_options="${extra_options} rs6000/sysv4.opt lynx.opt"
3098         thread_file=lynx
3099         gnu_ld=yes
3100         gas=yes
3101         ;;
3102 powerpcle-*-elf*)
3103         tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h usegas.h freebsd-spec.h newlib-stdint.h rs6000/sysv4.h rs6000/sysv4le.h"
3104         tmake_file="rs6000/t-fprules rs6000/t-ppcgas rs6000/t-ppccomm"
3105         extra_options="${extra_options} rs6000/sysv4.opt"
3106         ;;
3107 powerpcle-*-eabisim*)
3108         tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h usegas.h freebsd-spec.h newlib-stdint.h rs6000/sysv4.h rs6000/sysv4le.h rs6000/eabi.h rs6000/eabisim.h"
3109         tmake_file="rs6000/t-fprules rs6000/t-ppcgas rs6000/t-ppccomm"
3110         extra_options="${extra_options} rs6000/sysv4.opt"
3111         use_gcc_stdint=wrap
3112         ;;
3113 powerpcle-*-eabi*)
3114         tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h usegas.h freebsd-spec.h newlib-stdint.h rs6000/sysv4.h rs6000/sysv4le.h rs6000/eabi.h"
3115         tmake_file="rs6000/t-fprules rs6000/t-ppcgas rs6000/t-ppccomm"
3116         extra_options="${extra_options} rs6000/sysv4.opt"
3117         use_gcc_stdint=wrap
3118         ;;
3119 pru*-*-*)
3120         tm_file="elfos.h newlib-stdint.h ${tm_file}"
3121         tmake_file="${tmake_file} pru/t-pru"
3122         extra_objs="pru-pragma.o pru-passes.o"
3123         use_gcc_stdint=wrap
3124         ;;
3125 rs6000-ibm-aix7.1.* | powerpc-ibm-aix7.1.*)
3126         tmake_file="rs6000/t-aix52 t-slibgcc"
3127         if test x$cpu_is_64bit = xyes; then
3128             tm_file="${tm_file} rs6000/biarch64.h"
3129             tmake_file="rs6000/t-aix64 t-slibgcc"
3130         fi
3131         tm_file="${tm_file} rs6000/aix.h rs6000/aix71.h rs6000/xcoff.h rs6000/aix-stdint.h"
3132         extra_options="${extra_options} rs6000/aix64.opt"
3133         use_collect2=yes
3134         thread_file='aix'
3135         use_gcc_stdint=wrap
3136         default_use_cxa_atexit=yes
3137         ;;
3138 rs6000-ibm-aix7.2.* | powerpc-ibm-aix7.2.*)
3139         tmake_file="rs6000/t-aix52 t-slibgcc"
3140         if test x$cpu_is_64bit = xyes; then
3141             tm_file="${tm_file} rs6000/biarch64.h"
3142             tmake_file="rs6000/t-aix64 t-slibgcc"
3143         fi
3144         tm_file="${tm_file} rs6000/aix.h rs6000/aix72.h rs6000/xcoff.h rs6000/aix-stdint.h"
3145         extra_options="${extra_options} rs6000/aix64.opt"
3146         use_collect2=yes
3147         thread_file='aix'
3148         use_gcc_stdint=wrap
3149         default_use_cxa_atexit=yes
3150         ;;
3151 rs6000-ibm-aix[789].* | powerpc-ibm-aix[789].*)
3152         tmake_file="rs6000/t-aix52 t-slibgcc"
3153         if test x$cpu_is_64bit = xyes; then
3154             tm_file="${tm_file} rs6000/biarch64.h"
3155             tmake_file="rs6000/t-aix64 t-slibgcc"
3156         fi
3157         tm_file="${tm_file} rs6000/aix.h rs6000/aix73.h rs6000/xcoff.h rs6000/aix-stdint.h"
3158         extra_options="${extra_options} rs6000/aix64.opt"
3159         use_collect2=yes
3160         thread_file='aix'
3161         use_gcc_stdint=wrap
3162         default_use_cxa_atexit=yes
3163         ;;
3164 rl78-*-elf*)
3165         tm_file="elfos.h newlib-stdint.h ${tm_file}"
3166         target_has_targetm_common=no
3167         c_target_objs="rl78-c.o"
3168         cxx_target_objs="rl78-c.o"
3169         tmake_file="${tmake_file} rl78/t-rl78"
3170         ;;
3171 rx-*-elf*)
3172         tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file}"
3173         tmake_file="${tmake_file} rx/t-rx"
3174         extra_options="${extra_options} rx/elf.opt"
3175         ;;
3176 rx-*-linux*)
3177         tm_file="elfos.h linux.h glibc-stdint.h rx/linux.h ../../libgcc/config/rx/rx-abi.h"
3178         tmake_file="${tmake_file} rx/t-linux"
3179         ;;
3180 s390-*-linux*)
3181         tm_file="s390/s390.h dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h s390/linux.h"
3182         c_target_objs="${c_target_objs} s390-c.o"
3183         cxx_target_objs="${cxx_target_objs} s390-c.o"
3184         if test x$enable_targets = xall; then
3185                 tmake_file="${tmake_file} s390/t-linux64"
3186         fi
3187         tmake_file="${tmake_file} s390/t-s390"
3188         ;;
3189 s390x-*-linux*)
3190         tm_file="s390/s390x.h s390/s390.h dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h s390/linux.h"
3191         tm_p_file="linux-protos.h s390/s390-protos.h"
3192         c_target_objs="${c_target_objs} s390-c.o"
3193         cxx_target_objs="${cxx_target_objs} s390-c.o"
3194         md_file=s390/s390.md
3195         extra_modes=s390/s390-modes.def
3196         out_file=s390/s390.cc
3197         tmake_file="${tmake_file} s390/t-linux64 s390/t-s390"
3198         ;;
3199 s390x-ibm-tpf*)
3200         tm_file="s390/s390x.h s390/s390.h dbxelf.h elfos.h glibc-stdint.h s390/tpf.h"
3201         tm_p_file=s390/s390-protos.h
3202         c_target_objs="${c_target_objs} s390-c.o"
3203         cxx_target_objs="${cxx_target_objs} s390-c.o"
3204         md_file=s390/s390.md
3205         extra_modes=s390/s390-modes.def
3206         out_file=s390/s390.cc
3207         thread_file='tpf'
3208         extra_options="${extra_options} s390/tpf.opt"
3209         tmake_file="${tmake_file} s390/t-s390"
3210         ;;
3211 sh-*-elf* | sh[12346l]*-*-elf* | \
3212   sh-*-linux* | sh[2346lbe]*-*-linux* | \
3213   sh-*-netbsdelf* | shl*-*-netbsdelf*)
3214         tmake_file="${tmake_file} sh/t-sh sh/t-elf"
3215         if test x${with_endian} = x; then
3216                 case ${target} in
3217                 sh[1234]*be-*-* | sh[1234]*eb-*-*) with_endian=big ;;
3218                 shbe-*-* | sheb-*-*)               with_endian=big,little ;;
3219                 sh[1234]l* | sh[34]*-*-linux*)     with_endian=little ;;
3220                 shl* | sh*-*-linux* | \
3221                   sh-superh-elf)                   with_endian=little,big ;;
3222                 sh[1234]*-*-*)                     with_endian=big ;;
3223                 *)                                 with_endian=big,little ;;
3224                 esac
3225         fi
3226         # TM_ENDIAN_CONFIG is used by t-sh to determine multilibs.
3227         #  First word : the default endian.
3228         #  Second word: the secondary endian (optional).
3229         case ${with_endian} in
3230         big)            TM_ENDIAN_CONFIG=mb ;;
3231         little)         TM_ENDIAN_CONFIG=ml ;;
3232         big,little)     TM_ENDIAN_CONFIG="mb ml" ;;
3233         little,big)     TM_ENDIAN_CONFIG="ml mb" ;;
3234         *)      echo "with_endian=${with_endian} not supported."; exit 1 ;;
3235         esac
3236         case ${with_endian} in
3237         little*)        tm_file="sh/little.h ${tm_file}" ;;
3238         esac
3239         tm_file="${tm_file} dbxelf.h elfos.h sh/elf.h"
3240         case ${target} in
3241         sh*-*-linux*)   tmake_file="${tmake_file} sh/t-linux"
3242                         if test x$enable_fdpic = xyes; then
3243                                 tm_defines="$tm_defines FDPIC_DEFAULT=1"
3244                         fi
3245                         tm_file="${tm_file} gnu-user.h linux.h glibc-stdint.h sh/linux.h" ;;
3246         sh*-*-netbsd*)
3247                         tm_file="${tm_file} ${nbsd_tm_file} sh/netbsd-elf.h"
3248                         extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
3250                         ;;
3251         sh*-superh-elf) if test x$with_libgloss != xno; then
3252                                 with_libgloss=yes
3253                                 tm_file="${tm_file} sh/newlib.h"
3254                         fi
3255                         tm_file="${tm_file} sh/embed-elf.h"
3256                         tm_file="${tm_file} sh/superh.h"
3257                         extra_options="${extra_options} sh/superh.opt" ;;
3258         *)              if test x$with_newlib = xyes \
3259                            && test x$with_libgloss = xyes; then
3260                                 tm_file="${tm_file} sh/newlib.h"
3261                         fi
3262                         tm_file="${tm_file} sh/embed-elf.h" ;;
3263         esac
3264         case ${target} in
3265         *-*-netbsd)
3266                 ;;
3267         *-*-elf*)
3268                 tm_file="${tm_file} newlib-stdint.h"
3269                 ;;
3270         esac
3271         # sed el/eb endian suffixes away to avoid confusion with sh[23]e
3272         case `echo ${target} | sed 's/e[lb]-/-/'` in
3273         sh4a_single_only*)      sh_cpu_target=sh4a-single-only ;;
3274         sh4a_single*)           sh_cpu_target=sh4a-single ;;
3275         sh4a_nofpu*)            sh_cpu_target=sh4a-nofpu ;;
3276         sh4al)                  sh_cpu_target=sh4al ;;
3277         sh4a*)                  sh_cpu_target=sh4a ;;
3278         sh4_single_only*)       sh_cpu_target=sh4-single-only ;;
3279         sh4_single*)            sh_cpu_target=sh4-single ;;
3280         sh4_nofpu*)             sh_cpu_target=sh4-nofpu ;;
3281         sh4* | sh-superh-*)     sh_cpu_target=sh4 ;;
3282         sh3e*)                  sh_cpu_target=sh3e ;;
3283         sh*-*-netbsd* | sh3*)   sh_cpu_target=sh3 ;;
3284         sh2a_single_only*)      sh_cpu_target=sh2a-single-only ;;
3285         sh2a_single*)           sh_cpu_target=sh2a-single ;;
3286         sh2a_nofpu*)            sh_cpu_target=sh2a-nofpu ;;
3287         sh2a*)                  sh_cpu_target=sh2a ;;
3288         sh2e*)                  sh_cpu_target=sh2e ;;
3289         sh2*)                   sh_cpu_target=sh2 ;;
3290         *)                      sh_cpu_target=sh1 ;;
3291         esac
3292         # did the user say --without-fp ?
3293         if test x$with_fp = xno; then
3294                 case ${sh_cpu_target} in
3295                 sh4al | sh1)    ;;
3296                 sh4a* )         sh_cpu_target=sh4a-nofpu ;;
3297                 sh4*)           sh_cpu_target=sh4-nofpu ;;
3298                 sh3*)           sh_cpu_target=sh3 ;;
3299                 sh2a*)          sh_cpu_target=sh2a-nofpu ;;
3300                 sh2*)           sh_cpu_target=sh2 ;;
3301                 *)      echo --without-fp not available for $target: ignored
3302                 esac
3303                 tm_defines="$tm_defines STRICT_NOFPU=1"
3304         fi
3305         sh_cpu_default="`echo $with_cpu|sed s/^m/sh/|tr A-Z_ a-z-`"
3306         case $sh_cpu_default in
3307           sh2a-single-only | sh2a-single | sh2a-nofpu | sh2a | \
3308           sh4a-single-only | sh4a-single | sh4a-nofpu | sh4a | sh4al | \
3309           sh4-single-only | sh4-single | sh4-nofpu | sh4 | sh4-300 | \
3310           sh3e | sh3 | sh2e | sh2 | sh1) ;;
3311         "")     sh_cpu_default=${sh_cpu_target} ;;
3312         *)      echo "with_cpu=$with_cpu not supported"; exit 1 ;;
3313         esac
3314         sh_multilibs=${with_multilib_list}
3315         if test "$sh_multilibs" = "default" ; then
3316                 case ${target} in
3317                 sh[1234]*)      sh_multilibs=${sh_cpu_target} ;;
3318                 sh-superh-*)    sh_multilibs=m4,m4-single,m4-single-only,m4-nofpu ;;
3319                 sh*-*-linux*)   sh_multilibs=m1,m2,m2a,m3e,m4 ;;
3320                 sh*-*-netbsd*)  sh_multilibs=m3,m3e,m4 ;;
3321                 *) sh_multilibs=m1,m2,m2e,m4,m4-single,m4-single-only,m2a,m2a-single ;;
3322                 esac
3323                 if test x$with_fp = xno; then
3324                         sh_multilibs="`echo $sh_multilibs|sed -e s/m4/sh4-nofpu/ -e s/,m4-[^,]*//g -e s/,m[23]e// -e s/m2a,m2a-single/m2a-nofpu/ -e s/m5-..m....,//g`"
3325                 fi
3326         fi
3327         target_cpu_default=SELECT_`echo ${sh_cpu_default}|tr abcdefghijklmnopqrstuvwxyz- ABCDEFGHIJKLMNOPQRSTUVWXYZ_`
3328         tm_defines=${tm_defines}' SH_MULTILIB_CPU_DEFAULT=\"'`echo $sh_cpu_default|sed s/sh/m/`'\"'
3329         tm_defines="$tm_defines SUPPORT_`echo $sh_cpu_default | sed 's/^m/sh/' | tr abcdefghijklmnopqrstuvwxyz- ABCDEFGHIJKLMNOPQRSTUVWXYZ_`=1"
3330         sh_multilibs=`echo $sh_multilibs | sed -e 's/,/ /g' -e 's/^[Ss][Hh]/m/' -e 's/ [Ss][Hh]/ m/g' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ_ abcdefghijklmnopqrstuvwxyz-`
3331         for sh_multilib in ${sh_multilibs}; do
3332                 case ${sh_multilib} in
3333                 m1 | m2 | m2e | m3 | m3e | \
3334                 m4 | m4-single | m4-single-only | m4-nofpu | m4-300 |\
3335                 m4a | m4a-single | m4a-single-only | m4a-nofpu | m4al | \
3336                 m2a | m2a-single | m2a-single-only | m2a-nofpu)
3337                         # TM_MULTILIB_CONFIG is used by t-sh for the non-endian multilib definition
3338                         # It is passed to MULTIILIB_OPTIONS verbatim.
3339                         TM_MULTILIB_CONFIG="${TM_MULTILIB_CONFIG}/${sh_multilib}"
3340                         tm_defines="$tm_defines SUPPORT_`echo $sh_multilib | sed 's/^m/sh/' | tr abcdefghijklmnopqrstuvwxyz- ABCDEFGHIJKLMNOPQRSTUVWXYZ_`=1"
3341                         ;;
3342                 \!*)    # TM_MULTILIB_EXCEPTIONS_CONFIG is used by t-sh
3343                         # It is passed the MULTILIB_EXCEPTIONS verbatim.
3344                         TM_MULTILIB_EXCEPTIONS_CONFIG="${TM_MULTILIB_EXCEPTIONS_CONFIG} `echo $sh_multilib | sed 's/^!//'`" ;;
3345                 *)
3346                         echo "with_multilib_list=${sh_multilib} not supported."
3347                         exit 1
3348                         ;;
3349                 esac
3350         done
3351         TM_MULTILIB_CONFIG=`echo $TM_MULTILIB_CONFIG | sed 's:^/::'`
3352         if test x${enable_incomplete_targets} = xyes ; then
3353                 tm_defines="$tm_defines SUPPORT_SH1=1 SUPPORT_SH2E=1 SUPPORT_SH4=1 SUPPORT_SH4_SINGLE=1 SUPPORT_SH2A=1 SUPPORT_SH2A_SINGLE=1"
3354         fi
3355         tm_file="$tm_file ./sysroot-suffix.h"
3356         tmake_file="$tmake_file t-sysroot-suffix"
3357         ;;
3358 sh-*-rtems*)
3359         tmake_file="${tmake_file} sh/t-sh sh/t-rtems"
3360         tm_file="${tm_file} dbxelf.h elfos.h sh/elf.h sh/embed-elf.h sh/rtemself.h rtems.h newlib-stdint.h"
3361         ;;
3362 sh-wrs-vxworks)
3363         tmake_file="$tmake_file sh/t-sh sh/t-vxworks"
3364         tm_file="${tm_file} elfos.h sh/elf.h sh/embed-elf.h vx-common.h vxworks.h sh/vxworks.h"
3365         ;;
3366 sparc-*-elf*)
3367         tm_file="${tm_file} dbxelf.h elfos.h newlib-stdint.h sparc/sysv4.h sparc/sp-elf.h"
3368         case ${target} in
3369             *-leon-*)
3370                 tmake_file="sparc/t-sparc sparc/t-leon"
3371                 ;;
3372             *-leon[3-9]*)
3373                 tmake_file="sparc/t-sparc sparc/t-leon3"
3374                 ;;
3375             *)
3376                 tmake_file="sparc/t-sparc sparc/t-elf"
3377                 ;;
3378         esac
3379         ;;
3380 sparc-*-rtems*)
3381         tm_file="${tm_file} dbxelf.h elfos.h sparc/sysv4.h sparc/sp-elf.h sparc/rtemself.h rtems.h newlib-stdint.h"
3382         tmake_file="${tmake_file} sparc/t-sparc sparc/t-rtems"
3383         ;;
3384 sparc-*-linux*)
3385         tm_file="${tm_file} dbxelf.h elfos.h sparc/sysv4.h gnu-user.h linux.h glibc-stdint.h sparc/tso.h"
3386         extra_options="${extra_options} sparc/long-double-switch.opt"
3387         case ${target} in
3388             *-leon-*)
3389                 tmake_file="${tmake_file} sparc/t-sparc sparc/t-leon"
3390                 ;;
3391             *-leon[3-9]*)
3392                 tmake_file="${tmake_file} sparc/t-sparc sparc/t-leon3"
3393                 ;;
3394             *)
3395                 tmake_file="${tmake_file} sparc/t-sparc"
3396                 ;;
3397         esac
3398         if test x$enable_targets = xall; then
3399                 tm_file="sparc/biarch64.h ${tm_file} sparc/linux64.h"
3400                 tmake_file="${tmake_file} sparc/t-linux64"
3401         else
3402                 tm_file="${tm_file} sparc/linux.h"
3403                 tmake_file="${tmake_file} sparc/t-linux"
3404         fi
3405         ;;
3406 sparc-*-netbsdelf*)
3407         tm_file="${tm_file} dbxelf.h elfos.h sparc/sysv4.h ${nbsd_tm_file} sparc/netbsd-elf.h"
3408         extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
3409         extra_options="${extra_options} sparc/long-double-switch.opt"
3410         tmake_file="${tmake_file} sparc/t-sparc"
3411         ;;
3412 sparc*-*-solaris2*)
3413         tm_file="sparc/biarch64.h ${tm_file} ${sol2_tm_file} sparc/tso.h"
3414         case ${target} in
3415             sparc64-*-* | sparcv9-*-*)
3416                 tm_file="sparc/default64.h ${tm_file}"
3417                 ;;
3418             *)
3419                 test x$with_cpu != x || with_cpu=v9
3420                 ;;
3421         esac
3422         tmake_file="${tmake_file} sparc/t-sparc sparc/t-sol2"
3423         ;;
3424 sparc-wrs-vxworks)
3425         tm_file="${tm_file} elfos.h sparc/sysv4.h vx-common.h vxworks.h sparc/vxworks.h"
3426         tmake_file="${tmake_file} sparc/t-sparc sparc/t-vxworks"
3427         ;;
3428 sparc64-*-elf*)
3429         tm_file="${tm_file} dbxelf.h elfos.h newlib-stdint.h sparc/sysv4.h sparc/sp64-elf.h"
3430         extra_options="${extra_options}"
3431         tmake_file="${tmake_file} sparc/t-sparc"
3432         ;;
3433 sparc64-*-rtems*)
3434         tm_file="${tm_file} dbxelf.h elfos.h newlib-stdint.h sparc/sysv4.h sparc/sp64-elf.h sparc/rtemself.h rtems.h"
3435         extra_options="${extra_options}"
3436         tmake_file="${tmake_file} sparc/t-sparc sparc/t-rtems-64"
3437         ;;
3438 sparc64-*-linux*)
3439         tm_file="sparc/biarch64.h ${tm_file} dbxelf.h elfos.h sparc/sysv4.h gnu-user.h linux.h glibc-stdint.h sparc/default64.h sparc/linux64.h sparc/tso.h"
3440         extra_options="${extra_options} sparc/long-double-switch.opt"
3441         tmake_file="${tmake_file} sparc/t-sparc sparc/t-linux64"
3442         ;;
3443 sparc64-*-freebsd*|ultrasparc-*-freebsd*)
3444         tm_file="${tm_file} ${fbsd_tm_file} dbxelf.h elfos.h sparc/sysv4.h sparc/freebsd.h"
3445         extra_options="${extra_options} sparc/long-double-switch.opt"
3446         case "x$with_cpu" in
3447                 xultrasparc) ;;
3448                 x) with_cpu=ultrasparc ;;
3449                 *) echo "$with_cpu not supported for freebsd target"; exit 1 ;;
3450         esac
3451         tmake_file="${tmake_file} sparc/t-sparc"
3452         ;;
3453 sparc64-*-netbsd*)
3454         tm_file="sparc/biarch64.h ${tm_file}"
3455         tm_file="${tm_file} dbxelf.h elfos.h sparc/sysv4.h ${nbsd_tm_file} sparc/netbsd-elf.h"
3456         extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
3457         extra_options="${extra_options} sparc/long-double-switch.opt"
3458         tmake_file="${tmake_file} sparc/t-sparc sparc/t-netbsd64"
3459         ;;
3460 sparc64-*-openbsd*)
3461         tm_file="sparc/openbsd1-64.h ${tm_file} dbxelf.h elfos.h sparc/sysv4.h sparc/sp64-elf.h"
3462         tm_file="${tm_file} openbsd.h openbsd-stdint.h openbsd-libpthread.h sparc/openbsd64.h"
3463         extra_options="${extra_options} openbsd.opt"
3464         extra_options="${extra_options}"
3465         gas=yes gnu_ld=yes
3466         with_cpu=ultrasparc
3467         tmake_file="${tmake_file} sparc/t-sparc"
3468         ;;
3469 tic6x-*-elf)
3470         tm_file="elfos.h ${tm_file} c6x/elf-common.h c6x/elf.h"
3471         tm_file="${tm_file} dbxelf.h tm-dwarf2.h newlib-stdint.h"
3472         tmake_file="c6x/t-c6x c6x/t-c6x-elf"
3473         use_collect2=no
3474         ;;
3475 tic6x-*-uclinux)
3476         tm_file="elfos.h ${tm_file} gnu-user.h linux.h c6x/elf-common.h c6x/uclinux-elf.h"
3477         tm_file="${tm_file} dbxelf.h tm-dwarf2.h glibc-stdint.h"
3478         tm_file="${tm_file} ./sysroot-suffix.h"
3479         tmake_file="t-sysroot-suffix t-slibgcc"
3480         tmake_file="${tmake_file} c6x/t-c6x c6x/t-c6x-elf c6x/t-c6x-uclinux"
3481         use_collect2=no
3482         ;;
3483 tilegx*-*-linux*)
3484         tm_file="elfos.h gnu-user.h linux.h glibc-stdint.h tilegx/linux.h ${tm_file}"
3485         tmake_file="${tmake_file} tilegx/t-tilegx"
3486         extra_objs="${extra_objs} mul-tables.o"
3487         c_target_objs="${c_target_objs} tilegx-c.o"
3488         cxx_target_objs="${cxx_target_objs} tilegx-c.o"
3489         extra_headers="feedback.h"
3490         case $target in
3491         tilegxbe-*)
3492                 tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1"
3493                 ;;
3494         esac
3495         ;;
3496 tilepro*-*-linux*)
3497         tm_file="elfos.h gnu-user.h linux.h glibc-stdint.h tilepro/linux.h ${tm_file}"
3498         tmake_file="${tmake_file} tilepro/t-tilepro"
3499         extra_objs="${extra_objs} mul-tables.o"
3500         c_target_objs="${c_target_objs} tilepro-c.o"
3501         cxx_target_objs="${cxx_target_objs} tilepro-c.o"
3502         extra_headers="feedback.h"
3503         ;;
3504 v850-*-rtems*)
3505         target_cpu_default="TARGET_CPU_generic"
3506         tm_file="elfos.h v850/v850.h"
3507         tm_file="${tm_file} v850/rtems.h rtems.h newlib-stdint.h"
3508         tmake_file="${tmake_file} v850/t-v850"
3509         tmake_file="${tmake_file} v850/t-rtems"
3510         use_collect2=no
3511         c_target_objs="v850-c.o"
3512         cxx_target_objs="v850-c.o"
3513         ;;
3514 v850*-*-*)
3515         case ${target} in
3516         v850e3v5-*-*)
3517                 target_cpu_default="TARGET_CPU_v850e3v5"
3518                 ;;
3519         v850e2v3-*-*)
3520                 target_cpu_default="TARGET_CPU_v850e2v3"
3521                 ;;
3522         v850e2-*-*)
3523                 target_cpu_default="TARGET_CPU_v850e2"
3524                 ;;
3525         v850e1-*-* | v850es-*-*)
3526                 target_cpu_default="TARGET_CPU_v850e1"
3527                 ;;
3528         v850e-*-*)
3529                 target_cpu_default="TARGET_CPU_v850e"
3530                 ;;
3531         v850-*-*)
3532                 target_cpu_default="TARGET_CPU_generic"
3533                 ;;
3534         esac
3535         tm_file="elfos.h newlib-stdint.h v850/v850.h"
3536         use_collect2=no
3537         c_target_objs="v850-c.o"
3538         cxx_target_objs="v850-c.o"
3539         use_gcc_stdint=wrap
3540         ;;
3541 vax-*-linux*)
3542         tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h linux.h vax/elf.h vax/linux.h"
3543         extra_options="${extra_options} vax/elf.opt"
3544         ;;
3545 vax-*-netbsdelf*)
3546         tm_file="${tm_file} elfos.h ${nbsd_tm_file} vax/elf.h vax/netbsd-elf.h"
3547         extra_options="${extra_options} netbsd.opt netbsd-elf.opt vax/elf.opt"
3548         tm_defines="${tm_defines} CHAR_FAST8=1 SHORT_FAST16=1"
3549         ;;
3550 visium-*-elf*)
3551         tm_file="dbxelf.h elfos.h ${tm_file} visium/elf.h newlib-stdint.h"
3552         tmake_file="visium/t-visium visium/t-crtstuff"
3553         ;;
3554 xstormy16-*-elf)
3555         # For historical reasons, the target files omit the 'x'.
3556         tm_file="dbxelf.h elfos.h newlib-stdint.h stormy16/stormy16.h"
3557         tm_p_file=stormy16/stormy16-protos.h
3558         md_file=stormy16/stormy16.md
3559         out_file=stormy16/stormy16.cc
3560         extra_options=stormy16/stormy16.opt
3561         tmake_file="stormy16/t-stormy16"
3562         ;;
3563 xtensa*-*-elf*)
3564         tm_file="${tm_file} elfos.h newlib-stdint.h xtensa/elf.h"
3565         extra_options="${extra_options} xtensa/elf.opt"
3566         ;;
3567 xtensa*-*-linux*)
3568         tm_file="${tm_file} elfos.h gnu-user.h linux.h glibc-stdint.h xtensa/linux.h"
3569         tmake_file="${tmake_file} xtensa/t-xtensa"
3570         ;;
3571 xtensa*-*-uclinux*)
3572         tm_file="${tm_file} elfos.h gnu-user.h linux.h glibc-stdint.h xtensa/uclinux.h"
3573         tmake_file="${tmake_file} xtensa/t-xtensa"
3574         extra_options="${extra_options} xtensa/uclinux.opt"
3575         ;;
3576 am33_2.0-*-linux*)
3577         tm_file="mn10300/mn10300.h elfos.h gnu-user.h linux.h glibc-stdint.h mn10300/linux.h"
3578         gas=yes gnu_ld=yes
3579         use_collect2=no
3580         ;;
3581 m32c-*-rtems*)
3582         tm_file="elfos.h ${tm_file} m32c/rtems.h rtems.h newlib-stdint.h"
3583         c_target_objs="m32c-pragma.o"
3584         cxx_target_objs="m32c-pragma.o"
3585         ;;
3586 m32c-*-elf*)
3587         tm_file="elfos.h newlib-stdint.h ${tm_file}"
3588         c_target_objs="m32c-pragma.o"
3589         cxx_target_objs="m32c-pragma.o"
3590         ;;
3592         echo "*** Configuration ${target} not supported" 1>&2
3593         exit 1
3594         ;;
3595 esac
3597 case ${target} in
3598 i[34567]86-*-linux* | x86_64-*-linux*)
3599         tmake_file="${tmake_file} i386/t-pmm_malloc i386/t-i386"
3600         ;;
3601 i[34567]86-*-* | x86_64-*-*)
3602         tmake_file="${tmake_file} i386/t-gmm_malloc i386/t-i386"
3603         ;;
3604 powerpc*-*-* | rs6000-*-*)
3605         tm_file="${tm_file} ${cpu_type}/option-defaults.h"
3606 esac
3608 # non-glibc systems
3609 case ${target} in
3610 *-linux-musl*)
3611         tmake_file="${tmake_file} t-musl"
3612         ;;
3613 *-linux-uclibc*)
3614         tmake_file="${tmake_file} t-uclibc"
3615         ;;
3616 esac
3618 # Assume the existence of indirect function support and allow the use of the
3619 # resolver attribute.
3620 case ${target} in
3621 *-*-linux*android*|*-*-linux*uclibc*|*-*-linux*musl*)
3622         ;;
3623 *-*-kfreebsd*-gnu | *-*-kopensolaris*-gnu)
3624         ;;
3625 *-*-linux* | *-*-gnu*)
3626         case ${target} in
3627         aarch64*-* | arm*-* | i[34567]86-* | powerpc*-* | s390*-* | sparc*-* | x86_64-* | loongarch*-*)
3628                 default_gnu_indirect_function=yes
3629                 ;;
3630         esac
3631         ;;
3632 esac
3634 # Build mkoffload tool
3635 case ${target} in
3636 *-intelmic-* | *-intelmicemul-*)
3637         tmake_file="${tmake_file} i386/t-intelmic"
3638         tm_file="${tm_file} i386/intelmic-offload.h"
3639         ;;
3640 esac
3642 if [ "$target_has_targetcm" = "no" ]; then
3643   c_target_objs="$c_target_objs default-c.o"
3644   cxx_target_objs="$cxx_target_objs default-c.o"
3647 if [ "$common_out_file" = "" ]; then
3648   if [ "$target_has_targetm_common" = "yes" ]; then
3649     common_out_file="$cpu_type/$cpu_type-common.cc"
3650   else
3651     common_out_file="default-common.cc"
3652   fi
3655 if [ "$target_has_targetdm" = "no" ]; then
3656   d_target_objs="$d_target_objs default-d.o"
3659 # Support for --with-cpu and related options (and a few unrelated options,
3660 # too).
3661 case ${with_cpu} in
3662   yes | no)
3663     echo "--with-cpu must be passed a value" 1>&2
3664     exit 1
3665     ;;
3666 esac
3668 # Set arch and cpu from ${target} and ${target_noncanonical}.  Set cpu
3669 # to generic if there is no processor scheduler model for the target.
3670 arch=
3671 cpu=
3672 arch_without_sse2=no
3673 arch_without_64bit=no
3674 case ${target} in
3675   i386-*-freebsd*)
3676     if test $fbsd_major -ge 6; then
3677       arch=i486
3678     else
3679       arch=i386
3680     fi
3681     cpu=generic
3682     arch_without_sse2=yes
3683     arch_without_64bit=yes
3684     ;;
3685   i386-*-netbsd*)
3686     arch=i486
3687     cpu=generic
3688     arch_without_sse2=yes
3689     arch_without_64bit=yes
3690     ;;
3691   i386-*-*)
3692     arch=i386
3693     cpu=i386
3694     arch_without_sse2=yes
3695     arch_without_64bit=yes
3696     ;;
3697   i486-*-*)
3698     arch=i486
3699     cpu=i486
3700     arch_without_sse2=yes
3701     arch_without_64bit=yes
3702     ;;
3703   i586-*-*)
3704     arch_without_sse2=yes
3705     arch_without_64bit=yes
3706     case ${target_noncanonical} in
3707       k6_2-*)
3708         arch=k6-2
3709         cpu=k6-2
3710         ;;
3711       k6_3-*)
3712         arch=k6-3
3713         cpu=k6-3
3714         ;;
3715       k6-*)
3716         arch=k6
3717         cpu=k6
3718         ;;
3719       pentium_mmx-*|winchip_c6-*|winchip2-*|c3-*)
3720         arch=pentium-mmx
3721         cpu=pentium-mmx
3722         ;;
3723       *)
3724         arch=pentium
3725         cpu=pentium
3726         ;;
3727     esac
3728     ;;
3729   i686-*-* | i786-*-*)
3730     case ${target_noncanonical} in
3731       znver1-*)
3732         arch=znver1
3733         cpu=znver1
3734         ;;
3735       znver2-*)
3736         arch=znver2
3737         cpu=znver2
3738         ;;
3739       znver3-*)
3740         arch=znver3
3741         cpu=znver3
3742         ;;
3743       znver4-*)
3744         arch=znver4
3745         cpu=znver4
3746         ;;
3747       bdver4-*)
3748         arch=bdver4
3749         cpu=bdver4
3750         ;;
3751       bdver3-*)
3752         arch=bdver3
3753         cpu=bdver3
3754         ;;
3755       bdver2-*)
3756         arch=bdver2
3757         cpu=bdver2
3758         ;;
3759       bdver1-*)
3760         arch=bdver1
3761         cpu=bdver1
3762         ;;
3763       btver1-*)
3764         arch=btver1
3765         cpu=btver1
3766         ;;
3767       btver2-*)
3768         arch=btver2
3769         cpu=btver2
3770         ;;
3771       amdfam10-*|barcelona-*)
3772         arch=amdfam10
3773         cpu=amdfam10
3774         ;;
3775       k8_sse3-*|opteron_sse3-*|athlon64_sse3-*)
3776         arch=k8-sse3
3777         cpu=k8-sse3
3778         ;;
3779       k8-*|opteron-*|athlon64-*|athlon_fx-*)
3780         arch=k8
3781         cpu=k8
3782         ;;
3783       athlon_xp-*|athlon_mp-*|athlon_4-*)
3784         arch=athlon-4
3785         cpu=athlon-4
3786         arch_without_sse2=yes
3787         arch_without_64bit=yes
3788         ;;
3789       athlon_tbird-*|athlon-*)
3790         arch=athlon
3791         cpu=athlon
3792         arch_without_sse2=yes
3793         ;;
3794       geode-*)
3795         arch=geode
3796         cpu=geode
3797         arch_without_sse2=yes
3798         ;;
3799       pentium2-*)
3800         arch=pentium2
3801         cpu=pentium2
3802         arch_without_sse2=yes
3803         ;;
3804       pentium3-*|pentium3m-*)
3805         arch=pentium3
3806         cpu=pentium3
3807         arch_without_sse2=yes
3808         ;;
3809       pentium4-*|pentium4m-*)
3810         arch=pentium4
3811         cpu=pentium4
3812         ;;
3813       prescott-*)
3814         arch=prescott
3815         cpu=prescott
3816         ;;
3817       nocona-*)
3818         arch=nocona
3819         cpu=nocona
3820         ;;
3821       atom-*)
3822         arch=atom
3823         cpu=atom
3824         ;;
3825       slm-*)
3826         arch=slm
3827         cpu=slm
3828         ;;
3829       core2-*)
3830         arch=core2
3831         cpu=core2
3832         ;;
3833       corei7-*)
3834         arch=corei7
3835         cpu=corei7
3836         ;;
3837       corei7_avx-*)
3838         arch=corei7-avx
3839         cpu=corei7-avx
3840         ;;
3841       pentium_m-*)
3842         arch=pentium-m
3843         cpu=pentium-m
3844         ;;
3845       pentiumpro-*)
3846         arch=pentiumpro
3847         cpu=pentiumpro
3848         arch_without_sse2=yes
3849         ;;
3850       *)
3851         arch=pentiumpro
3852         cpu=generic
3853         arch_without_sse2=yes
3854         arch_without_64bit=yes
3855         ;;
3856     esac
3857     ;;
3858   x86_64-*-*)
3859     case ${target_noncanonical} in
3860       znver1-*)
3861         arch=znver1
3862         cpu=znver1
3863         ;;
3864       znver2-*)
3865         arch=znver2
3866         cpu=znver2
3867         ;;
3868       znver3-*)
3869         arch=znver3
3870         cpu=znver3
3871         ;;
3872           znver4-*)
3873         arch=znver4
3874         cpu=znver4
3875         ;;
3876       bdver4-*)
3877         arch=bdver4
3878         cpu=bdver4
3879         ;;
3880       bdver3-*)
3881         arch=bdver3
3882         cpu=bdver3
3883         ;;
3884       bdver2-*)
3885         arch=bdver2
3886         cpu=bdver2
3887         ;;
3888       bdver1-*)
3889         arch=bdver1
3890         cpu=bdver1
3891         ;;
3892       btver1-*)
3893         arch=btver1
3894         cpu=btver1
3895         ;;
3896       btver2-*)
3897         arch=btver2
3898         cpu=btver2
3899         ;;
3900       amdfam10-*|barcelona-*)
3901         arch=amdfam10
3902         cpu=amdfam10
3903         ;;
3904       k8_sse3-*|opteron_sse3-*|athlon64_sse3-*)
3905         arch=k8-sse3
3906         cpu=k8-sse3
3907         ;;
3908       k8-*|opteron-*|athlon_64-*)
3909         arch=k8
3910         cpu=k8
3911         ;;
3912       nocona-*)
3913         arch=nocona
3914         cpu=nocona
3915         ;;
3916       atom-*)
3917         arch=atom
3918         cpu=atom
3919         ;;
3920       slm-*)
3921         arch=slm
3922         cpu=slm
3923         ;;
3924       core2-*)
3925         arch=core2
3926         cpu=core2
3927         ;;
3928       corei7-*)
3929         arch=corei7
3930         cpu=corei7
3931         ;;
3932       *)
3933         arch=x86-64
3934         cpu=generic
3935         ;;
3936     esac
3937     ;;
3938 esac
3940 # If there is no $with_cpu option, try to infer one from ${target}.
3941 # This block sets nothing except for with_cpu.
3942 if test x$with_cpu = x ; then
3943   case ${target} in
3944     i[34567]86-*-elfiamcu)
3945       with_cpu=lakemont
3946       ;;
3947     i[34567]86-*-*|x86_64-*-*)
3948       with_cpu=$cpu
3949       ;;
3950     alphaev6[78]*-*-*)
3951       with_cpu=ev67
3952       ;;
3953     alphaev6*-*-*)
3954       with_cpu=ev6
3955       ;;
3956     alphapca56*-*-*)
3957       with_cpu=pca56
3958       ;;
3959     alphaev56*-*-*)
3960       with_cpu=ev56
3961       ;;
3962     alphaev5*-*-*)
3963       with_cpu=ev5
3964       ;;
3965     frv-*-*linux* | frv400-*-*linux*)
3966       with_cpu=fr400
3967       ;;
3968     frv550-*-*linux*)
3969       with_cpu=fr550
3970       ;;
3971     m68k*-*-*)
3972       case "$with_arch" in
3973         "cf")
3974           with_cpu=${default_cf_cpu}
3975           ;;
3976         "" | "m68k")
3977           with_cpu=m${default_m68k_cpu}
3978           ;;
3979       esac
3980       ;;
3981     sparc*-*-*)
3982       case ${target} in
3983         *-leon-*)
3984           with_cpu=leon
3985           ;;
3986         *-leon[3-9]*)
3987           with_cpu=leon3
3988           ;;
3989         *-leon[3-9]v7*)
3990           with_cpu=leon3v7
3991           ;;
3992         *)
3993           with_cpu="`echo ${target} | sed 's/-.*$//'`"
3994           ;;
3995       esac
3996       ;;
3997     visium-*-*)
3998       with_cpu=gr5
3999       ;;
4000   esac
4002   # Avoid overriding --with-cpu-32 and --with-cpu-64 values.
4003   case ${target} in
4004     i[34567]86-*-*|x86_64-*-*)
4005       if test x$with_cpu_32 != x || test x$with_cpu_64 != x; then
4006         if test x$with_cpu_32 = x; then
4007           with_cpu_32=$with_cpu
4008         fi
4009         if test x$with_cpu_64 = x; then
4010           with_cpu_64=$with_cpu
4011         fi
4012         with_cpu=
4013       fi
4014       ;;
4015   esac
4018 # Support for --with-arch and related options (and a few unrelated options,
4019 # too).
4020 case ${with_arch} in
4021   yes | no)
4022     echo "--with-arch must be passed a value" 1>&2
4023     exit 1
4024     ;;
4025 esac
4027 # If there is no $with_arch option, try to infer one from ${target}.
4028 # This block sets nothing except for with_arch.
4029 if test x$with_arch = x ; then
4030   case ${target} in
4031     i[34567]86-*-darwin*|x86_64-*-darwin*)
4032       # Default arch is set via TARGET_SUBTARGET32_ISA_DEFAULT
4033       # and TARGET_SUBTARGET64_ISA_DEFAULT in config/i386/darwin.h.
4034       ;;
4035     i[34567]86-*-elfiamcu)
4036       with_arch=lakemont
4037       ;;
4038     i[34567]86-*-*)
4039       # --with-fpmath sets the default ISA to SSE2, which is the same
4040       # ISA supported by Pentium 4.
4041       if test x$with_fpmath = x || test $arch_without_sse2 = no; then
4042         with_arch=$arch
4043       else
4044         with_arch=pentium4
4045       fi
4046       ;;
4047     x86_64-*-*)
4048       with_arch=$arch
4049       ;;
4050     mips64r5900-*-* | mips64r5900el-*-* | mipsr5900-*-* | mipsr5900el-*-*)
4051       with_arch=r5900
4052       ;;
4053     mips*-*-vxworks)
4054       with_arch=mips2
4055       ;;
4056   esac
4058   # Avoid overriding --with-arch-32 and --with-arch-64 values.
4059   case ${target} in
4060     i[34567]86-*-darwin*|x86_64-*-darwin*)
4061       # Default arch is set via TARGET_SUBTARGET32_ISA_DEFAULT
4062       # and TARGET_SUBTARGET64_ISA_DEFAULT in config/i386/darwin.h.
4063       ;;
4064     i[34567]86-*-*|x86_64-*-*)
4065       if test x$with_arch_32 != x || test x$with_arch_64 != x; then
4066         if test x$with_arch_32 = x; then
4067           with_arch_32=$with_arch
4068         fi
4069         if test x$with_arch_64 = x; then
4070           if test $arch_without_64bit = yes; then
4071             # Set the default 64bit arch to x86-64 if the default arch
4072             # doesn't support 64bit.
4073             with_arch_64=x86-64
4074           else
4075             with_arch_64=$with_arch
4076           fi
4077         fi
4078         with_arch=
4079       elif test $arch_without_64bit$need_64bit_isa = yesyes; then
4080         # Set the default 64bit arch to x86-64 if the default arch
4081         # doesn't support 64bit and we need 64bit ISA.
4082         with_arch_32=$with_arch
4083         with_arch_64=x86-64
4084         with_arch=
4085       fi
4086       ;;
4087   esac
4090 # Infer a default setting for --with-float.
4091 if test x$with_float = x; then
4092   case ${target} in
4093     mips64r5900-*-* | mips64r5900el-*-* | mipsr5900-*-* | mipsr5900el-*-*)
4094       # The R5900 doesn't support 64-bit float.  32-bit float doesn't
4095       # comply with IEEE 754.
4096       with_float=soft
4097       ;;
4098   esac
4101 # Infer a default setting for --with-fpu.
4102 if test x$with_fpu = x; then
4103   case ${target} in
4104     mips64r5900-*-* | mips64r5900el-*-* | mipsr5900-*-* | mipsr5900el-*-*)
4105       # The R5900 FPU only supports single precision.
4106       with_fpu=single
4107       ;;
4108   esac
4111 # Support --with-fpmath.
4112 if test x$with_fpmath != x; then
4113   case ${target} in
4114     i[34567]86-*-* | x86_64-*-*)
4115       case ${with_fpmath} in
4116       avx)
4117         tm_file="${tm_file} i386/avxmath.h"
4118         ;;
4119       sse)
4120         tm_file="${tm_file} i386/ssemath.h"
4121         ;;
4122       *)
4123         echo "Invalid --with-fpmath=$with_fpmath" 1>&2
4124         exit 1
4125         ;;
4126       esac
4127       ;;
4128     *)
4129       echo "--with-fpmath isn't supported for $target." 1>&2
4130       exit 1
4131       ;;
4132   esac
4135 # Similarly for --with-schedule.
4136 if test x$with_schedule = x; then
4137         case ${target} in
4138         hppa1*)
4139                 # Override default PA8000 scheduling model.
4140                 with_schedule=7100LC
4141                 ;;
4142         esac
4145 # Infer a default setting for --with-llsc.
4146 if test x$with_llsc = x; then
4147   case ${target} in
4148     mips*-*-linux*)
4149       # The kernel emulates LL and SC where necessary.
4150       with_llsc=yes
4151       ;;
4152     mips64r5900-*-* | mips64r5900el-*-* | mipsr5900-*-* | mipsr5900el-*-*)
4153       # The R5900 doesn't support LL(D) and SC(D).
4154       with_llsc=no
4155       ;;
4156   esac
4159 # Validate and mark as valid any --with options supported
4160 # by this target.  In order to use a particular --with option
4161 # you must list it in supported_defaults; validating the value
4162 # is optional.  This case statement should set nothing besides
4163 # supported_defaults.
4165 supported_defaults=
4166 case "${target}" in
4167         aarch64*-*-*)
4168                 supported_defaults="abi cpu cpu_64 arch arch_64 tune tune_64"
4169                 if test x$with_cpu_64 != x && test x$with_cpu = x; then
4170                         with_cpu=$with_cpu_64
4171                 fi
4172                 if test x$with_arch_64 != x && test x$with_arch = x; then
4173                         with_arch=$with_arch_64
4174                 fi
4175                 if test x$with_tune_64 != x && test x$with_tune = x; then
4176                         with_tune=$with_tune_64
4177                 fi
4178                 for which in cpu arch tune; do
4179                         eval "val=\$with_$which"
4180                         base_val=`echo $val | sed -e 's/\+.*//'`
4181                         ext_val=`echo $val | sed -e 's/[a-z0-9.-]\+//'`
4183                         if [ $which = arch ]; then
4184                           def=aarch64-arches.def
4185                           pattern=AARCH64_ARCH
4186                         else
4187                           def=aarch64-cores.def
4188                           pattern=AARCH64_CORE
4189                         fi
4191                         ext_mask=AARCH64_CPU_DEFAULT_FLAGS
4193                         # Find the base CPU or ARCH id in aarch64-cores.def or
4194                         # aarch64-arches.def
4195                         if [ x"$base_val" = x ] \
4196                             || grep "^$pattern(\"$base_val\"," \
4197                                     ${srcdir}/config/aarch64/$def \
4198                                     > /dev/null; then
4200                           if [ $which = arch ]; then
4201                                 base_id=`grep "^$pattern(\"$base_val\"," \
4202                                   ${srcdir}/config/aarch64/$def | \
4203                                   sed -e 's/^[^,]*,[    ]*//' | \
4204                                   sed -e 's/,.*$//'`
4205                                 # Extract the architecture flags from aarch64-arches.def
4206                                 ext_mask=`grep "^$pattern(\"$base_val\"," \
4207                                    ${srcdir}/config/aarch64/$def | \
4208                                    sed -e 's/)$//' | \
4209                                    sed -e 's/^.*,//'`
4210                           else
4211                                 base_id=`grep "^$pattern(\"$base_val\"," \
4212                                   ${srcdir}/config/aarch64/$def | \
4213                                   sed -e 's/^[^,]*,[    ]*//' | \
4214                                   sed -e 's/,.*$//'`
4215                           fi
4217                           # Disallow extensions in --with-tune=cortex-a53+crc.
4218                           if [ $which = tune ] && [ x"$ext_val" != x ]; then
4219                             echo "Architecture extensions not supported in --with-$which=$val" 1>&2
4220                             exit 1
4221                           fi
4223                           # Use the pre-processor to strip flatten the options.
4224                           # This makes the format less rigid than if we use
4225                           # grep and sed directly here.
4226                           opt_macro="AARCH64_OPT_EXTENSION(A, B, C, D, E, F)=A, B, C, D, E, F"
4227                           options_parsed="`$ac_cv_prog_CPP -D"$opt_macro" -x c \
4228                                 ${srcdir}/config/aarch64/aarch64-option-extensions.def`"
4230                           # Match one element inside AARCH64_OPT_EXTENSION, we
4231                           # consume anything that's not a ,.
4232                           elem="[       ]*\([^,]\+\)[   ]*"
4234                           # Repeat the pattern for the number of entries in the
4235                           # AARCH64_OPT_EXTENSION, currently 6 times.
4236                           sed_patt="^$elem,$elem,$elem,$elem,$elem,$elem"
4238                           while [ x"$ext_val" != x ]
4239                           do
4240                                 ext_val=`echo $ext_val | sed -e 's/\+//'`
4241                                 ext=`echo $ext_val | sed -e 's/\+.*//'`
4242                                 base_ext=`echo $ext | sed -e 's/^no//'`
4243                                 opt_line=`echo -e "$options_parsed" | \
4244                                         grep "^\"$base_ext\""`
4246                                 if [ x"$base_ext" = x ] \
4247                                     || [[ -n $opt_line ]]; then
4249                                   # These regexp extract the elements based on
4250                                   # their group match index in the regexp.
4251                                   ext_canon=`echo -e "$opt_line" | \
4252                                         sed -e "s/$sed_patt/\2/"`
4253                                   ext_on=`echo -e "$opt_line" | \
4254                                         sed -e "s/$sed_patt/\3/"`
4255                                   ext_off=`echo -e "$opt_line" | \
4256                                         sed -e "s/$sed_patt/\4/"`
4258                                   if [ $ext = $base_ext ]; then
4259                                         # Adding extension
4260                                         ext_mask="("$ext_mask") | ("$ext_on" | "$ext_canon")"
4261                                   else
4262                                         # Removing extension
4263                                         ext_mask="("$ext_mask") & ~("$ext_off" | "$ext_canon")"
4264                                   fi
4266                                   true
4267                                 else
4268                                   echo "Unknown extension used in --with-$which=$val" 1>&2
4269                                   exit 1
4270                                 fi
4271                                 ext_val=`echo $ext_val | sed -e 's/[a-z0-9]\+//'`
4272                           done
4274                           ext_mask="(("$ext_mask") << TARGET_CPU_NBITS)"
4275                           if [ x"$base_id" != x ]; then
4276                                 target_cpu_cname="TARGET_CPU_$base_id | $ext_mask"
4277                           fi
4278                           true
4279                         else
4280                           # Allow --with-$which=native.
4281                           if [ "$val" = native ]; then
4282                             true
4283                           else
4284                             echo "Unknown $which used in --with-$which=$val" 1>&2
4285                             exit 1
4286                           fi
4287                         fi
4288                 done
4289                 ;;
4291         alpha*-*-*)
4292                 supported_defaults="cpu tune"
4293                 for which in cpu tune; do
4294                         eval "val=\$with_$which"
4295                         case "$val" in
4296                         "" \
4297                         | ev4 | ev45 | 21064 | ev5 | 21164 | ev56 | 21164a \
4298                         | pca56 | 21164PC | 21164pc | ev6 | 21264 | ev67 \
4299                         | 21264a)
4300                                 ;;
4301                         *)
4302                                 echo "Unknown CPU used in --with-$which=$val" 1>&2
4303                                 exit 1
4304                                 ;;
4305                         esac
4306                 done
4307                 ;;
4309         arc*-*-*)
4310                 supported_defaults="cpu fpu"
4312                 new_cpu=hs38_linux
4313                 if [ x"$with_cpu" = x ] \
4314                     || grep -q -E "^ARC_CPU[[:blank:]]*\($with_cpu," \
4315                        ${srcdir}/config/arc/arc-cpus.def
4316                 then
4317                  # Ok
4318                  new_cpu=$with_cpu
4319                 else
4320                  echo "Unknown cpu used in --with-cpu=$with_cpu" 1>&2
4321                  exit 1
4322                 fi
4324                 # see if --with-fpu matches any of the supported FPUs
4325                 case "$with_fpu" in
4326                 "")
4327                         # OK
4328                         ;;
4329                 fpus | fpus_div | fpus_fma | fpus_all)
4330                         # OK if em or hs
4331                         flags_ok="[emhs]+"
4332                         ;;
4333                 fpuda | fpuda_div | fpuda_fma | fpuda_all)
4334                         # OK only em
4335                         flags_ok="em"
4336                         ;;
4337                 fpud | fpud_div | fpud_fma | fpud_all)
4338                         # OK only hs
4339                         flags_ok="hs"
4340                         ;;
4341                 *)
4342                         echo "Unknown floating point type used in "\
4343                              "--with-fpu=$with_fpu" 1>&2
4344                         exit 1
4345                         ;;
4346                 esac
4348                 if [ -n "$flags_ok" ] \
4349                    && ! grep -q -E "^ARC_CPU[[:blank:]]*\($new_cpu,[[:blank:]]*$flags_ok," \
4350                    ${srcdir}/config/arc/arc-cpus.def
4351                 then
4352                    echo "Unknown floating point type used in "\
4353                          "--with-fpu=$with_fpu for cpu $new_cpu" 1>&2
4354                          exit 1
4355                 fi
4356                 ;;
4358         avr-*-*)
4359                 # Handle --with-multilib-list.
4360                 if test "x${with_multilib_list}" != xdefault; then
4361                         TM_MULTILIB_CONFIG="${with_multilib_list}"
4362                 fi
4363         ;;
4365     csky-*-*)
4366         supported_defaults="cpu endian float"
4367         ;;
4369         arm*-*-*)
4370                 supported_defaults="arch cpu float tune fpu abi mode tls"
4371                 for which in cpu tune arch; do
4372                         # See if it matches a supported value
4373                         eval "val=\$with_$which"
4374                         if [ x"$val" != x ]; then
4375                           cpu=`awk -f ${srcdir}/config/arm/parsecpu.awk \
4376                                 -v cmd="chk$which $val" \
4377                                 ${srcdir}/config/arm/arm-cpus.in`
4378                           if [ "$cpu" = "error" ]; then
4379                             echo "Unknown target in --with-$which=$val" 1>&2
4380                             exit 1
4381                           else
4382                             new_val=$cpu
4383                             eval "target_${which}_cname=$new_val"
4384                             echo "For $val real value is $new_val"
4385                           fi
4386                         fi
4387                 done
4389                 case "$with_float" in
4390                 "" \
4391                 | soft | hard | softfp)
4392                         # OK
4393                         ;;
4394                 *)
4395                         echo "Unknown floating point type used in --with-float=$with_float" 1>&2
4396                         exit 1
4397                         ;;
4398                 esac
4400                 # see if --with-fpu matches any of the supported FPUs
4401                 if [ x"$with_fpu" != x ] ; then
4402                   val=$with_fpu
4403                   fpu=`awk -f ${srcdir}/config/arm/parsecpu.awk \
4404                         -v cmd="chkfpu $val" \
4405                         ${srcdir}/config/arm/arm-cpus.in`
4406                   if [ "$fpu" = "error" ]
4407                   then
4408                     echo "Unknown target in --with-fpu=$val" 1>&2
4409                     exit 1
4410                   fi
4411                 fi
4413                 case "$with_abi" in
4414                 "" \
4415                 | apcs-gnu | atpcs | aapcs | iwmmxt | aapcs-linux )
4416                         #OK
4417                         ;;
4418                 *)
4419                         echo "Unknown ABI used in --with-abi=$with_abi"
4420                         exit 1
4421                         ;;
4422                 esac
4424                 case "$with_mode" in
4425                 "" \
4426                 | arm | thumb )
4427                         #OK
4428                         ;;
4429                 *)
4430                         echo "Unknown mode used in --with-mode=$with_mode"
4431                         exit 1
4432                         ;;
4433                 esac
4435                 case "$with_tls" in
4436                 "" \
4437                 | gnu | gnu2)
4438                         # OK
4439                         ;;
4440                 *)
4441                         echo "Unknown TLS method used in --with-tls=$with_tls" 1>&2
4442                         exit 1
4443                         ;;
4444                 esac
4446                 if test "x$with_arch" != x && test "x$with_cpu" != x; then
4447                         echo "Switch \"--with-arch\" may not be used with switch \"--with-cpu\""  1>&2
4448                         exit 1
4449                 fi
4451                 if test "x$with_cpu" != x && test "x$with_tune" != x; then
4452                         echo "Switch \"--with-tune\" may not be used with switch \"--with-cpu\""  1>&2
4453                         exit 1
4454                 fi
4456                 # Add extra multilibs
4457                 if test "x$with_multilib_list" != x; then
4458                         ml=
4459                         arm_multilibs=`echo $with_multilib_list | sed -e 's/,/ /g'`
4460                         if test "x${arm_multilibs}" != xdefault ; then
4461                                 for arm_multilib in ${arm_multilibs}; do
4462                                         case ${arm_multilib} in
4463                                         aprofile|rmprofile)
4464                                                 tmake_profile_file="arm/t-multilib"
4465                                                 tm_mlib_file="arm/arm-mlib.h"
4466                                                 ;;
4467                                         @*)
4468                                                 ml=`echo "X$arm_multilib" | sed '1s,^X@,,'`
4469                                                 if test -f "${srcdir}/config/arm/${ml}"; then
4470                                                         tmake_file="${tmake_file} arm/${ml}"
4471                                                 else
4472                                                         echo "Error: ${ml} does not exist in ${srcdir}/config/arm" >&2
4473                                                         exit 1
4474                                                 fi
4475                                                 ;;
4476                                         *)
4477                                                 echo "Error: --with-multilib-list=${with_multilib_list} not supported." 1>&2
4478                                                 exit 1
4479                                                 ;;
4480                                         esac
4481                                 done
4482                         fi
4484                         if test "x${tmake_profile_file}" != x ; then
4485                                 # arm/t-aprofile and arm/t-rmprofile are only
4486                                 # designed to work without any with-cpu,
4487                                 # with-arch, with-mode, with-fpu or with-float
4488                                 # options.
4489                                 if test "x$with_arch" != x \
4490                                     || test "x$with_cpu" != x \
4491                                     || test "x$with_float" != x \
4492                                     || test "x$with_fpu" != x \
4493                                     || test "x$with_mode" != x ; then
4494                                     echo "Error: You cannot use any of --with-arch/cpu/fpu/float/mode with --with-multilib-list=${with_multilib_list}" 1>&2
4495                                     exit 1
4496                                 elif test "x$ml" != x ; then
4497                                     echo "Error: You cannot use builtin multilib profiles along with custom ones" 1>&2
4498                                     exit 1
4499                                 fi
4500                                 # But pass the default value for float-abi
4501                                 # through to the multilib selector
4502                                 with_float="soft"
4503                                 tmake_file="${tmake_file} ${tmake_profile_file}"
4504                                 tm_file="$tm_file $tm_mlib_file"
4505                                 TM_MULTILIB_CONFIG="$with_multilib_list"
4506                         fi
4507                 fi
4508                 target_cpu_cname=${target_cpu_cname:-arm7tdmi}
4509                 with_cpu=${with_cpu:-$target_cpu_cname}
4510                 ;;
4512         fr*-*-*linux*)
4513                 supported_defaults=cpu
4514                 case "$with_cpu" in
4515                 fr400) ;;
4516                 fr550) ;;
4517                 *)
4518                         echo "Unknown cpu used in --with-cpu=$with_cpu" 1>&2
4519                         exit 1
4520                         ;;
4521                 esac
4522                 ;;
4524         fido-*-* | m68k*-*-*)
4525                 supported_defaults="arch cpu"
4526                 case "$with_arch" in
4527                 "" | "m68k"| "cf")
4528                         m68k_arch_family="$with_arch"
4529                         ;;
4530                 *)
4531                         echo "Invalid --with-arch=$with_arch" 1>&2
4532                         exit 1
4533                         ;;
4534                 esac
4536                 # We always have a $with_cpu setting here.
4537                 case "$with_cpu" in
4538                 "m68000" | "m68010" | "m68020" | "m68030" | "m68040" | "m68060")
4539                         m68k_cpu_ident=$with_cpu
4540                         ;;
4541                 "m68020-40")
4542                         m68k_cpu_ident=m68020
4543                         tm_defines="$tm_defines M68K_DEFAULT_TUNE=u68020_40"
4544                         ;;
4545                 "m68020-60")
4546                         m68k_cpu_ident=m68020
4547                         tm_defines="$tm_defines M68K_DEFAULT_TUNE=u68020_60"
4548                         ;;
4549                 *)
4550                         # We need the C identifier rather than the string.
4551                         m68k_cpu_ident=`awk -v arg="\"$with_cpu\"" \
4552                            'BEGIN { FS="[ \t]*[,()][ \t]*" }; \
4553                             $1 == "M68K_DEVICE" && $2 == arg { print $3 }' \
4554                                  ${srcdir}/config/m68k/m68k-devices.def`
4555                         if [ x"$m68k_cpu_ident" = x ] ; then
4556                                 echo "Unknown CPU used in --with-cpu=$with_cpu" 1>&2
4557                                 exit 1
4558                         fi
4559                         with_cpu="mcpu=$with_cpu"
4560                         ;;
4561                 esac
4562                 ;;
4564         amdgcn-*-*)
4565                 supported_defaults="arch tune"
4567                 for which in arch tune; do
4568                         eval "val=\$with_$which"
4569                         case ${val} in
4570                         "" | fiji | gfx900 | gfx906 )
4571                                 # OK
4572                                 ;;
4573                         *)
4574                                 echo "Unknown cpu used in --with-$which=$val." 1>&2
4575                                 exit 1
4576                                 ;;
4577                         esac
4578                 done
4579                 [ "x$with_arch" = x ] && with_arch=fiji
4580                 ;;
4582         hppa*-*-*)
4583                 supported_defaults="arch schedule"
4585                 case "$with_arch" in
4586                 "" | 1.0 | 1.1 | 2.0)
4587                         # OK
4588                         ;;
4589                 *)
4590                         echo "Unknown architecture used in --with-arch=$with_arch" 1>&2
4591                         exit 1
4592                         ;;
4593                 esac
4595                 case "$with_schedule" in
4596                 "" | 700 | 7100 | 7100LC | 7200 | 7300 | 8000)
4597                         # OK
4598                         ;;
4599                 *)
4600                         echo "Unknown processor used in --with-schedule=$with_schedule." 1>&2
4601                         exit 1
4602                         ;;
4603                 esac
4604                 ;;
4606         i[34567]86-*-* | x86_64-*-*)
4607                 supported_defaults="abi arch arch_32 arch_64 cpu cpu_32 cpu_64 tune tune_32 tune_64"
4608                 for which in arch arch_32 arch_64 cpu cpu_32 cpu_64 tune tune_32 tune_64; do
4609                         eval "val=\$with_$which"
4610                         case " $x86_archs " in
4611                         *" ${val} "*)
4612                                 case "${target}" in
4613                                   x86_64-*-*)
4614                                       case "x$which" in
4615                                         *_32)
4616                                                 ;;
4617                                         *)
4618                                                 echo "CPU given in --with-$which=$val doesn't support 64bit mode." 1>&2
4619                                                 exit 1
4620                                                 ;;
4621                                       esac
4622                                       ;;
4623                                 esac
4624                                 # OK
4625                                 ;;
4626                         *)
4627                                 if test x${val} != x; then
4628                                         case " $x86_64_archs " in
4629                                         *" ${val} "*)
4630                                                 # Disallow x86-64-v* for --with-cpu=/--with-tune=
4631                                                 case "x$which$val" in
4632                                                 xcpu*x86-64-v*|xtune*x86-64-v*)
4633                                                         echo "Unknown CPU given in --with-$which=$val." 1>&2
4634                                                         exit 1
4635                                                         ;;
4636                                                 *)
4637                                                         ;;
4638                                                 esac
4639                                                 # OK
4640                                                 ;;
4641                                         *)
4642                                                 # Allow $x86_cpus --with-cpu=/--with-tune=
4643                                                 case "x$which" in
4644                                                 xcpu*|xtune*)
4645                                                         case " $x86_cpus " in
4646                                                         *" ${val} "*)
4647                                                                 # OK
4648                                                                 ;;
4649                                                         *)
4650                                                                 echo "Unknown CPU given in --with-$which=$val." 1>&2
4651                                                                 exit 1
4652                                                                 ;;
4653                                                         esac
4654                                                         ;;
4655                                                 *)
4656                                                         echo "Unknown CPU given in --with-$which=$val." 1>&2
4657                                                         exit 1
4658                                                         ;;
4659                                                 esac
4660                                         ;;
4661                                         esac
4662                                 fi
4663                                 ;;
4664                         esac
4665                 done
4666                 ;;
4668         riscv*-*-*)
4669                 supported_defaults="abi arch tune riscv_attribute isa_spec"
4671                 case "${target}" in
4672                 riscv-* | riscv32*) xlen=32 ;;
4673                 riscv64*) xlen=64 ;;
4674                 *) echo "Unsupported RISC-V target ${target}" 1>&2; exit 1 ;;
4675                 esac
4677                 case "${with_isa_spec}" in
4678                 ""|default|20191213|201912)
4679                         tm_defines="${tm_defines} TARGET_DEFAULT_ISA_SPEC=ISA_SPEC_CLASS_20191213"
4680                         with_isa_spec=20191213
4681                         ;;
4682                 2.2)
4683                         tm_defines="${tm_defines} TARGET_DEFAULT_ISA_SPEC=ISA_SPEC_CLASS_2P2"
4684                         ;;
4685                 20190608 | 201906)
4686                         tm_defines="${tm_defines} TARGET_DEFAULT_ISA_SPEC=ISA_SPEC_CLASS_20190608"
4687                         with_isa_spec=20190608
4688                         ;;
4689                 *)
4690                         echo "--with-isa-spec only accept 2.2, 20191213, 201912, 20190608 or 201906" 1>&2
4691                         exit 1
4692                 esac
4694                 case "${with_riscv_attribute}" in
4695                 yes)
4696                         tm_defines="${tm_defines} TARGET_RISCV_ATTRIBUTE=1"
4697                         ;;
4698                 no)
4699                         tm_defines="${tm_defines} TARGET_RISCV_ATTRIBUTE=0"
4700                         ;;
4701                 ""|default)
4702                         tm_defines="${tm_defines} TARGET_RISCV_ATTRIBUTE=1"
4703                         ;;
4704                 *)
4705                         echo "--with-riscv-attribute=${with_riscv_attribute} is not supported.  The argument must begin with yes, no or default." 1>&2
4706                         exit 1
4707                         ;;
4708                 esac
4711                 # Infer arch from --with-arch, --target, and --with-abi.
4712                 case "${with_arch}" in
4713                 rv32e* | rv32i* | rv32g* | rv64i* | rv64g*)
4714                         # OK.
4715                         ;;
4716                 "")
4717                         # Infer XLEN, but otherwise assume GC.
4718                         case "${with_abi}" in
4719                         ilp32e) with_arch="rv32e" ;;
4720                         ilp32 | ilp32f | ilp32d) with_arch="rv32gc" ;;
4721                         lp64 | lp64f | lp64d) with_arch="rv64gc" ;;
4722                         *) with_arch="rv${xlen}gc" ;;
4723                         esac
4724                         ;;
4725                 *)
4726                         echo "--with-arch=${with_arch} is not supported.  The argument must begin with rv32e, rv32i, rv32g, rv64i, or rv64g." 1>&2
4727                         exit 1
4728                         ;;
4729                 esac
4730                 PYTHON=`which python || which python3 || which python2`
4731                 if test "x${PYTHON}" != x; then
4732                         with_arch=`${PYTHON} ${srcdir}/config/riscv/arch-canonicalize -misa-spec=${with_isa_spec} ${with_arch}`
4733                 fi
4734                 tm_defines="${tm_defines} TARGET_RISCV_DEFAULT_ARCH=${with_arch}"
4736                 # Make sure --with-abi is valid.  If it was not specified,
4737                 # pick a default based on the ISA, preferring soft-float
4738                 # unless the D extension is present.
4739                 case "${with_abi}" in
4740                 ilp32 | ilp32e | ilp32f | ilp32d | lp64 | lp64f | lp64d)
4741                         ;;
4742                 "")
4743                         case "${with_arch}" in
4744                         rv32*d* | rv32g*) with_abi=ilp32d ;;
4745                         rv32e*) with_abi=ilp32e ;;
4746                         rv32*) with_abi=ilp32 ;;
4747                         rv64*d* | rv64g*) with_abi=lp64d ;;
4748                         rv64*) with_abi=lp64 ;;
4749                         esac
4750                         ;;
4751                 *)
4752                         echo "--with-abi=${with_abi} is not supported" 1>&2
4753                         exit 1
4754                         ;;
4755                 esac
4756                 tm_defines="${tm_defines} TARGET_RISCV_DEFAULT_ABI=${with_abi}"
4758                 # Make sure ABI and ISA are compatible.
4759                 case "${with_abi},${with_arch}" in
4760                 ilp32,rv32* | ilp32e,rv32e* \
4761                 | ilp32f,rv32*f* | ilp32f,rv32g* \
4762                 | ilp32d,rv32*d* | ilp32d,rv32g* \
4763                 | lp64,rv64* \
4764                 | lp64f,rv64*f* | lp64f,rv64g* \
4765                 | lp64d,rv64*d* | lp64d,rv64g*)
4766                         ;;
4767                 *)
4768                         echo "--with-abi=${with_abi} is not supported for ISA ${with_arch}" 1>&2
4769                         exit 1
4770                         ;;
4771                 esac
4772                 # Handle --with-multilib-generator.
4773                 if test "x${with_multilib_generator}" != xdefault; then
4774                         if test "x${with_multilib_list}" != xdefault; then
4775                                 echo "--with-multilib-list= can't used with --with-multilib-generator= at same time" 1>&2
4776                                 exit 1
4777                         fi
4778                         case "${target}" in
4779                         riscv*-*-elf*)
4780                                 if ${srcdir}/config/riscv/multilib-generator \
4781                                         -misa-spec=${with_isa_spec} \
4782                                         `echo ${with_multilib_generator} | sed 's/;/ /g'`\
4783                                         > t-multilib-config;
4784                                 then
4785                                         tmake_file="${tmake_file} riscv/t-withmultilib-generator"
4786                                 else
4787                                         echo "invalid option for --with-multilib-generator" 1>&2
4788                                         exit 1
4789                                 fi
4790                                 ;;
4791                         *)
4792                                 echo "--with-multilib-generator= is not supported for ${target}, only supported for riscv*-*-elf*" 1>&2
4793                                 exit 1
4794                                 ;;
4795                         esac
4796                 fi
4798                 # Handle --with-multilib-list.
4799                 if test "x${with_multilib_list}" != xdefault; then
4800                         tmake_file="${tmake_file} riscv/t-withmultilib"
4802                         case ${with_multilib_list} in
4803                         ilp32 | ilp32f | ilp32d \
4804                         | lp64 | lp64f | lp64d )
4805                                 TM_MULTILIB_CONFIG="${with_arch},${with_multilib_list}"
4806                                 ;;
4807                         *)
4808                                 echo "--with-multilib-list=${with_multilib_list} not supported."
4809                                 exit 1
4810                         esac
4811                 fi
4812                 ;;
4814         mips*-*-*)
4815                 supported_defaults="abi arch arch_32 arch_64 float fpu nan fp_32 odd_spreg_32 tune tune_32 tune_64 divide llsc mips-plt synci lxc1-sxc1 madd4"
4817                 case ${with_float} in
4818                 "" | soft | hard)
4819                         # OK
4820                         ;;
4821                 *)
4822                         echo "Unknown floating point type used in --with-float=$with_float" 1>&2
4823                         exit 1
4824                         ;;
4825                 esac
4827                 case ${with_fpu} in
4828                 "" | single | double)
4829                         # OK
4830                         ;;
4831                 *)
4832                         echo "Unknown fpu type used in --with-fpu=$with_fpu" 1>&2
4833                         exit 1
4834                         ;;
4835                 esac
4837                 case ${with_nan} in
4838                 "" | 2008 | legacy)
4839                         # OK
4840                         ;;
4841                 *)
4842                         echo "Unknown NaN encoding used in --with-nan=$with_nan" 1>&2
4843                         exit 1
4844                         ;;
4845                 esac
4847                 case ${with_fp_32} in
4848                 "" | 32 | xx | 64)
4849                         # OK
4850                         ;;
4851                 *)
4852                         echo "Unknown FP mode used in --with-fp-32=$with_fp_32" 1>&2
4853                         exit 1
4854                         ;;
4855                 esac
4857                 case ${with_odd_spreg_32} in
4858                 yes)
4859                         with_odd_spreg_32="odd-spreg"
4860                         ;;
4861                 no)
4862                         with_odd_spreg_32="no-odd-spreg"
4863                         ;;
4864                 "")
4865                         # OK
4866                         ;;
4867                 *)
4868                         echo "Unknown odd-spreg-32 type used in --with-odd-spreg-32=$with_odd_spreg_32" 1>&2
4869                         exit 1
4870                         ;;
4871                 esac
4873                 case ${with_abi} in
4874                 "" | 32 | o64 | n32 | 64 | eabi)
4875                         # OK
4876                         ;;
4877                 *)
4878                         echo "Unknown ABI used in --with-abi=$with_abi" 1>&2
4879                         exit 1
4880                         ;;
4881                 esac
4883                 case ${with_divide} in
4884                 "" | breaks | traps)
4885                         # OK
4886                         ;;
4887                 *)
4888                         echo "Unknown division check type use in --with-divide=$with_divide" 1>&2
4889                         exit 1
4890                         ;;
4891                 esac
4893                 case ${with_llsc} in
4894                 yes)
4895                         with_llsc=llsc
4896                         ;;
4897                 no)
4898                         with_llsc="no-llsc"
4899                         ;;
4900                 "")
4901                         # OK
4902                         ;;
4903                 *)
4904                         echo "Unknown llsc type used in --with-llsc" 1>&2
4905                         exit 1
4906                         ;;
4907                 esac
4909                 case ${with_mips_plt} in
4910                 yes)
4911                         with_mips_plt=plt
4912                         ;;
4913                 no)
4914                         with_mips_plt=no-plt
4915                         ;;
4916                 "")
4917                         ;;
4918                 *)
4919                         echo "Unknown --with-mips-plt argument: $with_mips_plt" 1>&2
4920                         exit 1
4921                         ;;
4922                 esac
4924                 case ${with_synci} in
4925                 yes)
4926                         with_synci=synci
4927                         ;;
4928                 no)
4929                         with_synci=no-synci
4930                         ;;
4931                 "")
4932                         ;;
4933                 *)
4934                         echo "Unknown synci type used in --with-synci" 1>&2
4935                         exit 1
4936                         ;;
4937                 esac
4939                 case ${with_lxc1_sxc1} in
4940                 yes)
4941                         with_lxc1_sxc1=lxc1-sxc1
4942                         ;;
4943                 no)
4944                         with_lxc1_sxc1=no-lxc1-sxc1
4945                         ;;
4946                 "")
4947                         ;;
4948                 *)
4949                         echo "Unknown lxc1-sxc1 type used in --with-lxc1-sxc1" 1>&2
4950                         exit 1
4951                         ;;
4952                 esac
4954                 case ${with_madd4} in
4955                 yes)
4956                         with_madd4=madd4
4957                         ;;
4958                 no)
4959                         with_madd4=no-madd4
4960                         ;;
4961                 "")
4962                         ;;
4963                 *)
4964                         echo "Unknown madd4 type used in --with-madd4" 1>&2
4965                         exit 1
4966                         ;;
4967                 esac
4968                 ;;
4970         loongarch*-*-*)
4971                 supported_defaults="abi arch tune fpu"
4973                 # Local variables
4974                 unset \
4975                         abi_pattern      abi_default    \
4976                         abiext_pattern   abiext_default \
4977                         arch_pattern     arch_default   \
4978                         fpu_pattern      fpu_default    \
4979                         tune_pattern     tune_default   \
4980                         triplet_os       triplet_abi
4982                 # Infer ABI from the triplet.
4983                 case ${target} in
4984                 loongarch64-*-*-*f64)
4985                         abi_pattern="lp64d"
4986                         triplet_abi="f64"
4987                         ;;
4988                 loongarch64-*-*-*f32)
4989                         abi_pattern="lp64f"
4990                         triplet_abi="f32"
4991                         ;;
4992                 loongarch64-*-*-*sf)
4993                         abi_pattern="lp64s"
4994                         triplet_abi="sf"
4995                         ;;
4996                 loongarch64-*-*-*)
4997                         abi_pattern="lp64[dfs]"
4998                         abi_default="lp64d"
4999                         triplet_abi=""
5000                         ;;
5001                 *)
5002                         echo "Unsupported target ${target}." 1>&2
5003                         exit 1
5004                         ;;
5005                 esac
5007                 abiext_pattern="*"
5008                 abiext_default="base"
5010                 # Get the canonical triplet (multiarch specifier).
5011                 case ${target} in
5012                   *-linux-gnu*)  triplet_os="linux-gnu";;
5013                   *-linux-musl*) triplet_os="linux-musl";;
5014                   *)
5015                           echo "Unsupported target ${target}." 1>&2
5016                           exit 1
5017                           ;;
5018                 esac
5020                 la_canonical_triplet="loongarch64-${triplet_os}${triplet_abi}"
5023                 # Perform initial sanity checks on --with-* options.
5024                 case ${with_arch} in
5025                 "" | loongarch64 | la464) ;; # OK, append here.
5026                 native)
5027                         if test x${host} != x${target}; then
5028                                 echo "--with-arch=native is illegal for cross-compiler." 1>&2
5029                                 exit 1
5030                         fi
5031                         ;;
5032                 "")
5033                         echo "Please set a default value for \${with_arch}" \
5034                              "according to your target triplet \"${target}\"." 1>&2
5035                         exit 1
5036                         ;;
5037                 *)
5038                         echo "Unknown arch in --with-arch=$with_arch" 1>&2
5039                         exit 1
5040                         ;;
5041                 esac
5043                 case ${with_abi} in
5044                 "" | lp64d | lp64f | lp64s) ;; # OK, append here.
5045                 *)
5046                         echo "Unsupported ABI given in --with-abi=$with_abi" 1>&2
5047                         exit 1
5048                         ;;
5049                 esac
5051                 case ${with_abiext} in
5052                 "" | base) ;; # OK, append here.
5053                 *)
5054                         echo "Unsupported ABI extention type $with_abiext" 1>&2
5055                         exit 1
5056                         ;;
5057                 esac
5059                 case ${with_fpu} in
5060                 "" | none | 32 | 64) ;; # OK, append here.
5061                 0)
5062                         # Convert "0" to "none" for upcoming checks.
5063                         with_fpu="none"
5064                         ;;
5065                 *)
5066                         echo "Unknown fpu type in --with-fpu=$with_fpu" 1>&2
5067                         exit 1
5068                         ;;
5069                 esac
5072                 # Set default value for with_abi.
5073                 case ${with_abi} in
5074                 "")
5075                         if test x${abi_default} != x; then
5076                                 with_abi=${abi_default}
5077                         else
5078                                 with_abi=${abi_pattern}
5079                         fi
5080                         ;;
5082                 *)
5083                         if echo "${with_abi}" | grep -E "^${abi_pattern}$" > /dev/null; then
5084                                 : # OK
5085                         else
5086                                 echo "Incompatible options:" \
5087                                 "--with-abi=${with_abi} and --target=${target}." 1>&2
5088                                 exit 1
5089                         fi
5090                         ;;
5091                 esac
5093                 # Set default value for with_abiext (internal)
5094                 case ${with_abiext} in
5095                 "")
5096                         if test x${abiext_default} != x; then
5097                                 with_abiext=${abiext_default}
5098                         else
5099                                 with_abiext=${abiext_pattern}
5100                         fi
5101                         ;;
5103                 *)
5104                         if echo "${with_abiext}" | grep -E "^${abiext_pattern}$" > /dev/null; then
5105                                 : # OK
5106                         else
5107                                 echo "The ABI extension type \"${with_abiext}\"" \
5108                                 "is incompatible with --target=${target}." 1>&2
5109                                 exit 1
5110                         fi
5112                         ;;
5113                 esac
5115                 # Infer ISA-related default options from the ABI: pass 1
5116                 case ${with_abi}/${with_abiext} in
5117                 lp64*/base)
5118                         # architectures that support lp64* ABI
5119                         arch_pattern="native|loongarch64|la464"
5120                         # default architecture for lp64* ABI
5121                         arch_default="loongarch64"
5122                         ;;
5123                 *)
5124                         echo "Unsupported ABI type ${with_abi}/${with_abiext}." 1>&2
5125                         exit 1
5126                         ;;
5127                 esac
5129                 # Infer ISA-related default options from the ABI: pass 2
5130                 case ${with_abi}/${with_abiext} in
5131                 lp64d/base)
5132                         fpu_pattern="64"
5133                         ;;
5134                 lp64f/base)
5135                         fpu_pattern="32|64"
5136                         fpu_default="32"
5137                         ;;
5138                 lp64s/base)
5139                         fpu_pattern="none|32|64"
5140                         fpu_default="none"
5141                         ;;
5142                 *)
5143                         echo "Unsupported ABI type ${with_abi}/${with_abiext}." 1>&2
5144                         exit 1
5145                         ;;
5146                 esac
5148                 ## Set default value for with_arch.
5149                 case ${with_arch} in
5150                 "")
5151                         if test x${arch_default} != x; then
5152                                 with_arch=${arch_default}
5153                         else
5154                                 with_arch=${arch_pattern}
5155                         fi
5156                         ;;
5158                 *)
5159                         if echo "${with_arch}" | grep -E "^${arch_pattern}$" > /dev/null; then
5160                                 : # OK
5161                         else
5162                                 echo "${with_abi}/${with_abiext} ABI cannot be implemented with" \
5163                                 "--with-arch=${with_arch}." 1>&2
5164                                 exit 1
5165                         fi
5166                         ;;
5167                 esac
5169                 ## Set default value for with_fpu.
5170                 case ${with_fpu} in
5171                 "")
5172                         if test x${fpu_default} != x; then
5173                                 with_fpu=${fpu_default}
5174                         else
5175                                 with_fpu=${fpu_pattern}
5176                         fi
5177                         ;;
5179                 *)
5180                         if echo "${with_fpu}" | grep -E "^${fpu_pattern}$" > /dev/null; then
5181                                 : # OK
5182                         else
5183                                 echo "${with_abi}/${with_abiext} ABI cannot be implemented with" \
5184                                 "--with-fpu=${with_fpu}." 1>&2
5185                                 exit 1
5186                         fi
5187                         ;;
5188                 esac
5191                 # Infer default with_tune from with_arch: pass 1
5192                 case ${with_arch} in
5193                 native)
5194                         tune_pattern="*"
5195                         tune_default="native"
5196                         ;;
5197                 loongarch64)
5198                         tune_pattern="loongarch64|la464"
5199                         tune_default="la464"
5200                         ;;
5201                 *)
5202                         # By default, $with_tune == $with_arch
5203                         tune_pattern="$with_arch"
5204                         ;;
5205                 esac
5207                 ## Set default value for with_tune.
5208                 case ${with_tune} in
5209                 "")
5210                         if test x${tune_default} != x; then
5211                                 with_tune=${tune_default}
5212                         else
5213                                 with_tune=${tune_pattern}
5214                         fi
5215                         ;;
5217                 *)
5218                         if echo "${with_tune}" | grep -E "^${tune_pattern}$" > /dev/null; then
5219                                 : # OK
5220                         else
5221                                 echo "Incompatible options: --with-tune=${with_tune}" \
5222                                 "and --with-arch=${with_arch}." 1>&2
5223                                 exit 1
5224                         fi
5225                         ;;
5226                 esac
5228                 # Handle --with-multilib-list.
5229                 if test x"${with_multilib_list}" = x \
5230                    || test x"${with_multilib_list}" = xno \
5231                    || test x"${with_multilib_list}" = xdefault \
5232                    || test x"${enable_multilib}" != xyes; then
5234                         with_multilib_list="${with_abi}/${with_abiext}"
5235                 fi
5237                 # Check if the configured default ABI combination is included in
5238                 # ${with_multilib_list}.
5239                 loongarch_multilib_list_sane=no
5241                 # This one goes to TM_MULTILIB_CONFIG, for use in t-linux.
5242                 loongarch_multilib_list_make=""
5244                 # This one goes to tm_defines, for use in loongarch-driver.c.
5245                 loongarch_multilib_list_c=""
5247                 # ${with_multilib_list} should not contain whitespaces,
5248                 # consecutive commas or slashes.
5249                 if echo "${with_multilib_list}" \
5250                 | grep -E -e "[[:space:]]" -e '[,/][,/]' -e '[,/]$' -e '^[,/]' > /dev/null; then
5251                         echo "Invalid argument to --with-multilib-list." 1>&2
5252                         exit 1
5253                 fi
5255                 unset component idx elem_abi_base elem_abi_ext elem_tmp
5256                 for elem in $(echo "${with_multilib_list}" | tr ',' ' '); do
5257                         idx=0
5258                         while true; do
5259                                 idx=$((idx + 1))
5260                                 component=$(echo "${elem}" | awk -F'/' '{print $'"${idx}"'}')
5262                                 case ${idx} in
5263                                 1)
5264                                         # Component 1: Base ABI type
5265                                         case ${component} in
5266                                         lp64d) elem_tmp="ABI_BASE_LP64D,";;
5267                                         lp64f) elem_tmp="ABI_BASE_LP64F,";;
5268                                         lp64s) elem_tmp="ABI_BASE_LP64S,";;
5269                                         *)
5270                                                 echo "Unknown base ABI \"${component}\" in --with-multilib-list." 1>&2
5271                                                 exit 1
5272                                                 ;;
5273                                         esac
5274                                         loongarch_multilib_list_c="${loongarch_multilib_list_c}${elem_tmp}"
5275                                         loongarch_multilib_list_make="${loongarch_multilib_list_make}mabi=${component}"
5276                                         elem_abi_base="${component}"
5277                                         ;;
5279                                 2)
5280                                         # Component 2: ABI extension type
5281                                         case ${component} in
5282                                         "" | base)
5283                                                 component="base"
5284                                                 elem_tmp="ABI_EXT_BASE,"
5285                                                 ;;
5286                                         *)
5287                                                 echo "Unknown ABI extension \"${component}\" in --with-multilib-list." 1>&2
5288                                                 exit 1
5289                                                 ;;
5290                                         esac
5291                                         loongarch_multilib_list_c="${loongarch_multilib_list_c}${elem_tmp}"
5292                                         loongarch_multilib_list_make="${loongarch_multilib_list_make}" # Add nothing for now.
5293                                         elem_abi_ext="${component}"
5294                                         ;;
5296                                 *)
5297                                         # Component 3 and on: optional stuff
5298                                         case ${component} in
5299                                         "")
5300                                                 # End of component list.
5301                                                 break
5302                                                 ;;
5303                                         *)
5304                                                 echo "Unknown ABI \"${elem}\" in --with-multilib-list." 1>&2
5305                                                 exit 1
5306                                                 ;;
5307                                         esac
5308                                         ;;
5309                                 esac
5310                         done
5312                         if test x${elem_abi_base} = x${with_abi} \
5313                         && test x${elem_abi_ext} = x${with_abiext}; then
5314                                 loongarch_multilib_list_sane=yes
5315                         fi
5316                         loongarch_multilib_list_make="${loongarch_multilib_list_make},"
5317                 done
5319                 # Check if the default ABI combination is in the default list.
5320                 if test x${loongarch_multilib_list_sane} = xno; then
5321                         if test x${with_abiext} = xbase; then
5322                                 with_abiext=""
5323                         else
5324                                 with_abiext="/${with_abiext}"
5325                         fi
5327                         echo "Default ABI combination (${with_abi}${with_abiext})" \
5328                         "not found in --with-multilib-list." 1>&2
5329                         exit 1
5330                 fi
5332                 # Remove the excessive appending comma.
5333                 loongarch_multilib_list_c=${loongarch_multilib_list_c%,}
5334                 loongarch_multilib_list_make=${loongarch_multilib_list_make%,}
5335                 ;;
5337         nds32*-*-*)
5338                 supported_defaults="arch cpu nds32_lib float fpu_config"
5340                 # process --with-arch
5341                 case "${with_arch}" in
5342                 "" | v3 )
5343                         tm_defines="${tm_defines} TARGET_ARCH_DEFAULT=0"
5344                         ;;
5345                 v2 | v2j | v3m)
5346                         # OK
5347                         tm_defines="${tm_defines} TARGET_ARCH_DEFAULT=0"
5348                         ;;
5349                 v3f)
5350                         tm_defines="${tm_defines} TARGET_ARCH_DEFAULT=1"
5351                         ;;
5352                 v3s)
5353                         tm_defines="${tm_defines} TARGET_ARCH_DEFAULT=2"
5355                         ;;
5356                 *)
5357                         echo "Cannot accept --with-arch=$with_arch, available values are: v2 v2j v3 v3m v3f v3s" 1>&2
5358                         exit 1
5359                         ;;
5360                 esac
5362                 case "${with_cpu}" in
5363                 "")
5364                         with_cpu=n9
5365                         ;;
5366                 n6 | n7 |n8 | e8 | s8 | n9 | n10 | d10 | n12 | n13 | n15)
5367                         # OK
5368                         ;;
5369                 *)
5370                         echo "Cannot accept --with-cpu=$with_cpu, available values are: n6 n7 n8 e8 s8 n9 n10 d10 n12 n13 n15" 1>&2
5371                         exit 1
5372                         ;;
5373                 esac
5375                 # process --with-nds32-lib
5376                 case "${with_nds32_lib}" in
5377                 "")
5378                         case ${target} in
5379                         *-*-*uclibc*)
5380                                 with_nds32_lib=ulibc
5381                                 ;;
5382                         *-*-linux*)
5383                                 with_nds32_lib=glibc
5384                                 ;;
5385                         *)
5386                                 with_nds32_lib=newlib
5387                                 tm_defines="${tm_defines} TARGET_DEFAULT_CTOR_DTOR=1"
5388                                 ;;
5389                         esac
5390                         ;;
5391                 newlib)
5392                         # OK
5393                         tm_defines="${tm_defines} TARGET_DEFAULT_CTOR_DTOR=1"
5394                         ;;
5395                 mculib)
5396                         # OK
5397                         # for the arch=v3f or arch=v3s under mculib toolchain,
5398                         # we would like to set -fno-math-errno as default
5399                         case "${with_arch}" in
5400                         v3f | v3s)
5401                                 tm_defines="${tm_defines} TARGET_DEFAULT_NO_MATH_ERRNO=1"
5402                                 ;;
5403                         esac
5404                         ;;
5405                 glibc | uclibc)
5406                         # OK
5407                         ;;
5408                 *)
5409                         echo "Cannot accept --with-nds32-lib=$with_nds32_lib, available values are: newlib mculib glibc uclibc" 1>&2
5410                         exit 1
5411                         ;;
5412                 esac
5414                 # process --with-float
5415                 case "${with_float}" in
5416                 "" | soft | hard)
5417                         # OK
5418                         ;;
5419                 *)
5420                         echo "Cannot accept --with-float=$with_float, available values are: soft hard" 1>&2
5421                         exit 1
5422                         ;;
5423                 esac
5425                 # process --with-config-fpu
5426                 case "${with_config_fpu}" in
5427                 "" | 0 | 1 | 2 | 3)
5428                         # OK
5429                         ;;
5430                 *)
5431                         echo "Cannot accept --with-config-fpu=$with_config_fpu, available values from 0 to 7" 1>&2
5432                         exit 1
5433                         ;;
5434                 esac
5437                 ;;
5438         nios2*-*-*)
5439                 supported_defaults="arch"
5440                         case "$with_arch" in
5441                         "" | r1 | r2)
5442                                 # OK
5443                                 ;;
5444                         *)
5445                                 echo "Unknown arch used in --with-arch=$with_arch" 1>&2
5446                                 exit 1
5447                                 ;;
5448                         esac
5449                 ;;
5451         powerpc*-*-* | rs6000-*-*)
5452                 supported_defaults="abi cpu cpu_32 cpu_64 float tune tune_32 tune_64 advance_toolchain"
5454                 for which in cpu cpu_32 cpu_64 tune tune_32 tune_64; do
5455                         eval "val=\$with_$which"
5456                         case ${val} in
5457                         default32 | default64)
5458                                 case $which in
5459                                 cpu | tune)
5460                                         ;;
5461                                 *)
5462                                         echo "$val only valid for --with-cpu and --with-tune." 1>&2
5463                                         exit 1
5464                                         ;;
5465                                 esac
5466                                 with_which="with_$which"
5467                                 eval $with_which=
5468                                 ;;
5469                         405cr)
5470                                 tm_defines="${tm_defines} CONFIG_PPC405CR"
5471                                 eval "with_$which=405"
5472                                 ;;
5473                         "" | common | native \
5474                         | power[3456789] | power10 | power5+ | power6x \
5475                         | powerpc | powerpc64 | powerpc64le \
5476                         | rs64 \
5477                         | 401 | 403 | 405 | 405fp | 440 | 440fp | 464 | 464fp \
5478                         | 476 | 476fp | 505 | 601 | 602 | 603 | 603e | ec603e \
5479                         | 604 | 604e | 620 | 630 | 740 | 750 | 7400 | 7450 \
5480                         | a2 | e300c[23] | 854[08] | e500mc | e500mc64 | e5500 | e6500 \
5481                         | titan | 801 | 821 | 823 | 860 | 970 | G3 | G4 | G5 | cell)
5482                                 # OK
5483                                 ;;
5484                         *)
5485                                 echo "Unknown cpu used in --with-$which=$val." 1>&2
5486                                 exit 1
5487                                 ;;
5488                         esac
5489                 done
5491                 case "$with_abi" in
5492                 "" | elfv1 | elfv2 )
5493                         #OK
5494                         ;;
5495                 *)
5496                         echo "Unknown ABI used in --with-abi=$with_abi"
5497                         exit 1
5498                         ;;
5499                 esac
5501                 if test "x$with_advance_toolchain" != x; then
5502                     if test -d "/opt/$with_advance_toolchain/." -a \
5503                         -d "/opt/$with_advance_toolchain/bin/." -a \
5504                         -d "/opt/$with_advance_toolchain/include/."; then
5506                         tm_file="$tm_file ./advance-toolchain.h"
5507                         (at="/opt/$with_advance_toolchain"
5508                          echo "/* Use Advance Toolchain $at */"
5509                          echo
5510                          echo "#undef  LINK_OS_NEW_DTAGS_SPEC"
5511                          echo "#define LINK_OS_NEW_DTAGS_SPEC" \
5512                               "\"--enable-new-dtags\""
5513                          echo
5514                          echo "#undef  DYNAMIC_LINKER_PREFIX"
5515                          echo "#define DYNAMIC_LINKER_PREFIX \"$at\""
5516                          echo
5517                          echo "#undef  MD_EXEC_PREFIX"
5518                          echo "#define MD_EXEC_PREFIX \"$at/bin/\""
5519                          echo
5520                          echo "#undef  MD_STARTFILE_PREFIX"
5521                          echo "#define MD_STARTFILE_PREFIX \"$prefix/lib/\""
5522                          echo
5523                          echo "#undef  MD_STARTFILE_PREFIX_1"
5524                          echo "#define MD_STARTFILE_PREFIX_1 \"$at/lib/\"") \
5525                             > advance-toolchain.h
5526                     else
5527                         echo "Unknown advance-toolchain $with_advance_toolchain"
5528                         exit 1
5529                     fi
5530                 fi
5532                 # Set up the default long double format if the user changed it.
5533                 if test x$with_long_double_format = xieee; then
5534                     tm_defines="${tm_defines} TARGET_IEEEQUAD_DEFAULT=1"
5536                 elif test x$with_long_double_format = xibm; then
5537                     tm_defines="${tm_defines} TARGET_IEEEQUAD_DEFAULT=0"
5538                 fi
5539                 ;;
5541         s390*-*-*)
5542                 supported_defaults="arch mode tune"
5544                 for which in arch tune; do
5545                         eval "val=\$with_$which"
5546                         case ${val} in
5547                         "" | native | z900 | z990 | z9-109 | z9-ec | z10 | z196 | zEC12 | z13 | z14 | z15 | z16 | arch5 | arch6 | arch7 | arch8 | arch9 | arch10 | arch11 | arch12 | arch13 | arch14 )
5548                                 # OK
5549                                 ;;
5550                         *)
5551                                 echo "Unknown cpu used in --with-$which=$val." 1>&2
5552                                 exit 1
5553                                 ;;
5554                         esac
5555                 done
5557                 case ${with_mode} in
5558                 "" | esa | zarch)
5559                         # OK
5560                         ;;
5561                 *)
5562                         echo "Unknown architecture mode used in --with-mode=$with_mode." 1>&2
5563                         exit 1
5564                         ;;
5565                 esac
5566                 ;;
5568         sh[123456ble]*-*-* | sh-*-*)
5569                 supported_defaults="cpu"
5570                 case "`echo $with_cpu | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ_ abcdefghijklmnopqrstuvwxyz- | sed s/sh/m/`" in
5571                 "" | m1 | m2 | m2e | m3 | m3e | m4 | m4-single | m4-single-only | m4-nofpu )
5572                         # OK
5573                         ;;
5574                 m2a | m2a-single | m2a-single-only | m2a-nofpu)
5575                         ;;
5576                 m4a | m4a-single | m4a-single-only | m4a-nofpu | m4al)
5577                         ;;
5578                 *)
5579                         echo "Unknown CPU used in --with-cpu=$with_cpu, known values:"  1>&2
5580                         echo "m1 m2 m2e m3 m3e m4 m4-single m4-single-only m4-nofpu" 1>&2
5581                         echo "m4a m4a-single m4a-single-only m4a-nofpu m4al" 1>&2
5582                         echo "m2a m2a-single m2a-single-only m2a-nofpu" 1>&2
5583                         exit 1
5584                         ;;
5585                 esac
5586                 ;;
5587         sparc*-*-*)
5588                 supported_defaults="cpu cpu_32 cpu_64 float tune tune_32 tune_64"
5590                 for which in cpu cpu_32 cpu_64 tune tune_32 tune_64; do
5591                         eval "val=\$with_$which"
5592                         case ${val} in
5593                         "" | sparc | sparcv9 | sparc64 \
5594                         | v7 | cypress \
5595                         | v8 | supersparc | hypersparc | leon | leon3 | leon3v7 \
5596                         | sparclite | f930 | f934 | sparclite86x \
5597                         | sparclet | tsc701 \
5598                         | v9 | ultrasparc | ultrasparc3 | niagara | niagara2 \
5599                         | niagara3 | niagara4 | niagara7 | m8)
5600                                 # OK
5601                                 ;;
5602                         *)
5603                                 echo "Unknown cpu used in --with-$which=$val" 1>&2
5604                                 exit 1
5605                                 ;;
5606                         esac
5607                 done
5609                 case ${with_float} in
5610                 "" | soft | hard)
5611                         # OK
5612                         ;;
5613                 *)
5614                         echo "Unknown floating point type used in --with-float=$with_float" 1>&2
5615                         exit 1
5616                         ;;
5617                 esac
5618                 ;;
5620         tic6x-*-*)
5621                 supported_defaults="arch"
5623                 case ${with_arch} in
5624                 "" | c62x | c64x | c64x+ | c67x | c67x+ | c674x)
5625                         # OK
5626                         ;;
5627                 *)
5628                         echo "Unknown arch used in --with-arch=$with_arch." 1>&2
5629                         exit 1
5630                         ;;
5631                 esac
5632                 ;;
5634         v850*-*-*)
5635                 supported_defaults=cpu
5636                 case ${with_cpu} in
5637                 "" | v850e | v850e1 | v850e2 | v850es | v850e2v3 | v850e3v5)
5638                         # OK
5639                         ;;
5640                 *)
5641                         echo "Unknown cpu used in --with-cpu=$with_cpu" 1>&2
5642                         exit 1
5643                         ;;
5644                 esac
5645                 ;;
5646         visium-*-*)
5647                 supported_defaults="cpu"
5648                 case $with_cpu in
5649                   "" | gr5 | gr6)
5650                         ;;
5651                   *)    echo "Unknown cpu used in --with-cpu=$with_cpu" 1>&2
5652                         exit 1
5653                         ;;
5654                 esac
5655                 ;;
5656 esac
5658 # Targets for which there is at least one VxWorks port should include
5659 # vxworks-dummy.h to allow safe references to various TARGET_VXWORKS kinds
5660 # of markers from other files in the port, including the vxworks*.h files to
5661 # distinguish VxWorks variants such as VxWorks 7 or 64).
5663 case ${target} in
5664 arm*-*-* | i[34567]86-*-* | mips*-*-* | powerpc*-*-* | sh*-*-* \
5665 | sparc*-*-* | x86_64-*-*)
5666         tm_file="vxworks-dummy.h ${tm_file}"
5667         ;;
5668 esac
5670 # Set some miscellaneous flags for particular targets.
5671 target_cpu_default2=
5672 case ${target} in
5673         aarch64*-*-*)
5674                 if test x"$target_cpu_cname" != x
5675                 then
5676                         target_cpu_default2=$target_cpu_cname
5677                 fi
5678                 ;;
5680         arm*-*-*)
5681                 if test x$with_cpu = x
5682                 then
5683                         echo "Don't know the target cpu" 1>&2
5684                         exit 1
5685                 else
5686                         target_cpu_default2="\\\"$with_cpu\\\""
5687                 fi
5688                 ;;
5690         hppa*-*-*)
5691                 if test x$gas = xyes
5692                 then
5693                         target_cpu_default2="MASK_GAS"
5694                 fi
5695                 ;;
5697         fido*-*-* | m68k*-*-*)
5698                 target_cpu_default2=$m68k_cpu_ident
5699                 tmake_file="m68k/t-opts $tmake_file"
5700                 if [ x"$m68k_arch_family" != x ]; then
5701                         tmake_file="m68k/t-$m68k_arch_family $tmake_file"
5702                 fi
5703                 ;;
5705         i[34567]86-*-darwin* | x86_64-*-darwin*)
5706                 ;;
5707         i[34567]86-*-linux* | x86_64-*-linux*)
5708                 extra_objs="${extra_objs} gnu-property.o"
5709                 tmake_file="$tmake_file i386/t-linux i386/t-gnu-property"
5710                 ;;
5711         i[34567]86-*-kfreebsd*-gnu | x86_64-*-kfreebsd*-gnu)
5712                 tmake_file="$tmake_file i386/t-kfreebsd"
5713                 ;;
5714         i[34567]86-*-gnu*)
5715                 tmake_file="$tmake_file i386/t-gnu"
5716                 ;;
5717         i[34567]86-*-msdosdjgpp*)
5718                 tmake_file="${tmake_file} i386/t-djgpp"
5719                 ;;
5720         i[34567]86-*-solaris2* | x86_64-*-solaris2*)
5721                 ;;
5722         i[34567]86-*-cygwin* | x86_64-*-cygwin*)
5723                 ;;
5724         i[34567]86-*-mingw* | x86_64-*-mingw*)
5725                 ;;
5726         i[34567]86-*-dragonfly* | x86_64-*-dragonfly*)
5727                 ;;
5728         i[34567]86-*-freebsd*)
5729                 ;;
5730         x86_64-*-freebsd*)
5731                 tmake_file="${tmake_file} i386/t-freebsd64"
5732                 ;;
5733         ia64*-*-linux*)
5734                 ;;
5736         mips*-*-*)
5737                 if test x$gnu_ld = xyes
5738                 then
5739                         target_cpu_default2="MASK_SPLIT_ADDRESSES"
5740                 fi
5741                 case ${target} in
5742                         mips*el-*-*)
5743                                 tm_defines="TARGET_ENDIAN_DEFAULT=0 $tm_defines"
5744                                 ;;
5745                 esac
5746                 if test x$with_arch != x; then
5747                         default_mips_arch=$with_arch
5748                 fi
5749                 if test x$with_abi != x; then
5750                         default_mips_abi=$with_abi
5751                 fi
5752                 case ${default_mips_arch} in
5753                     mips1)    tm_defines="$tm_defines MIPS_ISA_DEFAULT=MIPS_ISA_MIPS1" ;;
5754                     mips2)    tm_defines="$tm_defines MIPS_ISA_DEFAULT=MIPS_ISA_MIPS2" ;;
5755                     mips3)    tm_defines="$tm_defines MIPS_ISA_DEFAULT=MIPS_ISA_MIPS3" ;;
5756                     mips4)    tm_defines="$tm_defines MIPS_ISA_DEFAULT=MIPS_ISA_MIPS4" ;;
5757                     mips32)   tm_defines="$tm_defines MIPS_ISA_DEFAULT=MIPS_ISA_MIPS32" ;;
5758                     mips32r2) tm_defines="$tm_defines MIPS_ISA_DEFAULT=MIPS_ISA_MIPS32R2" ;;
5759                     mips32r6) tm_defines="$tm_defines MIPS_ISA_DEFAULT=MIPS_ISA_MIPS32R6" ;;
5760                     mips64)   tm_defines="$tm_defines MIPS_ISA_DEFAULT=MIPS_ISA_MIPS64" ;;
5761                     mips64r2) tm_defines="$tm_defines MIPS_ISA_DEFAULT=MIPS_ISA_MIPS64R2" ;;
5762                     mips64r6) tm_defines="$tm_defines MIPS_ISA_DEFAULT=MIPS_ISA_MIPS64R6" ;;
5763                 esac
5764                 case ${default_mips_abi} in
5765                     32)   tm_defines="$tm_defines MIPS_ABI_DEFAULT=ABI_32" ;;
5766                     o64)  tm_defines="$tm_defines MIPS_ABI_DEFAULT=ABI_O64" ;;
5767                     n32)  tm_defines="$tm_defines MIPS_ABI_DEFAULT=ABI_N32" ;;
5768                     64)   tm_defines="$tm_defines MIPS_ABI_DEFAULT=ABI_64" ;;
5769                     eabi) tm_defines="$tm_defines MIPS_ABI_DEFAULT=ABI_EABI" ;;
5770                 esac
5771                 tmake_file="mips/t-mips $tmake_file"
5772                 ;;
5774         loongarch*-*-*)
5775                 # Export canonical triplet.
5776                 tm_defines="${tm_defines} LA_MULTIARCH_TRIPLET=${la_canonical_triplet}"
5778                 # Define macro LA_DISABLE_MULTILIB if --disable-multilib
5779                 tm_defines="${tm_defines} TM_MULTILIB_LIST=${loongarch_multilib_list_c}"
5780                 if test x$enable_multilib = xyes; then
5781                         TM_MULTILIB_CONFIG="${loongarch_multilib_list_make}"
5782                 else
5783                         tm_defines="${tm_defines} LA_DISABLE_MULTILIB"
5784                 fi
5786                 # Let --with- flags initialize the enum variables from loongarch.opt.
5787                 # See macro definitions from loongarch-opts.h and loongarch-cpu.h.
5788                 case ${with_arch} in
5789                 native)         tm_defines="${tm_defines} DEFAULT_CPU_ARCH=CPU_NATIVE" ;;
5790                 la464)          tm_defines="${tm_defines} DEFAULT_CPU_ARCH=CPU_LA464" ;;
5791                 loongarch64)    tm_defines="${tm_defines} DEFAULT_CPU_ARCH=CPU_LOONGARCH64" ;;
5792                 esac
5794                 case ${with_tune} in
5795                 native)         tm_defines="${tm_defines} DEFAULT_CPU_TUNE=CPU_NATIVE" ;;
5796                 la464)          tm_defines="${tm_defines} DEFAULT_CPU_TUNE=CPU_LA464" ;;
5797                 loongarch64)    tm_defines="${tm_defines} DEFAULT_CPU_TUNE=CPU_LOONGARCH64" ;;
5798                 esac
5800                 case ${with_abi} in
5801                 lp64d)     tm_defines="${tm_defines} DEFAULT_ABI_BASE=ABI_BASE_LP64D" ;;
5802                 lp64f)     tm_defines="${tm_defines} DEFAULT_ABI_BASE=ABI_BASE_LP64F" ;;
5803                 lp64s)     tm_defines="${tm_defines} DEFAULT_ABI_BASE=ABI_BASE_LP64S" ;;
5804                 esac
5806                 case ${with_abiext} in
5807                 base)      tm_defines="${tm_defines} DEFAULT_ABI_EXT=ABI_EXT_BASE" ;;
5808                 esac
5810                 case ${with_fpu} in
5811                 none)    tm_defines="$tm_defines DEFAULT_ISA_EXT_FPU=ISA_EXT_NOFPU" ;;
5812                 32)      tm_defines="$tm_defines DEFAULT_ISA_EXT_FPU=ISA_EXT_FPU32" ;;
5813                 64)      tm_defines="$tm_defines DEFAULT_ISA_EXT_FPU=ISA_EXT_FPU64" ;;
5814                 esac
5816                 tmake_file="loongarch/t-loongarch $tmake_file"
5817                 ;;
5819         powerpc*-*-* | rs6000-*-*)
5820                 # FIXME: The PowerPC port uses the value set at compile time,
5821                 # although it's only cosmetic.
5822                 if test "x$with_cpu" != x
5823                 then
5824                         target_cpu_default2="\\\"$with_cpu\\\""
5825                 fi
5826                 out_file="${cpu_type}/${cpu_type}.cc"
5827                 c_target_objs="${c_target_objs} ${cpu_type}-c.o"
5828                 cxx_target_objs="${cxx_target_objs} ${cpu_type}-c.o"
5829                 d_target_objs="${d_target_objs} ${cpu_type}-d.o"
5830                 tmake_file="${cpu_type}/t-${cpu_type} ${tmake_file}"
5831                 ;;
5833         sh[123456ble]*-*-* | sh-*-*)
5834                 c_target_objs="${c_target_objs} sh-c.o"
5835                 cxx_target_objs="${cxx_target_objs} sh-c.o"
5836                 ;;
5838         sparc*-*-*)
5839                 # Some standard aliases.
5840                 case x$with_cpu in
5841                 xsparc)
5842                         with_cpu=v7
5843                         ;;
5844                 xsparcv9 | xsparc64)
5845                         with_cpu=v9
5846                         ;;
5847                 esac
5849                 if test x$with_tune = x ; then
5850                       case ${target} in
5851                       *-leon-*)
5852                           with_tune=leon
5853                           ;;
5854                       *-leon[3-9]*)
5855                           with_tune=leon3
5856                           ;;
5857                       esac
5858                 fi
5860                 # The SPARC port checks this value at compile-time.
5861                 target_cpu_default2="TARGET_CPU_$with_cpu"
5862                 ;;
5864         v850*-*-*)
5865                 case "x$with_cpu" in
5866                 x)
5867                         ;;
5868                 xv850e | xv850e1 | xv850e2 | xv850e2v3 | xv850e3v5)
5869                         target_cpu_default2="TARGET_CPU_$with_cpu"
5870                         ;;
5871                 xv850es)
5872                         target_cpu_default2="TARGET_CPU_v850e1"
5873                         ;;
5874                 esac
5875                 ;;
5876         visium-*-*)
5877                 target_cpu_default2="TARGET_CPU_$with_cpu"
5878                 ;;
5879 esac
5882 all_defaults="abi cpu cpu_32 cpu_64 arch arch_32 arch_64 tune tune_32 tune_64 schedule float mode fpu nan fp_32 odd_spreg_32 divide llsc mips-plt synci tls lxc1-sxc1 madd4 isa_spec"
5883 for option in $all_defaults
5885         eval "val=\$with_"`echo $option | sed s/-/_/g`
5886         if test -n "$val"; then
5887                 case " $supported_defaults " in
5888                 *" $option "*)
5889                         ;;
5890                 *)
5891                         echo "This target does not support --with-$option." 2>&1
5892                         echo "Valid --with options are: $supported_defaults" 2>&1
5893                         exit 1
5894                         ;;
5895                 esac
5897                 if test "x$t" = x
5898                 then
5899                         t="{ \"$option\", \"$val\" }"
5900                 else
5901                         t="${t}, { \"$option\", \"$val\" }"
5902                 fi
5903         fi
5904 done
5906 if test "x$t" = x
5907 then
5908         configure_default_options="{ { NULL, NULL} }"
5909 else
5910         configure_default_options="{ ${t} }"
5913 if test "$target_cpu_default2" != ""
5914 then
5915         if test "$target_cpu_default" != ""
5916         then
5917                 target_cpu_default="(${target_cpu_default}|${target_cpu_default2})"
5918         else
5919                 target_cpu_default=$target_cpu_default2
5920         fi
5923 case ${target} in
5924 i[34567]86-*-* | x86_64-*-*)
5925         if test x$enable_as_accelerator = xyes; then
5926                 extra_programs="mkoffload\$(exeext)"
5927         fi
5928         ;;
5929 esac