From bc81135c3e7e3bcc7900d9a172990d3945da7a65 Mon Sep 17 00:00:00 2001 From: Florian Krohm Date: Fri, 6 Jul 2012 09:17:29 +0000 Subject: [PATCH] Enhance the check for ifunc compatibility testing. Make sure the executable can be linked. As observed with gcc 4.4.5 and binutils 2.20.1 git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12717 --- configure.in | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/configure.in b/configure.in index 2f3f67e0b4..7f03c74a17 100644 --- a/configure.in +++ b/configure.in @@ -1752,9 +1752,21 @@ AM_CONDITIONAL(BUILD_AVX_TESTS, test x$ac_have_as_avx = xyes) # automake-level symbol (BUILD_IFUNC_TESTS), used in test Makefile.am's AC_MSG_CHECKING([if gcc supports the ifunc attribute]) -AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ - void bar(void) {} - void foo(void) __attribute__((ifunc("bar"))); +AC_LINK_IFELSE([AC_LANG_SOURCE([[ +static void mytest(void) {} + +static void (*resolve_test(void))(void) +{ + return (void (*)(void))&mytest; +} + +void test(void) __attribute__((ifunc("resolve_test"))); + +int main() +{ + test(); + return 0; +} ]])], [ ac_have_ifunc_attr=yes AC_MSG_RESULT([yes]) -- 2.47.2