]> git.ipfire.org Git - thirdparty/gcc.git/blame - libitm/configure.tgt
Add -fmin-function-alignmnet
[thirdparty/gcc.git] / libitm / configure.tgt
CommitLineData
0a35513e 1# -*- shell-script -*-
a945c346 2# Copyright (C) 2011-2024 Free Software Foundation, Inc.
0a35513e
AH
3
4# This program is free software; you can redistribute it and/or modify
5# it under the terms of the GNU General Public License as published by
6# the Free Software Foundation; either version 2 of the License, or
7# (at your option) any later version.
8#
9# This program is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY; without even the implied warranty of
11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12# GNU General Public License for more details.
13#
14# You should have received a copy of the GNU General Public License
15# along with this program; if not, write to the Free Software
16# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17
18# This is the target specific configuration file. This is invoked by the
19# autoconf generated configure script. Putting it in a separate shell file
20# lets us skip running autoconf when modifying target specific information.
21
22# This file switches on the shell variable ${target}, and sets the
23# following shell variables:
24# config_path An ordered list of directories to search for
25# sources and headers. This is relative to the
26# config subdirectory of the source tree.
27# XCFLAGS Add extra compile flags to use.
28# XLDFLAGS Add extra link flags to use.
29
30# Optimize TLS usage by avoiding the overhead of dynamic allocation.
01f3428c 31if test "$gcc_cv_have_tls" = yes ; then
0a35513e
AH
32 case "${target}" in
33
00484365
SN
34 *-*-musl*)
35 ;;
36
0a35513e
AH
37 # For x86, we use slots in the TCB head for most of our TLS.
38 # The setup of those slots in beginTransaction can afford to
39 # use the global-dynamic model.
40 i[456]86-*-linux* | x86_64-*-linux*)
41 ;;
42
43 *-*-linux*)
44 XCFLAGS="${XCFLAGS} -ftls-model=initial-exec"
45 ;;
1352bc88 46
0a35513e
AH
47 esac
48fi
49
50# Map the target cpu to an ARCH sub-directory. At the same time,
51# work out any special compilation flags as necessary.
52case "${target_cpu}" in
b17f08dd 53 aarch64*) ARCH=aarch64 ;;
a32e5e93 54 alpha*) ARCH=alpha ;;
0258b6e4
PB
55 rs6000 | powerpc*)
56 XCFLAGS="${XCFLAGS} -mhtm"
57 ARCH=powerpc
58 ;;
0a35513e 59
aebac0ca
RH
60 arm*) ARCH=arm ;;
61
0411ae7f
JJ
62 i[3456]86 | x86_64)
63 cat > conftestx.c <<EOF
64#ifndef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4
65#error need -march=i486
66#endif
67EOF
68 if ${CC} ${CFLAGS} -E conftestx.c > /dev/null 2>&1; then
69 :
70 else
71 if test "${target_cpu}" = x86_64; then
72 XCFLAGS="${XCFLAGS} -march=i486 -mtune=generic"
73 else
74 XCFLAGS="${XCFLAGS} -march=i486 -mtune=${target_cpu}"
75 fi
76 XCFLAGS="${XCFLAGS} -fomit-frame-pointer"
77 fi
78 rm -f conftestx.c
64fbcc74 79 XCFLAGS="${XCFLAGS} -mrtm"
0a35513e
AH
80 ARCH=x86
81 ;;
82
fa4bc21b
LC
83 loongarch*) ARCH=loongarch ;;
84
a3b58f28
XT
85 riscv*) ARCH=riscv ;;
86
cc163247
KK
87 sh*) ARCH=sh ;;
88
f3f5e3c3
EB
89 sparc)
90 case " ${CC} ${CFLAGS} " in
91 *" -m64 "*)
92 ;;
93 *)
94 if test -z "$with_cpu"; then
95 XCFLAGS="${XCFLAGS} -mcpu=v9"
96 fi
97 esac
98 ARCH=sparc
99 ;;
100
101 sparc64|sparcv9)
102 case " ${CC} ${CFLAGS} " in
103 *" -m32 "*)
104 XCFLAGS="${XCFLAGS} -mcpu=v9"
105 ;;
106 *" -m64 "*)
107 ;;
108 *)
109 if test "x$with_cpu" = xv8; then
110 XCFLAGS="${XCFLAGS} -mcpu=v9"
111 fi
112 ;;
113 esac
114 ARCH=sparc
115 ;;
116
aaec3fc8 117 s390|s390x)
1869217f 118 XCFLAGS="${XCFLAGS} -mzarch -mhtm"
aaec3fc8 119 ARCH=s390
aaec3fc8 120 ;;
0a35513e 121
0a35513e
AH
122 *)
123 ARCH="${target_cpu}"
124 ;;
125esac
01f3428c
RH
126
127# For the benefit of top-level configure, determine if the cpu is supported.
3d3b05ff 128test -d ${srcdir}/config/$ARCH || UNSUPPORTED=1
01f3428c 129
0a35513e
AH
130# Since we require POSIX threads, assume a POSIX system by default.
131config_path="$ARCH posix generic"
132
133# Other system configury
134case "${target}" in
b1e21e5a 135 *-*-linux* | *-*-uclinux*)
01f3428c 136 if test "$enable_linux_futex" = yes; then
0a35513e
AH
137 config_path="linux/$ARCH linux $config_path"
138 fi
139 ;;
140
a32e5e93
RH
141 powerpc*-*-aix* | rs6000-*-aix*)
142 # The system ought to be supported, but sjlj.S has not been ported.
143 UNSUPPORTED=1
144 ;;
145
01f3428c
RH
146 *-*-gnu* | *-*-k*bsd*-gnu \
147 | *-*-netbsd* | *-*-freebsd* | *-*-openbsd* \
b24513a1 148 | *-*-solaris2* | *-*-sysv4* | *-*-hpux11* \
1352bc88 149 | *-*-aix* | *-*-dragonfly*)
01f3428c 150 # POSIX system. The OS is supported.
0a35513e
AH
151 ;;
152
1352bc88
IS
153 *-*-darwin*)
154 # The OS is supported, but we need dynamic lookup to support undefined
155 # weak symbols at link-time.
156 XLDFLAGS="${XLDFLAGS} -Wl,-undefined,dynamic_lookup"
157 ;;
158
01f3428c
RH
159 *) # Non-POSIX, or embedded system
160 UNSUPPORTED=1
0a35513e
AH
161 ;;
162esac