1GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
2# Local configure fragment for sysdeps/powerpc/powerpc64.
3
4AC_CACHE_CHECK(for support for overlapping .opd entries,
5libc_cv_overlapping_opd, [dnl
6libc_cv_overlapping_opd=no
7echo 'void foo (void) {}' > conftest.c
8if AC_TRY_COMMAND(${CC-cc} $CFLAGS $CPPFLAGS -S conftest.c -o conftest.s 1>&AS_MESSAGE_LOG_FD); then
9changequote(,)dnl
10  if grep '\.TOC\.@tocbase' conftest.s > /dev/null; then
11    if grep '\.TOC\.@tocbase[ 	]*,[ 	]*0' conftest.s > /dev/null; then
12      :
13    else
14      libc_cv_overlapping_opd=yes
15    fi
16  fi
17changequote([,])dnl
18fi
19rm -f conftest.c conftest.s
20])
21if test x$libc_cv_overlapping_opd = xyes; then
22  AC_DEFINE(USE_PPC64_OVERLAPPING_OPD)
23fi
24
25# We check if compiler supports @notoc generation since there is no
26# gain by enabling it if it will be optimized away by the linker.
27# It also helps linkers that might not optimize it and end up
28# generating stubs with ISA 3.1 instruction even targetting older ISA.
29AC_CACHE_CHECK([if the compiler supports @notoc],
30	       libc_cv_ppc64_notoc, [dnl
31  cat > conftest.c <<EOF
32int bar (void);
33int foo (void) { return bar () + 1; }
34EOF
35  libc_cv_ppc64_notoc=no
36  if AC_TRY_COMMAND([${CC-cc} $libc_cv_cc_submachine $CFLAGS $CPPFLAGS -S -o conftest.s conftest.c]) \
37     && AC_TRY_COMMAND([grep -q -E 'bar@notoc' conftest.s])
38  then
39    libc_cv_ppc64_notoc=yes
40  fi
41  rm -rf conftest.*])
42AS_IF([test x$libc_cv_ppc64_notoc = xyes],
43      [AC_DEFINE(USE_PPC64_NOTOC)])
44