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