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 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/configure.in b/configure.in
index 2f3f67e..7f03c74 100644
--- a/configure.in
+++ b/configure.in
@@ -1752,9 +1752,21 @@
 # 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])