Blame sysdeps/arm/configure.ac

Packit 6c4009
GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
Packit 6c4009
# Local configure fragment for sysdeps/arm.
Packit 6c4009
Packit 6c4009
dnl It is always possible to access static and hidden symbols in an
Packit 6c4009
dnl position independent way.  This has been true since GCC 4.1,
Packit 6c4009
dnl which is older than the minimum version required to build libc.
Packit 6c4009
AC_DEFINE(PI_STATIC_AND_HIDDEN)
Packit 6c4009
Packit 6c4009
# We check to see if the compiler and flags are
Packit 6c4009
# selecting the hard-float ABI and if they are then
Packit 6c4009
# we set libc_cv_arm_pcs_vfp to yes which causes
Packit 6c4009
# HAVE_ARM_PCS_VFP to be defined in config.h and
Packit 6c4009
# in include/libc-symbols.h and thus available to
Packit 6c4009
# shlib-versions to select the appropriate name for
Packit 6c4009
# the dynamic linker via %ifdef.
Packit 6c4009
AC_CACHE_CHECK([whether the compiler is using the ARM hard-float ABI],
Packit 6c4009
  [libc_cv_arm_pcs_vfp],
Packit 6c4009
  [AC_EGREP_CPP(yes,[#ifdef __ARM_PCS_VFP
Packit 6c4009
		      yes
Packit 6c4009
		     #endif
Packit 6c4009
  ], libc_cv_arm_pcs_vfp=yes, libc_cv_arm_pcs_vfp=no)])
Packit 6c4009
if test $libc_cv_arm_pcs_vfp = yes; then
Packit 6c4009
  AC_DEFINE(HAVE_ARM_PCS_VFP)
Packit 6c4009
  LIBC_CONFIG_VAR([default-abi], [hard])
Packit 6c4009
else
Packit 6c4009
  LIBC_CONFIG_VAR([default-abi], [soft])
Packit 6c4009
fi
Packit 6c4009
Packit 6c4009
AC_CACHE_CHECK([whether PC-relative relocs in movw/movt work properly],
Packit 6c4009
	       libc_cv_arm_pcrel_movw, [
Packit 6c4009
cat > conftest.s <<\EOF
Packit 6c4009
	.syntax unified
Packit 6c4009
	.arm
Packit 6c4009
	.arch armv7-a
Packit 6c4009
Packit 6c4009
	.text
Packit 6c4009
	.globl foo
Packit 6c4009
	.type foo,%function
Packit 6c4009
foo:	movw r0, #:lower16:symbol - 1f - 8
Packit 6c4009
	movt r0, #:upper16:symbol - 1f - 8
Packit 6c4009
1:	add r0, pc
Packit 6c4009
	@ And now a case with a local symbol.
Packit 6c4009
	movw r0, #:lower16:3f - 2f - 8
Packit 6c4009
	movt r0, #:upper16:3f - 2f - 8
Packit 6c4009
2:	add r0, pc
Packit 6c4009
	bx lr
Packit 6c4009
Packit 6c4009
.data
Packit 6c4009
	.globl symbol
Packit 6c4009
	.hidden symbol
Packit 6c4009
symbol:	.long 23
Packit 6c4009
3:	.long 17
Packit 6c4009
EOF
Packit 6c4009
libc_cv_arm_pcrel_movw=no
Packit 6c4009
${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS \
Packit 6c4009
	 -nostartfiles -nostdlib -shared \
Packit 6c4009
	 -o conftest.so conftest.s 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD &&
Packit 6c4009
LC_ALL=C $READELF -dr conftest.so > conftest.dr 2>&AS_MESSAGE_LOG_FD &&
Packit 6c4009
{
Packit 6c4009
  cat conftest.dr 1>&AS_MESSAGE_LOG_FD
Packit 6c4009
  fgrep 'TEXTREL
Packit 6c4009
R_ARM_NONE' conftest.dr > /dev/null || libc_cv_arm_pcrel_movw=yes
Packit 6c4009
}
Packit 6c4009
rm -f conftest*])
Packit 6c4009
if test $libc_cv_arm_pcrel_movw = yes; then
Packit 6c4009
  AC_DEFINE([ARM_PCREL_MOVW_OK])
Packit 6c4009
fi
Packit 6c4009
Packit 6c4009
# This was buggy in assemblers from GNU binutils versions before 2.25.1
Packit 6c4009
# (it's known to be broken in 2.24 and 2.25; see
Packit 6c4009
# https://sourceware.org/bugzilla/show_bug.cgi?id=18383).
Packit 6c4009
AC_CACHE_CHECK([whether TPOFF relocs with addends are assembled correctly],
Packit 6c4009
	       libc_cv_arm_tpoff_addend, [
Packit 6c4009
cat > conftest.s <<\EOF
Packit 6c4009
	.syntax unified
Packit 6c4009
	.arm
Packit 6c4009
	.arch armv7-a
Packit 6c4009
Packit 6c4009
	.text
Packit 6c4009
foo:
Packit 6c4009
	.word tbase(tpoff)+4
Packit 6c4009
Packit 6c4009
	.section .tdata,"awT",%progbits
Packit 6c4009
	.word -4
Packit 6c4009
tbase:	.word 0
Packit 6c4009
	.word 4
Packit 6c4009
EOF
Packit 6c4009
libc_cv_arm_tpoff_addend=no
Packit 6c4009
${CC-cc} -c $CFLAGS $CPPFLAGS \
Packit 6c4009
	 -o conftest.o conftest.s 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD &&
Packit 6c4009
LC_ALL=C $READELF -x.text conftest.o > conftest.x 2>&AS_MESSAGE_LOG_FD &&
Packit 6c4009
{
Packit 6c4009
  cat conftest.x 1>&AS_MESSAGE_LOG_FD
Packit 6c4009
  $AWK 'BEGIN { result = 2 }
Packit 6c4009
$1 ~ /0x0+/ && $2 ~ /[[0-9a-f]]+/ {
Packit 6c4009
# Check for little-endian or big-endian encoding of 4 in the in-place addend.
Packit 6c4009
  result = ($2 == "04000000" || $2 == "00000004") ? 0 : 1
Packit 6c4009
}
Packit 6c4009
END { exit(result) }
Packit 6c4009
' conftest.x 2>&AS_MESSAGE_LOG_FD && libc_cv_arm_tpoff_addend=yes
Packit 6c4009
}
Packit 6c4009
rm -f conftest*])
Packit 6c4009
if test $libc_cv_arm_tpoff_addend = no; then
Packit 6c4009
  LIBC_CONFIG_VAR([test-xfail-tst-tlsalign], [yes])
Packit 6c4009
  LIBC_CONFIG_VAR([test-xfail-tst-tlsalign-static], [yes])
Packit 6c4009
fi
Packit 6c4009
Packit 6c4009
Packit 6c4009
libc_cv_gcc_unwind_find_fde=no
Packit 6c4009
Packit 6c4009
# Remove -fno-unwind-tables that was added in sysdeps/arm/preconfigure.ac.
Packit 6c4009
CFLAGS=${CFLAGS% -fno-unwind-tables}