From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32750 invoked by alias); 29 Mar 2012 16:03:15 -0000 Received: (qmail 32739 invoked by uid 22791); 29 Mar 2012 16:03:13 -0000 X-SWARE-Spam-Status: No, hits=-2.7 required=5.0 tests=AWL,BAYES_00,KAM_MX3,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD,URIBL_BLACK X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 29 Mar 2012 16:03:01 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q2TG2b04001877 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 29 Mar 2012 12:02:37 -0400 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q2TG2ZKZ016179; Thu, 29 Mar 2012 12:02:36 -0400 Message-ID: <4F74879B.6070908@redhat.com> Date: Thu, 29 Mar 2012 16:03:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20120316 Thunderbird/11.0 MIME-Version: 1.0 To: Thiago Jung Bauermann CC: Joel Brobecker , gdb-patches ml Subject: Re: [RFA] Define Elf32_auxv_t and Elf64_auxv_t if not available. References: <1332787763.30339.10.camel@hactar> <20120327152058.GF2701@adacore.com> <1332893506.16415.4.camel@hactar> In-Reply-To: <1332893506.16415.4.camel@hactar> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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 X-SW-Source: 2012-03/txt/msg01002.txt.bz2 Hello Thiago, On 03/28/2012 01:11 AM, Thiago Jung Bauermann wrote: > On Tue, 2012-03-27 at 08:20 -0700, Joel Brobecker wrote: >>> > > 2012-03-26 Thiago Jung Bauermann >>> > > diff --git a/gdb/gdbserver/configure.ac b/gdb/gdbserver/configure.ac >>> > > index e6e9162..6b98dc0 100644 >>> > > --- a/gdb/gdbserver/configure.ac >>> > > +++ b/gdb/gdbserver/configure.ac >>> > > @@ -163,9 +163,10 @@ fi >>> > > >>> > > AC_CHECK_DECLS([strerror, perror, memmem, vasprintf, vsnprintf]) >>> > > >>> > > -AC_CHECK_TYPES(socklen_t, [], [], >>> > > +AC_CHECK_TYPES([socklen_t, Elf32_auxv_t, Elf64_auxv_t], [], [], >>> > > [#include >>> > > #include >>> > > +#include >>> > > ]) >> > >> > I wonder if we shouldn't be using two separate checks here. Seems >> > unlikely to be a problem in practice, but we're looking for for >> > a type is + , and then looking for another >> > collection of types in . We know we're most likely not going >> > to get any "cross-polination" finding socklen_t in , but if >> > this sort of thing were to happen, we would be in a situation where >> > the configure check finds the type, but the code (which presumably >> > might only include types.h and sockets.h) does not, leading to a build >> > error. > That's a good point, I didn't think of that. Like you say it's unlikely > to happen in practice but it's cleaner indeed. Separate tests is definitely the way to go, but for the reason that you'd be always breaking the socklen_t test on non-elf ports, such as the Windows port, where elf.h doesn't even exist. > 2012-03-27 Thiago Jung Bauermann > > * configure.ac: Check whether Elf32_auxv_t and Elf64_auxv_t > are available. > linux-low.c [HAVE_ELF32_AUXV_T] (Elf32_auxv_t): Add typedef. > [HAVE_ELF64_AUXV_T] (Elf64_auxv_t): Likewise. > * config.in: Regenerate. > * configure: Likewise. This version looks good to me. A "Copied from glibc's elf.h." small comment here would be good, I think. Otherwise, the "We use to have pointer elements added here" comment is misleading. :-) > +#ifndef HAVE_ELF32_AUXV_T > +typedef struct > +{ > + uint32_t a_type; /* Entry type */ > + union > + { > + uint32_t a_val; /* Integer value */ > + /* We use to have pointer elements added here. We cannot do that, > + though, since it does not work when using 32-bit definitions > + on 64-bit platforms and vice versa. */ > + } a_un; > +} Elf32_auxv_t; > +#endif > + -- Pedro Alves