From: Florian Krohm Date: Fri, 6 Jul 2012 09:17:29 +0000 (+0000) Subject: Enhance the check for ifunc compatibility testing. X-Git-Tag: svn/VALGRIND_3_8_0~151 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bc81135c3e7e3bcc7900d9a172990d3945da7a65;p=thirdparty%2Fvalgrind.git 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 --- 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])