| xf.li | bdd93d5 | 2023-05-12 07:10:14 -0700 | [diff] [blame] | 1 | GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory. | 
|  | 2 | # Local configure fragment for sysdeps/arm. | 
|  | 3 |  | 
|  | 4 | dnl It is always possible to access static and hidden symbols in an | 
|  | 5 | dnl position independent way.  This has been true since GCC 4.1, | 
|  | 6 | dnl which is older than the minimum version required to build libc. | 
|  | 7 | AC_DEFINE(PI_STATIC_AND_HIDDEN) | 
|  | 8 |  | 
|  | 9 | # We check to see if the compiler and flags are | 
|  | 10 | # selecting the hard-float ABI and if they are then | 
|  | 11 | # we set libc_cv_arm_pcs_vfp to yes which causes | 
|  | 12 | # HAVE_ARM_PCS_VFP to be defined in config.h and | 
|  | 13 | # in include/libc-symbols.h and thus available to | 
|  | 14 | # shlib-versions to select the appropriate name for | 
|  | 15 | # the dynamic linker via %ifdef. | 
|  | 16 | AC_CACHE_CHECK([whether the compiler is using the ARM hard-float ABI], | 
|  | 17 | [libc_cv_arm_pcs_vfp], | 
|  | 18 | [AC_EGREP_CPP(yes,[#ifdef __ARM_PCS_VFP | 
|  | 19 | yes | 
|  | 20 | #endif | 
|  | 21 | ], libc_cv_arm_pcs_vfp=yes, libc_cv_arm_pcs_vfp=no)]) | 
|  | 22 | if test $libc_cv_arm_pcs_vfp = yes; then | 
|  | 23 | AC_DEFINE(HAVE_ARM_PCS_VFP) | 
|  | 24 | LIBC_CONFIG_VAR([default-abi], [hard]) | 
|  | 25 | else | 
|  | 26 | LIBC_CONFIG_VAR([default-abi], [soft]) | 
|  | 27 | fi | 
|  | 28 |  | 
|  | 29 | AC_CACHE_CHECK([whether PC-relative relocs in movw/movt work properly], | 
|  | 30 | libc_cv_arm_pcrel_movw, [ | 
|  | 31 | cat > conftest.s <<\EOF | 
|  | 32 | .syntax unified | 
|  | 33 | .arm | 
|  | 34 | .arch armv7-a | 
|  | 35 |  | 
|  | 36 | .text | 
|  | 37 | .globl foo | 
|  | 38 | .type foo,%function | 
|  | 39 | foo:	movw r0, #:lower16:symbol - 1f - 8 | 
|  | 40 | movt r0, #:upper16:symbol - 1f - 8 | 
|  | 41 | 1:	add r0, pc | 
|  | 42 | @ And now a case with a local symbol. | 
|  | 43 | movw r0, #:lower16:3f - 2f - 8 | 
|  | 44 | movt r0, #:upper16:3f - 2f - 8 | 
|  | 45 | 2:	add r0, pc | 
|  | 46 | bx lr | 
|  | 47 |  | 
|  | 48 | .data | 
|  | 49 | .globl symbol | 
|  | 50 | .hidden symbol | 
|  | 51 | symbol:	.long 23 | 
|  | 52 | 3:	.long 17 | 
|  | 53 | EOF | 
|  | 54 | libc_cv_arm_pcrel_movw=no | 
|  | 55 | ${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS \ | 
|  | 56 | -nostartfiles -nostdlib -shared \ | 
|  | 57 | -o conftest.so conftest.s 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD && | 
|  | 58 | LC_ALL=C $READELF -dr conftest.so > conftest.dr 2>&AS_MESSAGE_LOG_FD && | 
|  | 59 | { | 
|  | 60 | cat conftest.dr 1>&AS_MESSAGE_LOG_FD | 
|  | 61 | fgrep 'TEXTREL | 
|  | 62 | R_ARM_NONE' conftest.dr > /dev/null || libc_cv_arm_pcrel_movw=yes | 
|  | 63 | } | 
|  | 64 | rm -f conftest*]) | 
|  | 65 | if test $libc_cv_arm_pcrel_movw = yes; then | 
|  | 66 | AC_DEFINE([ARM_PCREL_MOVW_OK]) | 
|  | 67 | fi | 
|  | 68 |  | 
|  | 69 | # This was buggy in assemblers from GNU binutils versions before 2.25.1 | 
|  | 70 | # (it's known to be broken in 2.24 and 2.25; see | 
|  | 71 | # https://sourceware.org/bugzilla/show_bug.cgi?id=18383). | 
|  | 72 | AC_CACHE_CHECK([whether TPOFF relocs with addends are assembled correctly], | 
|  | 73 | libc_cv_arm_tpoff_addend, [ | 
|  | 74 | cat > conftest.s <<\EOF | 
|  | 75 | .syntax unified | 
|  | 76 | .arm | 
|  | 77 | .arch armv7-a | 
|  | 78 |  | 
|  | 79 | .text | 
|  | 80 | foo: | 
|  | 81 | .word tbase(tpoff)+4 | 
|  | 82 |  | 
|  | 83 | .section .tdata,"awT",%progbits | 
|  | 84 | .word -4 | 
|  | 85 | tbase:	.word 0 | 
|  | 86 | .word 4 | 
|  | 87 | EOF | 
|  | 88 | libc_cv_arm_tpoff_addend=no | 
|  | 89 | ${CC-cc} -c $CFLAGS $CPPFLAGS \ | 
|  | 90 | -o conftest.o conftest.s 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD && | 
|  | 91 | LC_ALL=C $READELF -x.text conftest.o > conftest.x 2>&AS_MESSAGE_LOG_FD && | 
|  | 92 | { | 
|  | 93 | cat conftest.x 1>&AS_MESSAGE_LOG_FD | 
|  | 94 | $AWK 'BEGIN { result = 2 } | 
|  | 95 | $1 ~ /0x0+/ && $2 ~ /[[0-9a-f]]+/ { | 
|  | 96 | # Check for little-endian or big-endian encoding of 4 in the in-place addend. | 
|  | 97 | result = ($2 == "04000000" || $2 == "00000004") ? 0 : 1 | 
|  | 98 | } | 
|  | 99 | END { exit(result) } | 
|  | 100 | ' conftest.x 2>&AS_MESSAGE_LOG_FD && libc_cv_arm_tpoff_addend=yes | 
|  | 101 | } | 
|  | 102 | rm -f conftest*]) | 
|  | 103 | if test $libc_cv_arm_tpoff_addend = no; then | 
|  | 104 | LIBC_CONFIG_VAR([test-xfail-tst-tlsalign], [yes]) | 
|  | 105 | LIBC_CONFIG_VAR([test-xfail-tst-tlsalign-static], [yes]) | 
|  | 106 | fi | 
|  | 107 |  | 
|  | 108 |  | 
|  | 109 | libc_cv_gcc_unwind_find_fde=no | 
|  | 110 |  | 
|  | 111 | # Remove -fno-unwind-tables that was added in sysdeps/arm/preconfigure.ac. | 
|  | 112 | CFLAGS=${CFLAGS% -fno-unwind-tables} |