From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11108 invoked by alias); 14 Jul 2014 08:36:48 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 11092 invoked by uid 89); 14 Jul 2014 08:36:47 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.2 X-HELO: calimero.vinschen.de Received: from aquarius.hirmke.de (HELO calimero.vinschen.de) (217.91.18.234) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 14 Jul 2014 08:36:45 +0000 Received: by calimero.vinschen.de (Postfix, from userid 500) id 5DA538E0600; Mon, 14 Jul 2014 10:36:43 +0200 (CEST) Date: Mon, 14 Jul 2014 08:52:00 -0000 From: Corinna Vinschen To: gdb-patches@sourceware.org Subject: Re: Cygwin build failure following [PATCH 3/3 v5] Demangler crash handler Message-ID: <20140714083643.GA10872@calimero.vinschen.de> Reply-To: gdb-patches@sourceware.org Mail-Followup-To: gdb-patches@sourceware.org References: <20140609152229.GA27494@blade.nx> <20140609152434.GD27494@blade.nx> <000901cf9eb5$16841da0$438c58e0$@muller@ics-cnrs.unistra.fr> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="UlVJffcvxoiEqYs2" Content-Disposition: inline In-Reply-To: <000901cf9eb5$16841da0$438c58e0$@muller@ics-cnrs.unistra.fr> User-Agent: Mutt/1.5.23 (2014-03-12) X-IsSubscribed: yes X-SW-Source: 2014-07/txt/msg00315.txt.bz2 --UlVJffcvxoiEqYs2 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-length: 1711 On Jul 13 18:11, Pierre Muller wrote: > Hi Gary, > I think your patch generates > build failure on cygwin32: >=20 > ../../../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 =3D SA_ONSTACK; > ^ > ../../../binutils-gdb/gdb/cp-support.c:1560:21: note: each undeclared > identifier is reported only once for each function it appears in > Makefile:1075: recipe for target 'cp-support.o' failed >=20 > The reason is that SA_ONSTACK > is not defined in cygwin's /usr/include/signal.h header >=20 > whereas SA_RESTART is defined in signal header, > and HAVE_SIGACTION is set in config.h >=20 >=20 > > +#if defined (HAVE_SIGACTION) && defined (SA_RESTART) > > + sa.sa_handler =3D gdb_demangle_signal_handler; > > + sigemptyset (&sa.sa_mask); > > + sa.sa_flags =3D SA_ONSTACK; > > + sigaction (SIGSEGV, &sa, &old_sa); > > +#else > > + ofunc =3D (void (*)()) signal (SIGSEGV, > > gdb_demangle_signal_handler); > > +#endif >=20 > A simple patch would probably be to add a separate check > #ifdef SA_ONSTACK > sa.sa_flags =3D SA_O?STACK; > #endif >=20 > But I honestly don't know enough about > Cygwin signal emulation to know if this is a correct fix or not. >=20 > Maybe Corinna Vinschen can comment on this? Right, Cygwin doesn't support SA_ONSTACK yet. It should be possible to add, but there are no immediate plans to do so. As for the above, wouldn't it be better to add something like #ifndef SA_ONSTACK #define SA_ONSTACK 0 #endif to some header? Corinna --=20 Corinna Vinschen Cygwin Maintainer Red Hat --UlVJffcvxoiEqYs2 Content-Type: application/pgp-signature Content-length: 819 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIbBAEBAgAGBQJTw5abAAoJEPU2Bp2uRE+g/YAP930WM4j/ZMRyxqRaIR6qTVJV Z3A1eLjH/+fjORNBTsZqPcOmvjqfG6G6Qh6X5UumgC7EzWaFxbAaXTNgzp3UxWH2 R2K9LQArYpRxaNlqXLBjWsa8WAbEBcD4PxJrTNWx2Mvc/dOf0XWS2UyMtZDKxS7s RAk14CW13R8VFjGs0mxbyfDDLDiG2ehLjtZKQDIJKJgGF077UY4ZVEhh9J6UEpis C/e8vR8EoVhByRyNuY6ej++eQv8qBNKQRB4xgTTi5AF8A/E31Otipubd2v/LMmWN jxvNe/IMaAGymPgKvnS2atz8xysE5vl8cu3Hulvc60//+zEZpIQvsbRXmFYT4z6Y QgJooFI7lC95605aLvZ3KjFZBv1WHZxzIFQdc3593DY4Da8kLWpfAZkXgdmfBolL aqeCMLuA+XCvlfkbVLYq30lmnSrANsffRXJ+CBckxieC2MNw1Dcfg8iZPxvZYrjn rHynpvQewtI8Qz/q2yQPJK3HX/+pQqmFcMUDKBzS0suZ5NJaIdEVlNPKd9FieJTS 2C2rGj6Pk3vzq4bnLo+CDRBIrH89haDNJ8yJnJ+x4j0Zn07XLdyU+LsiFOlXOy/q Ks4PAyhBA2gRzrMiE8BcMjfjQMNoMd4B7IDjaZFyVqjESGZWKfKi8VD/K444VRFD vU7vyKHQazNL/2gyu54= =ACYc -----END PGP SIGNATURE----- --UlVJffcvxoiEqYs2--