about summary refs log tree commit diff
path: root/sysdeps/nptl/configure.ac
diff options
context:
space:
mode:
authorRoland McGrath <roland@hack.frob.com>2014-07-03 21:46:59 -0700
committerRoland McGrath <roland@hack.frob.com>2014-07-03 21:46:59 -0700
commit78b984ae2c015997be860b0eedc880691d6620cf (patch)
treeb82690bbedc889f9634499d56464dde0ce2b1b68 /sysdeps/nptl/configure.ac
parent2d5976a58069dda271d81fdcec36de13345d77ac (diff)
downloadglibc-78b984ae2c015997be860b0eedc880691d6620cf.tar.gz
glibc-78b984ae2c015997be860b0eedc880691d6620cf.tar.xz
glibc-78b984ae2c015997be860b0eedc880691d6620cf.zip
Fix unwind.h configure check for bare environment.
Diffstat (limited to 'sysdeps/nptl/configure.ac')
-rw-r--r--sysdeps/nptl/configure.ac8
1 files changed, 7 insertions, 1 deletions
diff --git a/sysdeps/nptl/configure.ac b/sysdeps/nptl/configure.ac
index ab9d5e624a..58032155cd 100644
--- a/sysdeps/nptl/configure.ac
+++ b/sysdeps/nptl/configure.ac
@@ -14,11 +14,17 @@ 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
+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"
 AC_TRY_COMPILE([#include <unwind.h>], [
 struct _Unwind_Exception exc;
 struct _Unwind_Context *context;
 _Unwind_GetCFA (context)],
-libc_cv_forced_unwind=yes, libc_cv_forced_unwind=no)])
+libc_cv_forced_unwind=yes, libc_cv_forced_unwind=no)
+CPPFLAGS="$old_CPPFLAGS"])
 if test $libc_cv_forced_unwind = yes; then
   AC_DEFINE(HAVE_FORCED_UNWIND)
 dnl Check for C cleanup handling.