]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Enhance the check for ifunc compatibility testing.
authorFlorian Krohm <florian@eich-krohm.de>
Fri, 6 Jul 2012 09:17:29 +0000 (09:17 +0000)
committerFlorian Krohm <florian@eich-krohm.de>
Fri, 6 Jul 2012 09:17:29 +0000 (09:17 +0000)
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

index 2f3f67e0b4236b323f315d3e1651f8360a80dbb7..7f03c74a1727abff67a4f82c4c28c7a970c7791b 100644 (file)
@@ -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])