From patchwork Fri Oct 26 14:15:02 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jack Howarth X-Patchwork-Id: 194489 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 93A802C0080 for ; Sat, 27 Oct 2012 01:15:19 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1351865719; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition:User-Agent:Mailing-List:Precedence:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:Sender: Delivered-To; bh=HkSEkSRUMqqZfIKv/LMgLRlbySw=; b=UHoXxVgZQN6KHaR dy/kmpbwxxyzDpJuqf8aVNy2W4hkkNMJBO0MzkvlQraSaHrrdgjWkJgJnht9I1Yt U3tBetsdOZJbemlAWQJ9QxP1jMw7CcvP9j5CGZqs0U23NrgWfrJF+ZYcQhX5Lkuc 0SLlJcDfOW9NEUSKjOZmoLxk03Xs= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type:Content-Disposition:User-Agent:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=t/vHjkmCsMkC2WHW6h822WsW3KQe8ZH3iOQJzffkQhB2h38iJZzuLZoBC4Mjqo 6a4st2m7tx34W8tg+oJkWepmE8jVXbKfjdSGqyVCY6OQmMmXsor9xKl/I2H982wO 8GkQvZ0gRdVUpMX4lc9t2c1opv3rH98vPoY73AhF3ws2o=; Received: (qmail 8422 invoked by alias); 26 Oct 2012 14:15:13 -0000 Received: (qmail 8400 invoked by uid 22791); 26 Oct 2012 14:15:10 -0000 X-SWARE-Spam-Status: No, hits=-2.2 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from bromo.med.uc.edu (HELO bromo.med.uc.edu) (129.137.3.146) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 26 Oct 2012 14:15:03 +0000 Received: from bromo.med.uc.edu (localhost.localdomain [127.0.0.1]) by bromo.med.uc.edu (Postfix) with ESMTP id E9564B005C; Fri, 26 Oct 2012 10:15:02 -0400 (EDT) Received: (from howarth@localhost) by bromo.med.uc.edu (8.14.3/8.14.3/Submit) id q9QEF2pj010487; Fri, 26 Oct 2012 10:15:02 -0400 Date: Fri, 26 Oct 2012 10:15:02 -0400 From: Jack Howarth To: gcc-patches@gcc.gnu.org Cc: ian@airs.com, mikestump@comcast.net, iain@codesourcery.com Subject: [PATCH][Revised] Fix target/PR55061 Message-ID: <20121026141502.GA10485@bromo.med.uc.edu> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Currently gcc trunk fails to bootstrap on powerpc-apple-darwin9, using the default system compiler, in libbacktrace due to the absence of _Unwind_GetIPInfo() in the unwind.h header of Apple gcc 4.0.1 compiler. The attached patch eliminates this failure by enhancing the configure.ac test for the _Unwind_GetIPInfo() function to also test for its function declaration using -Werror-implicit-function-declaration. This change allows HAVE_GETIPINFO to remain properly undefined in stage 1 when using the gcc 4.0.1 compiler but not in later stages with the built compiler. It also properly leaves HAVE_GETIPINFO undefined when using the clang compiler from Xcode 4.2 which lacks an unwind.h header but defines it for clang from Xcode 4.5.1 which does. Also tested on x86_64 Fedora 15 without regression in detection of _Unwind_GetIPInfo(). Rewritten to use AC_MSG_CHECKING, AC_COMPILE_IFELSE, AC_LANG_PROGRAM and AC_MSG_RESULT instead of AC_TRY_COMPILE(). Okay for gcc trunk? Jack libbacktrace/ 2012-10-26 Jack Howarth target/PR55061 * configure.ac: Check for _Unwind_GetIPInfo function declaration. * configure: Regenerate. Index: libbacktrace/configure.ac =================================================================== --- libbacktrace/configure.ac (revision 192845) +++ libbacktrace/configure.ac (working copy) @@ -129,8 +129,18 @@ AC_SUBST(WARN_FLAGS) if test -n "${with_target_subdir}"; then GCC_CHECK_UNWIND_GETIPINFO else - AC_CHECK_FUNC(_Unwind_GetIPInfo, [have_unwind_getipinfo=yes], - [have_unwind_getipinfo=no]) + ac_save_CFFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -Werror-implicit-function-declaration" + AC_MSG_CHECKING([for _Unwind_GetIPInfo]) + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [#include "unwind.h" + struct _Unwind_Context *context; + int ip_before_insn = 0;], + [return _Unwind_GetIPInfo (context, &ip_before_insn);])], + [have_unwind_getipinfo=yes], [have_unwind_getipinfo=no]) + CFLAGS="$ac_save_CFLAGS" + AC_MSG_RESULT([$have_unwind_getipinfo]) if test "$have_unwind_getipinfo" = "yes"; then AC_DEFINE(HAVE_GETIPINFO, 1, [Define if _Unwind_GetIPInfo is available.]) fi