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