From patchwork Fri Jul 4 04:49:59 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roland McGrath X-Patchwork-Id: 1917 Received: (qmail 19248 invoked by alias); 4 Jul 2014 04:50:05 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 19224 invoked by uid 89); 4 Jul 2014 04:50:03 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL, BAYES_00 autolearn=ham version=3.3.2 X-HELO: topped-with-meat.com MIME-Version: 1.0 From: Roland McGrath To: "GNU C. Library" Subject: [COMMITTED PATCH] Fix unwind.h configure check for bare environment. Message-Id: <20140704044959.3B2902C3988@topped-with-meat.com> Date: Thu, 3 Jul 2014 21:49:59 -0700 (PDT) X-CMAE-Score: 0 X-CMAE-Analysis: v=2.1 cv=SvUDtp+0 c=1 sm=1 tr=0 a=WkljmVdYkabdwxfqvArNOQ==:117 a=14OXPxybAAAA:8 a=SZ41oCKSMZUA:10 a=Z6MIti7PxpgA:10 a=kj9zAlcOel0A:10 a=hOe2yjtxAAAA:8 a=qOgWMs1CSt2iL0_JUqEA:9 a=CjuIK1q_8ugA:10 With this, Fedora's ia64-linux-gnu-gcc is sufficient to build libc with nothing but kernel headers in the sysroot. Thanks, Roland * sysdeps/nptl/configure.ac (libc_cv_forced_unwind): Use -Dinhibit_libc=1 for unwind.h check to prevent false failure in a bare environment with no installed. * sysdeps/nptl/configure: Regenerated. --- a/sysdeps/nptl/configure +++ b/sysdeps/nptl/configure @@ -15,7 +15,12 @@ $as_echo_n "checking for forced unwind support... " >&6; } if ${libc_cv_forced_unwind+:} false; then : $as_echo_n "(cached) " >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + old_CPPFLAGS="$CPPFLAGS" +# Without inhibit_libc #define'd, GCC's unwind.h (at least for ia64) +# will try to include , which doesn't exist yet if we're +# building libc in a bare environment. +CPPFLAGS="$CPPFLAGS -Dinhibit_libc=1" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int @@ -35,6 +40,7 @@ else libc_cv_forced_unwind=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +CPPFLAGS="$old_CPPFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_forced_unwind" >&5 $as_echo "$libc_cv_forced_unwind" >&6; } --- a/sysdeps/nptl/configure.ac +++ b/sysdeps/nptl/configure.ac @@ -14,11 +14,17 @@ dnl Iff 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 , which doesn't exist yet if we're +# building libc in a bare environment. +CPPFLAGS="$CPPFLAGS -Dinhibit_libc=1" AC_TRY_COMPILE([#include ], [ 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.