Debian Codegraph @

gcc/config.gcc

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