summaryrefslogtreecommitdiff
path: root/aclocal.m4
diff options
context:
space:
mode:
authorNiels Möller <nisse@lysator.liu.se>2015-01-13 09:57:29 +0100
committerNiels Möller <nisse@lysator.liu.se>2015-01-13 09:57:29 +0100
commit2185ed0d8d707b310fc289fb4ce263157480b615 (patch)
tree99211e38d764ab7c5c5bd177a93d6ff461a54694 /aclocal.m4
parent343be0b5877bd7773fe684b1fd913c241b48d75b (diff)
downloadnettle-2185ed0d8d707b310fc289fb4ce263157480b615.tar.gz
Autoconf check for ifunc support.
Diffstat (limited to 'aclocal.m4')
-rw-r--r--aclocal.m435
1 files changed, 35 insertions, 0 deletions
diff --git a/aclocal.m4 b/aclocal.m4
index b6846cae..e534f55b 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -643,6 +643,41 @@ foo:
fi
])
+dnl NETTLE_CHECK_IFUNC
+dnl ------------------
+dnl Check if __attribute__ ((ifunc(...))) works
+AC_DEFUN([NETTLE_CHECK_IFUNC],
+[AC_REQUIRE([AC_PROG_CC])
+AC_CACHE_CHECK([for ifunc support],
+ nettle_cv_link_ifunc,
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([
+static int
+foo_imp(int x)
+{
+ return 1;
+}
+
+typedef void void_func (void);
+
+static void_func *
+foo_resolv(void)
+{
+ return (void_func *) foo_imp;
+}
+
+int foo (int x) __attribute__ ((ifunc("foo_resolv")));
+],[
+ return foo(0);
+
+])],
+[nettle_cv_link_ifunc=yes],
+[nettle_cv_link_ifunc=no]))
+AH_TEMPLATE([HAVE_LINK_IFUNC], [Define if compiler and linker supports __attribute__ ifunc])
+if test "x$nettle_cv_link_ifunc" = xyes ; then
+ AC_DEFINE(HAVE_LINK_IFUNC)
+fi
+])
+
dnl @synopsis AX_CREATE_STDINT_H [( HEADER-TO-GENERATE [, HEADERS-TO-CHECK])]
dnl
dnl the "ISO C9X: 7.18 Integer types <stdint.h>" section requires the