This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] change ifunc assembly test to a link test
- From: Andrew Pinski <pinskia at gmail dot com>
- To: Mike Frysinger <vapier at gentoo dot org>
- Cc: libc-alpha at sourceware dot org
- Date: Mon, 22 Oct 2012 20:57:58 -0700
- Subject: Re: [PATCH] change ifunc assembly test to a link test
- References: <1350964487-8087-1-git-send-email-vapier@gentoo.org>
On Mon, Oct 22, 2012 at 8:54 PM, Mike Frysinger <vapier@gentoo.org> wrote:
> The test currently tests the binutils frontend support which passes for
> all versions of binutils we currently require (2.20+). It doesn't test
> the backend which is required for ifunc to actually work, and which most
> targets don't yet support.
>
> Change the assembly code so that when we link it, we get a file that has
> ifunc relocations if the backend supports it. That way we can test to
> see if binutils supports everything we need.
>
> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
>
> 2012-10-22 Mike Frysinger <vapier@gentoo.org>
>
> * configure.in: Move READELF check to start of file.
> (libc_cv_asm_gnu_indirect_function): Change to a link test.
> * configure: Regenerated.
> ---
> configure | 205 +++++++++++++++++++++++++++++++----------------------------
> configure.in | 21 ++++--
> 2 files changed, 122 insertions(+), 104 deletions(-)
> diff --git a/configure.in b/configure.in
> index 3af030a..de33fe6 100644
> --- a/configure.in
> +++ b/configure.in
> @@ -23,6 +23,7 @@ AC_SUBST(cross_compiling)
> AC_PROG_CPP
> # We need the C++ compiler only for testing.
> AC_PROG_CXX
> +AC_CHECK_TOOL(READELF, readelf, false)
>
> if test "`cd $srcdir; /bin/pwd`" = "`/bin/pwd`"; then
> AC_MSG_ERROR([you must configure in a separate build directory])
> @@ -571,12 +572,21 @@ AC_CACHE_CHECK([for assembler gnu_indirect_function symbol type support],
> libc_cv_asm_gnu_indirect_function, [dnl
> cat > conftest.s <<EOF
> .type foo,%gnu_indirect_function
> +foo:
> +.globl _start
> +_start:
I think you should also include __start in that .s file as MIPS uses
__start as the start function. Even though the test will fail on MIPS
right now, it is a good idea to have it working partly so that it
works in the future when ifunc support is included.
Thanks,
Andrew Pinski
> +.data
> +.long foo
> EOF
> -if ${CC-cc} -c $ASFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD;
> -then
> - libc_cv_asm_gnu_indirect_function=yes
> -else
> - libc_cv_asm_gnu_indirect_function=no
> +libc_cv_asm_gnu_indirect_function=no
> +if ${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS \
> + -nostartfiles -nostdlib \
> + -o conftest conftest.s 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
> + # Do a link to see if the backend supports IFUNC relocs.
> + $READELF -r conftest 1>&AS_MESSAGE_LOG_FD
> + if ! LC_ALL=C $READELF -r conftest | grep -q 'no relocations'; then
> + libc_cv_asm_gnu_indirect_function=yes
> + fi
> fi
> rm -f conftest*])
>
> @@ -930,7 +940,6 @@ AC_CHECK_PROG_VER(AWK, gawk, --version,
> [GNU Awk[^0-9]*\([0-9][0-9.]*\)],
> [[3-9].*], critic_missing="$critic_missing gawk")
>
> -AC_CHECK_TOOL(READELF, readelf, false)
> AC_CHECK_TOOL(NM, nm, false)
>
> AC_CHECK_PROGS(AUTOCONF, autoconf, no)
> --
> 1.7.12
>