blob: 982077c9b909a2120b7cabf35f2ff2ee2e47c406 [file] [log] [blame]
lh9ed821d2023-04-07 01:36:19 -07001GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
2# Local configure fragment for sysdeps/sparc.
3
4# Check for support of VIS3 et al. instructions in the assembler.
5AC_CACHE_CHECK(for sparc assembler VIS3 support, libc_cv_sparc_as_vis3, [dnl
6cat > conftest.S <<\EOF
7 .text
8foo: fmadds %f1, %f2, %f3, %f5
9 fmaddd %f2, %f4, %f8, %f10
10 fhadds %f2, %f3, %f5
11 fhaddd %f4, %f8, %f10
12 pdistn %f2, %f4, %g1
13 movdtox %f10, %o0
14 movstouw %f9, %o1
15 movstosw %f7, %o2
16 movxtod %o3, %f18
17 movwtos %o4, %f15
18 flcmps %fcc0, %f3, %f5
19 flcmpd %fcc1, %f4, %f6
20EOF
21dnl
22if AC_TRY_COMMAND([${CC-cc} -c $CFLAGS -Wa,-Av9d conftest.S]); then
23 libc_cv_sparc_as_vis3=yes
24else
25 libc_cv_sparc_as_vis3=no
26fi
27rm -f conftest*])
28if test $libc_cv_sparc_as_vis3 = yes; then
29 AC_DEFINE(HAVE_AS_VIS3_SUPPORT)
30fi
31LIBC_CONFIG_VAR([have-as-vis3], [$libc_cv_sparc_as_vis3])
32
33# Check for a GCC emitting GOTDATA relocations.
34AC_CACHE_CHECK(for sparc gcc GOTDATA reloc support, libc_cv_sparc_gcc_gotdata, [dnl
35changequote(,)dnl
36cat > conftest.c <<\EOF
37int data;
38int foo(void)
39{
40 return data;
41}
42EOF
43changequote([,])dnl
44dnl
45libc_cv_sparc_gcc_gotdata=no
46if AC_TRY_COMMAND(${CC-cc} -S $CFLAGS -O2 -fPIC conftest.c 1>&AS_MESSAGE_LOG_FD); then
47 if grep -q 'gdop_hix22' conftest.s \
48 && grep -q 'gdop_lox10' conftest.s; then
49 libc_cv_sparc_gcc_gotdata=yes
50 fi
51fi
52rm -f conftest*])
53if test $libc_cv_sparc_gcc_gotdata = yes; then
54 AC_DEFINE(HAVE_GCC_GOTDATA)
55fi
56
57if test $libc_cv_sparc_gcc_gotdata = yes; then
58 AC_DEFINE(PI_STATIC_AND_HIDDEN)
59fi