annotate libatomic/configure.tgt @ 144:8f4e72ab4e11

fix segmentation fault caused by nothing next cur_op to end
author Takahiro SHIMIZU <anatofuz@cr.ie.u-ryukyu.ac.jp>
date Sun, 23 Dec 2018 21:23:56 +0900
parents 84e7813d76e9
children 1830386684a0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 # -*- shell-script -*-
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
2 # Copyright (C) 2012-2018 Free Software Foundation, Inc.
111
kono
parents:
diff changeset
3 # Contributed by Richard Henderson <rth@redhat.com>.
kono
parents:
diff changeset
4 #
kono
parents:
diff changeset
5 # This file is part of the GNU Atomic Library (libatomic).
kono
parents:
diff changeset
6 #
kono
parents:
diff changeset
7 # Libatomic is free software; you can redistribute it and/or modify it
kono
parents:
diff changeset
8 # under the terms of the GNU General Public License as published by
kono
parents:
diff changeset
9 # the Free Software Foundation; either version 3 of the License, or
kono
parents:
diff changeset
10 # (at your option) any later version.
kono
parents:
diff changeset
11 #
kono
parents:
diff changeset
12 # Libatomic is distributed in the hope that it will be useful, but WITHOUT ANY
kono
parents:
diff changeset
13 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
kono
parents:
diff changeset
14 # FOR A PARTICULAR PURPOSE. See the GNU General Public License for
kono
parents:
diff changeset
15 # more details.
kono
parents:
diff changeset
16 #
kono
parents:
diff changeset
17 # Under Section 7 of GPL version 3, you are granted additional
kono
parents:
diff changeset
18 # permissions described in the GCC Runtime Library Exception, version
kono
parents:
diff changeset
19 # 3.1, as published by the Free Software Foundation.
kono
parents:
diff changeset
20 #
kono
parents:
diff changeset
21 # You should have received a copy of the GNU General Public License and
kono
parents:
diff changeset
22 # a copy of the GCC Runtime Library Exception along with this program;
kono
parents:
diff changeset
23 # see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
kono
parents:
diff changeset
24 # <http://www.gnu.org/licenses/>.
kono
parents:
diff changeset
25
kono
parents:
diff changeset
26 # Map the target cpu to an ARCH sub-directory. At the same time,
kono
parents:
diff changeset
27 # work out any special compilation flags as necessary.
kono
parents:
diff changeset
28
kono
parents:
diff changeset
29 # Give operating systems the opportunity to discard XCFLAGS modifications based
kono
parents:
diff changeset
30 # on ${target_cpu}. For example to allow proper use of multilibs.
kono
parents:
diff changeset
31 configure_tgt_pre_target_cpu_XCFLAGS="${XCFLAGS}"
kono
parents:
diff changeset
32
kono
parents:
diff changeset
33 case "${target_cpu}" in
kono
parents:
diff changeset
34 alpha*)
kono
parents:
diff changeset
35 # fenv.c needs this option to generate inexact exceptions.
kono
parents:
diff changeset
36 XCFLAGS="${XCFLAGS} -mfp-trap-mode=sui"
kono
parents:
diff changeset
37 ARCH=alpha
kono
parents:
diff changeset
38 ;;
kono
parents:
diff changeset
39 rs6000 | powerpc*) ARCH=powerpc ;;
kono
parents:
diff changeset
40 riscv*) ARCH=riscv ;;
kono
parents:
diff changeset
41 sh*) ARCH=sh ;;
kono
parents:
diff changeset
42
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
43 aarch64*)
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
44 ARCH=aarch64
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
45 case "${target}" in
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
46 aarch64*-*-linux*)
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
47 if test -n "$enable_aarch64_lse"; then
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
48 try_ifunc=yes
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
49 fi
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
50 ;;
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
51 esac
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
52 ;;
111
kono
parents:
diff changeset
53 arm*)
kono
parents:
diff changeset
54 ARCH=arm
kono
parents:
diff changeset
55 case "${target}" in
kono
parents:
diff changeset
56 arm*-*-freebsd*)
kono
parents:
diff changeset
57 ;;
kono
parents:
diff changeset
58 *)
kono
parents:
diff changeset
59 # ??? Detect when -march=armv7 is already enabled.
kono
parents:
diff changeset
60 try_ifunc=yes
kono
parents:
diff changeset
61 ;;
kono
parents:
diff changeset
62 esac
kono
parents:
diff changeset
63 ;;
kono
parents:
diff changeset
64 sparc)
kono
parents:
diff changeset
65 case " ${CC} ${CFLAGS} " in
kono
parents:
diff changeset
66 *" -m64 "*)
kono
parents:
diff changeset
67 ;;
kono
parents:
diff changeset
68 *)
kono
parents:
diff changeset
69 if test -z "$with_cpu"; then
kono
parents:
diff changeset
70 XCFLAGS="${XCFLAGS} -mcpu=v9"
kono
parents:
diff changeset
71 fi
kono
parents:
diff changeset
72 esac
kono
parents:
diff changeset
73 ARCH=sparc
kono
parents:
diff changeset
74 ;;
kono
parents:
diff changeset
75 sparc64|sparcv9)
kono
parents:
diff changeset
76 case " ${CC} ${CFLAGS} " in
kono
parents:
diff changeset
77 *" -m32 "*)
kono
parents:
diff changeset
78 XCFLAGS="${XCFLAGS} -mcpu=v9"
kono
parents:
diff changeset
79 ;;
kono
parents:
diff changeset
80 esac
kono
parents:
diff changeset
81 ARCH=sparc
kono
parents:
diff changeset
82 ;;
kono
parents:
diff changeset
83
kono
parents:
diff changeset
84 i[3456]86)
kono
parents:
diff changeset
85 case " ${CC} ${CFLAGS} " in
kono
parents:
diff changeset
86 *" -m64 "*|*" -mx32 "*)
kono
parents:
diff changeset
87 ;;
kono
parents:
diff changeset
88 *)
kono
parents:
diff changeset
89 if test -z "$with_arch"; then
kono
parents:
diff changeset
90 XCFLAGS="${XCFLAGS} -march=i486 -mtune=${target_cpu}"
kono
parents:
diff changeset
91 XCFLAGS="${XCFLAGS} -fomit-frame-pointer"
kono
parents:
diff changeset
92 fi
kono
parents:
diff changeset
93 esac
kono
parents:
diff changeset
94 ARCH=x86
kono
parents:
diff changeset
95 # ??? Detect when -march=i686 is already enabled.
kono
parents:
diff changeset
96 try_ifunc=yes
kono
parents:
diff changeset
97 ;;
kono
parents:
diff changeset
98 x86_64)
kono
parents:
diff changeset
99 case " ${CC} ${CFLAGS} " in
kono
parents:
diff changeset
100 *" -m32 "*)
kono
parents:
diff changeset
101 XCFLAGS="${XCFLAGS} -march=i486 -mtune=generic"
kono
parents:
diff changeset
102 XCFLAGS="${XCFLAGS} -fomit-frame-pointer"
kono
parents:
diff changeset
103 ;;
kono
parents:
diff changeset
104 *)
kono
parents:
diff changeset
105 ;;
kono
parents:
diff changeset
106 esac
kono
parents:
diff changeset
107 ARCH=x86
kono
parents:
diff changeset
108 # ??? Detect when -mcx16 is already enabled.
kono
parents:
diff changeset
109 try_ifunc=yes
kono
parents:
diff changeset
110 ;;
kono
parents:
diff changeset
111
kono
parents:
diff changeset
112 *) ARCH="${target_cpu}" ;;
kono
parents:
diff changeset
113 esac
kono
parents:
diff changeset
114
kono
parents:
diff changeset
115 # The cpu configury is always most relevant.
kono
parents:
diff changeset
116 if test -d ${srcdir}/config/$ARCH ; then
kono
parents:
diff changeset
117 config_path="$ARCH"
kono
parents:
diff changeset
118 fi
kono
parents:
diff changeset
119
kono
parents:
diff changeset
120 # Other system configury
kono
parents:
diff changeset
121 case "${target}" in
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
122 aarch64*-*-linux*)
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
123 # OS support for atomic primitives.
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
124 config_path="${config_path} linux/aarch64 posix"
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
125 ;;
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
126
111
kono
parents:
diff changeset
127 arm*-*-linux*)
kono
parents:
diff changeset
128 # OS support for atomic primitives.
kono
parents:
diff changeset
129 config_path="${config_path} linux/arm posix"
kono
parents:
diff changeset
130 ;;
kono
parents:
diff changeset
131
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
132 s390*-*-linux*)
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
133 # OS support for atomic primitives.
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
134 config_path="${config_path} s390 posix"
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
135 ;;
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
136
111
kono
parents:
diff changeset
137 *-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu \
kono
parents:
diff changeset
138 | *-*-netbsd* | *-*-freebsd* | *-*-openbsd* | *-*-dragonfly* \
kono
parents:
diff changeset
139 | *-*-solaris2* | *-*-sysv4* | *-*-irix6* | *-*-osf* | *-*-hpux11* \
kono
parents:
diff changeset
140 | *-*-darwin* | *-*-aix* | *-*-cygwin*)
kono
parents:
diff changeset
141 # POSIX system. The OS is supported.
kono
parents:
diff changeset
142 config_path="${config_path} posix"
kono
parents:
diff changeset
143 ;;
kono
parents:
diff changeset
144
kono
parents:
diff changeset
145 *-*-mingw*)
kono
parents:
diff changeset
146 # OS support for atomic primitives.
kono
parents:
diff changeset
147 case ${target_thread_file} in
kono
parents:
diff changeset
148 win32)
kono
parents:
diff changeset
149 config_path="${config_path} mingw"
kono
parents:
diff changeset
150 ;;
kono
parents:
diff changeset
151 posix)
kono
parents:
diff changeset
152 config_path="${config_path} posix"
kono
parents:
diff changeset
153 ;;
kono
parents:
diff changeset
154 esac
kono
parents:
diff changeset
155 ;;
kono
parents:
diff changeset
156
kono
parents:
diff changeset
157 *-*-rtems*)
kono
parents:
diff changeset
158 XCFLAGS="${configure_tgt_pre_target_cpu_XCFLAGS}"
kono
parents:
diff changeset
159 config_path="rtems"
kono
parents:
diff changeset
160 ;;
kono
parents:
diff changeset
161
kono
parents:
diff changeset
162 *-*-elf*)
kono
parents:
diff changeset
163 # ??? No target OS. We could be targeting bare-metal kernel-mode,
kono
parents:
diff changeset
164 # or user-mode for some custom OS. If the target supports TAS,
kono
parents:
diff changeset
165 # we can build our own spinlocks, given there are no signals.
kono
parents:
diff changeset
166 # If the target supports disabling interrupts, we can work in
kono
parents:
diff changeset
167 # kernel-mode, given the system is not multi-processor.
kono
parents:
diff changeset
168 UNSUPPORTED=1
kono
parents:
diff changeset
169 ;;
kono
parents:
diff changeset
170
kono
parents:
diff changeset
171 *)
kono
parents:
diff changeset
172 # Who are you?
kono
parents:
diff changeset
173 UNSUPPORTED=1
kono
parents:
diff changeset
174 ;;
kono
parents:
diff changeset
175 esac
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
176
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
177 # glibc will pass hwcap to ifunc resolver functions as an argument.
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
178 # The type may be different on different architectures.
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
179 case "${target}" in
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
180 aarch64*-*-*)
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
181 IFUNC_RESOLVER_ARGS="uint64_t hwcap"
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
182 ;;
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
183 *)
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
184 IFUNC_RESOLVER_ARGS="void"
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
185 ;;
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
186 esac