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