mirror of https://git.tukaani.org/xz.git
Add ifunc check to configure.ac
configure.ac will now verify if __attribute__((__ifunc__())) can be used in the build system. If so, HAVE_FUNC_ATTRIBUTE_IFUNC will be defined to 1.
This commit is contained in:
parent
dbb3a536ed
commit
23b5c36fb7
28
configure.ac
28
configure.ac
|
@ -859,8 +859,36 @@ AC_COMPILE_IFELSE([
|
||||||
], [
|
], [
|
||||||
AC_MSG_RESULT([no])
|
AC_MSG_RESULT([no])
|
||||||
])
|
])
|
||||||
|
|
||||||
CFLAGS="$OLD_CFLAGS"
|
CFLAGS="$OLD_CFLAGS"
|
||||||
|
|
||||||
|
# __attribute__((__ifunc__())) can be used for one-time initializations,
|
||||||
|
# similar to __attribute__((__constructor__)).
|
||||||
|
AC_ARG_ENABLE([ifunc], [AS_HELP_STRING([--disable-ifunc],
|
||||||
|
[do not use __attribute__((__ifunc__()))])],
|
||||||
|
[], [enable_ifunc=yes])
|
||||||
|
|
||||||
|
if test "x$enable_ifunc" = xyes ; then
|
||||||
|
OLD_CFLAGS="$CFLAGS"
|
||||||
|
CFLAGS="$CFLAGS -Werror"
|
||||||
|
AC_MSG_CHECKING([if __attribute__((__ifunc__())) can be used])
|
||||||
|
AC_COMPILE_IFELSE([
|
||||||
|
static void func(void) { return; }
|
||||||
|
static void (*resolve_func (void)) (void) { return func; }
|
||||||
|
void func_ifunc (void)
|
||||||
|
__attribute__ ((__ifunc__ ("resolve_func")));
|
||||||
|
], [
|
||||||
|
AC_DEFINE([HAVE_FUNC_ATTRIBUTE_IFUNC], [1],
|
||||||
|
[Define to 1 if __attribute__((__ifunc__()))
|
||||||
|
is supported for functions.])
|
||||||
|
AC_MSG_RESULT([yes])
|
||||||
|
], [
|
||||||
|
AC_MSG_RESULT([no])
|
||||||
|
])
|
||||||
|
|
||||||
|
CFLAGS="$OLD_CFLAGS"
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
# Checks for library functions.
|
# Checks for library functions.
|
||||||
|
|
Loading…
Reference in New Issue