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