1# This file is generated from configure.ac by Autoconf.  DO NOT EDIT!
2 # Local configure fragment for sysdeps/aarch64.
3
4# Static and hidden objects are accessed without dynamic relocations.
5# The exception is -mcmodel=large which is unsupported with PIC/PIE.
6$as_echo "#define PI_STATIC_AND_HIDDEN 1" >>confdefs.h
7
8
9# Static PIE is supported.
10$as_echo "#define SUPPORT_STATIC_PIE 1" >>confdefs.h
11
12
13# We check to see if the compiler and flags are
14# selecting the big endian ABI and if they are then
15# we set libc_cv_aarch64_be to yes which causes
16# HAVE_AARCH64_BE to be defined in config.h and
17# in include/libc-symbols.h and thus available to
18# shlib-versions to select the appropriate name for
19# the dynamic linker via %ifdef.
20
21
22{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
23$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
24if ${ac_cv_path_GREP+:} false; then :
25  $as_echo_n "(cached) " >&6
26else
27  if test -z "$GREP"; then
28  ac_path_GREP_found=false
29  # Loop through the user's path and test for each of PROGNAME-LIST
30  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
31for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
32do
33  IFS=$as_save_IFS
34  test -z "$as_dir" && as_dir=.
35    for ac_prog in grep ggrep; do
36    for ac_exec_ext in '' $ac_executable_extensions; do
37      ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
38      as_fn_executable_p "$ac_path_GREP" || continue
39# Check for GNU ac_path_GREP and select it if it is found.
40  # Check for GNU $ac_path_GREP
41case `"$ac_path_GREP" --version 2>&1` in
42*GNU*)
43  ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
44*)
45  ac_count=0
46  $as_echo_n 0123456789 >"conftest.in"
47  while :
48  do
49    cat "conftest.in" "conftest.in" >"conftest.tmp"
50    mv "conftest.tmp" "conftest.in"
51    cp "conftest.in" "conftest.nl"
52    $as_echo 'GREP' >> "conftest.nl"
53    "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
54    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
55    as_fn_arith $ac_count + 1 && ac_count=$as_val
56    if test $ac_count -gt ${ac_path_GREP_max-0}; then
57      # Best one so far, save it but keep looking for a better one
58      ac_cv_path_GREP="$ac_path_GREP"
59      ac_path_GREP_max=$ac_count
60    fi
61    # 10*(2^10) chars as input seems more than enough
62    test $ac_count -gt 10 && break
63  done
64  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
65esac
66
67      $ac_path_GREP_found && break 3
68    done
69  done
70  done
71IFS=$as_save_IFS
72  if test -z "$ac_cv_path_GREP"; then
73    as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
74  fi
75else
76  ac_cv_path_GREP=$GREP
77fi
78
79fi
80{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
81$as_echo "$ac_cv_path_GREP" >&6; }
82 GREP="$ac_cv_path_GREP"
83
84
85{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
86$as_echo_n "checking for egrep... " >&6; }
87if ${ac_cv_path_EGREP+:} false; then :
88  $as_echo_n "(cached) " >&6
89else
90  if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
91   then ac_cv_path_EGREP="$GREP -E"
92   else
93     if test -z "$EGREP"; then
94  ac_path_EGREP_found=false
95  # Loop through the user's path and test for each of PROGNAME-LIST
96  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
97for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
98do
99  IFS=$as_save_IFS
100  test -z "$as_dir" && as_dir=.
101    for ac_prog in egrep; do
102    for ac_exec_ext in '' $ac_executable_extensions; do
103      ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
104      as_fn_executable_p "$ac_path_EGREP" || continue
105# Check for GNU ac_path_EGREP and select it if it is found.
106  # Check for GNU $ac_path_EGREP
107case `"$ac_path_EGREP" --version 2>&1` in
108*GNU*)
109  ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
110*)
111  ac_count=0
112  $as_echo_n 0123456789 >"conftest.in"
113  while :
114  do
115    cat "conftest.in" "conftest.in" >"conftest.tmp"
116    mv "conftest.tmp" "conftest.in"
117    cp "conftest.in" "conftest.nl"
118    $as_echo 'EGREP' >> "conftest.nl"
119    "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
120    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
121    as_fn_arith $ac_count + 1 && ac_count=$as_val
122    if test $ac_count -gt ${ac_path_EGREP_max-0}; then
123      # Best one so far, save it but keep looking for a better one
124      ac_cv_path_EGREP="$ac_path_EGREP"
125      ac_path_EGREP_max=$ac_count
126    fi
127    # 10*(2^10) chars as input seems more than enough
128    test $ac_count -gt 10 && break
129  done
130  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
131esac
132
133      $ac_path_EGREP_found && break 3
134    done
135  done
136  done
137IFS=$as_save_IFS
138  if test -z "$ac_cv_path_EGREP"; then
139    as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
140  fi
141else
142  ac_cv_path_EGREP=$EGREP
143fi
144
145   fi
146fi
147{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
148$as_echo "$ac_cv_path_EGREP" >&6; }
149 EGREP="$ac_cv_path_EGREP"
150
151
152{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for big endian" >&5
153$as_echo_n "checking for big endian... " >&6; }
154if ${libc_cv_aarch64_be+:} false; then :
155  $as_echo_n "(cached) " >&6
156else
157  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
158/* end confdefs.h.  */
159#ifdef __AARCH64EB__
160                      yes
161                     #endif
162
163_ACEOF
164if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
165  $EGREP "yes" >/dev/null 2>&1; then :
166  libc_cv_aarch64_be=yes
167else
168  libc_cv_aarch64_be=no
169fi
170rm -f conftest*
171
172fi
173{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_aarch64_be" >&5
174$as_echo "$libc_cv_aarch64_be" >&6; }
175if test $libc_cv_aarch64_be = yes; then
176  $as_echo "#define HAVE_AARCH64_BE 1" >>confdefs.h
177
178  config_vars="$config_vars
179default-abi = lp64_be"
180else
181  config_vars="$config_vars
182default-abi = lp64"
183fi
184
185# Only consider BTI supported if -mbranch-protection=bti is
186# on by default in the compiler and the linker produces
187# binaries with GNU property notes in PT_GNU_PROPERTY segment.
188{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BTI support" >&5
189$as_echo_n "checking for BTI support... " >&6; }
190if ${libc_cv_aarch64_bti+:} false; then :
191  $as_echo_n "(cached) " >&6
192else
193    cat > conftest.c <<EOF
194void foo (void) { }
195EOF
196  libc_cv_aarch64_bti=no
197  if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -nostdlib -nostartfiles $no_ssp -shared -fPIC -o conftest.so conftest.c'
198  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
199  (eval $ac_try) 2>&5
200  ac_status=$?
201  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
202  test $ac_status = 0; }; } \
203     && { ac_try='$READELF -lW conftest.so | grep -q GNU_PROPERTY'
204  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
205  (eval $ac_try) 2>&5
206  ac_status=$?
207  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
208  test $ac_status = 0; }; } \
209     && { ac_try='$READELF -nW conftest.so | grep -q "NT_GNU_PROPERTY_TYPE_0.*AArch64 feature:.* BTI"'
210  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
211  (eval $ac_try) 2>&5
212  ac_status=$?
213  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
214  test $ac_status = 0; }; }
215  then
216    libc_cv_aarch64_bti=yes
217  fi
218  rm -rf conftest.*
219fi
220{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_aarch64_bti" >&5
221$as_echo "$libc_cv_aarch64_bti" >&6; }
222config_vars="$config_vars
223aarch64-bti = $libc_cv_aarch64_bti"
224if test $libc_cv_aarch64_bti = yes; then
225  $as_echo "#define HAVE_AARCH64_BTI 1" >>confdefs.h
226
227fi
228
229# Check if glibc is built with return address signing, i.e.
230# if -mbranch-protection=pac-ret is on. We need this because
231# pac-ret relies on unwinder support so it's not safe to use
232# it in assembly code unconditionally, but there is no
233# feature test macro for it in gcc.
234{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if pac-ret is enabled" >&5
235$as_echo_n "checking if pac-ret is enabled... " >&6; }
236if ${libc_cv_aarch64_pac_ret+:} false; then :
237  $as_echo_n "(cached) " >&6
238else
239    cat > conftest.c <<EOF
240int bar (void);
241int foo (void) { return bar () + 1; }
242EOF
243  libc_cv_aarch64_pac_ret=no
244  if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS -S -o conftest.s conftest.c'
245  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
246  (eval $ac_try) 2>&5
247  ac_status=$?
248  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
249  test $ac_status = 0; }; } \
250     && { ac_try='grep -q -E '\''(hint( |	)+25|paciasp)'\'' conftest.s'
251  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
252  (eval $ac_try) 2>&5
253  ac_status=$?
254  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
255  test $ac_status = 0; }; }
256  then
257    libc_cv_aarch64_pac_ret=yes
258  fi
259  rm -rf conftest.*
260fi
261{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_aarch64_pac_ret" >&5
262$as_echo "$libc_cv_aarch64_pac_ret" >&6; }
263if test $libc_cv_aarch64_pac_ret = yes; then
264  $as_echo "#define HAVE_AARCH64_PAC_RET 1" >>confdefs.h
265
266fi
267
268# Check if binutils supports variant PCS symbols.
269{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for variant PCS support" >&5
270$as_echo_n "checking for variant PCS support... " >&6; }
271if ${libc_cv_aarch64_variant_pcs+:} false; then :
272  $as_echo_n "(cached) " >&6
273else
274    cat > conftest.S <<EOF
275.global foo
276.type foo, %function
277.variant_pcs foo
278foo:
279	ret
280.global bar
281.type bar, %function
282bar:
283	b foo
284EOF
285  libc_cv_aarch64_variant_pcs=no
286  if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -nostdlib -nostartfiles $no_ssp -shared -fPIC -o conftest.so conftest.S'
287  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
288  (eval $ac_try) 2>&5
289  ac_status=$?
290  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
291  test $ac_status = 0; }; } \
292     && { ac_try='$READELF -dW conftest.so | grep -q AARCH64_VARIANT_PCS'
293  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
294  (eval $ac_try) 2>&5
295  ac_status=$?
296  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
297  test $ac_status = 0; }; }
298  then
299    libc_cv_aarch64_variant_pcs=yes
300  fi
301  rm -rf conftest.*
302fi
303{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_aarch64_variant_pcs" >&5
304$as_echo "$libc_cv_aarch64_variant_pcs" >&6; }
305config_vars="$config_vars
306aarch64-variant-pcs = $libc_cv_aarch64_variant_pcs"
307
308# Check if asm support armv8.2-a+sve
309{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SVE support in assembler" >&5
310$as_echo_n "checking for SVE support in assembler... " >&6; }
311if ${libc_cv_asm_sve+:} false; then :
312  $as_echo_n "(cached) " >&6
313else
314  cat > conftest.s <<\EOF
315        ptrue p0.b
316EOF
317if { ac_try='${CC-cc} -c -march=armv8.2-a+sve conftest.s 1>&5'
318  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
319  (eval $ac_try) 2>&5
320  ac_status=$?
321  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
322  test $ac_status = 0; }; }; then
323  libc_cv_aarch64_sve_asm=yes
324else
325  libc_cv_aarch64_sve_asm=no
326fi
327rm -f conftest*
328fi
329{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_asm_sve" >&5
330$as_echo "$libc_cv_asm_sve" >&6; }
331if test $libc_cv_aarch64_sve_asm = yes; then
332  $as_echo "#define HAVE_AARCH64_SVE_ASM 1" >>confdefs.h
333
334fi
335