2003-03-16 11:22:41 +08:00
|
|
|
dnl configure fragment for new libpthread implementation.
|
|
|
|
GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
|
|
|
|
|
|
|
|
if test "x$libc_cv_gcc___thread" != xyes; then
|
|
|
|
AC_MSG_ERROR(compiler support for __thread is required)
|
|
|
|
fi
|
2003-04-12 08:58:26 +08:00
|
|
|
|
2003-10-16 03:33:56 +08:00
|
|
|
if test "x${libc_cv_visibility_attribute}" != xyes ||
|
|
|
|
test "x${libc_cv_broken_visibility_attribute}" != xno; then
|
|
|
|
AC_MSG_ERROR(working compiler support for visibility attribute is required)
|
|
|
|
fi
|
|
|
|
|
2003-04-12 08:58:26 +08:00
|
|
|
dnl Iff <unwind.h> is available, make sure it is the right one and it
|
|
|
|
dnl contains struct _Unwind_Exception.
|
|
|
|
AC_CACHE_CHECK(dnl
|
|
|
|
for forced unwind support, libc_cv_forced_unwind, [dnl
|
2014-07-04 12:46:59 +08:00
|
|
|
old_CPPFLAGS="$CPPFLAGS"
|
|
|
|
# Without inhibit_libc #define'd, GCC's unwind.h (at least for ia64)
|
|
|
|
# will try to include <stdlib.h>, which doesn't exist yet if we're
|
|
|
|
# building libc in a bare environment.
|
|
|
|
CPPFLAGS="$CPPFLAGS -Dinhibit_libc=1"
|
2012-03-08 03:34:22 +08:00
|
|
|
AC_TRY_COMPILE([#include <unwind.h>], [
|
2003-04-12 08:58:26 +08:00
|
|
|
struct _Unwind_Exception exc;
|
|
|
|
struct _Unwind_Context *context;
|
|
|
|
_Unwind_GetCFA (context)],
|
2014-07-04 12:46:59 +08:00
|
|
|
libc_cv_forced_unwind=yes, libc_cv_forced_unwind=no)
|
|
|
|
CPPFLAGS="$old_CPPFLAGS"])
|
2003-04-12 08:58:26 +08:00
|
|
|
if test $libc_cv_forced_unwind = yes; then
|
|
|
|
AC_DEFINE(HAVE_FORCED_UNWIND)
|
2003-06-30 07:01:49 +08:00
|
|
|
dnl Check for C cleanup handling.
|
|
|
|
old_CFLAGS="$CFLAGS"
|
|
|
|
CFLAGS="$CFLAGS -Werror -fexceptions"
|
|
|
|
AC_CACHE_CHECK([for C cleanup handling], libc_cv_c_cleanup, [dnl
|
2012-03-08 03:34:22 +08:00
|
|
|
AC_TRY_COMPILE([
|
|
|
|
extern void some_function (void);
|
2003-12-03 14:50:01 +08:00
|
|
|
void cl (void *a) { }], [
|
2003-06-30 07:01:49 +08:00
|
|
|
int a __attribute__ ((cleanup (cl)));
|
2012-03-08 03:34:22 +08:00
|
|
|
some_function ()],
|
2003-06-30 07:01:49 +08:00
|
|
|
libc_cv_c_cleanup=yes, libc_cv_c_cleanup=no)])
|
|
|
|
CFLAGS="$old_CFLAGS"
|
|
|
|
if test $libc_cv_c_cleanup = no; then
|
|
|
|
AC_MSG_ERROR([the compiler must support C cleanup handling])
|
|
|
|
fi
|
2003-11-18 02:29:34 +08:00
|
|
|
else
|
|
|
|
AC_MSG_ERROR(forced unwind support is required)
|
2003-04-12 08:58:26 +08:00
|
|
|
fi
|