From patchwork Mon Jul 14 08:51:54 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gary Benson X-Patchwork-Id: 2047 Received: (qmail 24687 invoked by alias); 14 Jul 2014 08:52:09 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 24656 invoked by uid 89); 14 Jul 2014 08:52:09 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Mon, 14 Jul 2014 08:52:08 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s6E8pvIj015140 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 14 Jul 2014 04:51:57 -0400 Received: from blade.nx (ovpn-116-93.ams2.redhat.com [10.36.116.93]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s6E8pt0n026629; Mon, 14 Jul 2014 04:51:55 -0400 Received: by blade.nx (Postfix, from userid 1000) id B74E02640C7; Mon, 14 Jul 2014 09:51:54 +0100 (BST) Date: Mon, 14 Jul 2014 09:51:54 +0100 From: Gary Benson To: Pierre Muller Cc: gdb-patches@sourceware.org, "'Andrew Burgess'" , "'Doug Evans'" , "'Eli Zaretskii'" , "'Florian Weimer'" , "'Mark Kettenis'" , "'Pedro Alves'" , "'Tom Tromey'" , "'Corinna Vinschen'" Subject: Re: Cygwin build failure following [PATCH 3/3 v5] Demangler crash handler Message-ID: <20140714085154.GA27730@blade.nx> References: <20140609152229.GA27494@blade.nx> <20140609152434.GD27494@blade.nx> <000901cf9eb5$16841da0$438c58e0$@muller@ics-cnrs.unistra.fr> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <000901cf9eb5$16841da0$438c58e0$@muller@ics-cnrs.unistra.fr> X-IsSubscribed: yes Hi Pierre, Pierre Muller wrote: > I think your patch generates build failure on cygwin32: > > ../../../binutils-gdb/gdb/cp-support.c: In function 'gdb_demangle': > ../../../binutils-gdb/gdb/cp-support.c:1560:21: erreur: 'SA_ONSTACK' > undeclared (first use in this function) > sa.sa_flags = SA_ONSTACK; > ^ [snip] > > The reason is that SA_ONSTACK is not defined in cygwin's > /usr/include/signal.h header whereas SA_RESTART is defined > in signal header, and HAVE_SIGACTION is set in config.h > [snip] > > A simple patch would probably be to add a separate check > #ifdef SA_ONSTACK > sa.sa_flags = SA_ONSTACK; > #endif > > But I honestly don't know enough about Cygwin signal emulation to > know if this is a correct fix or not. Maybe Corinna Vinschen can > comment on this? I don't know Cygwin, but I had a quick look and indeed, it doesn't seem to support this functionality. Could you try the patch inlined below and let me know if it fixes the build? Thanks, Gary diff --git a/gdb/cp-support.c b/gdb/cp-support.c index a8ea6fc..6a09b46 100644 --- a/gdb/cp-support.c +++ b/gdb/cp-support.c @@ -1557,7 +1557,9 @@ gdb_demangle (const char *name, int options) #if defined (HAVE_SIGACTION) && defined (SA_RESTART) sa.sa_handler = gdb_demangle_signal_handler; sigemptyset (&sa.sa_mask); +#ifdef HAVE_SIGALTSTACK sa.sa_flags = SA_ONSTACK; +#endif sigaction (SIGSEGV, &sa, &old_sa); #else ofunc = (void (*)()) signal (SIGSEGV, gdb_demangle_signal_handler);