From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30937 invoked by alias); 14 Jan 2015 12:47:09 -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 30927 invoked by uid 89); 14 Jan 2015 12:47:08 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.5 required=5.0 tests=AWL,BAYES_00,MSGID_FROM_MTA_HEADER,SPF_SOFTFAIL,T_RP_MATCHES_RCVD autolearn=no version=3.3.2 X-HELO: e38.co.us.ibm.com Received: from e38.co.us.ibm.com (HELO e38.co.us.ibm.com) (32.97.110.159) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Wed, 14 Jan 2015 12:47:07 +0000 Received: from /spool/local by e38.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 14 Jan 2015 05:47:05 -0700 Received: from d03dlp02.boulder.ibm.com (9.17.202.178) by e38.co.us.ibm.com (192.168.1.138) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 14 Jan 2015 05:47:04 -0700 Received: from b03cxnp08026.gho.boulder.ibm.com (b03cxnp08026.gho.boulder.ibm.com [9.17.130.18]) by d03dlp02.boulder.ibm.com (Postfix) with ESMTP id A427C3E4003B for ; Wed, 14 Jan 2015 05:47:03 -0700 (MST) Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by b03cxnp08026.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t0EClXLI44105772 for ; Wed, 14 Jan 2015 05:47:33 -0700 Received: from d03av02.boulder.ibm.com (localhost [127.0.0.1]) by d03av02.boulder.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t0ECl2hj032426 for ; Wed, 14 Jan 2015 05:47:02 -0700 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d03av02.boulder.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with SMTP id t0ECl0bI032240; Wed, 14 Jan 2015 05:47:00 -0700 Message-Id: <201501141247.t0ECl0bI032240@d03av02.boulder.ibm.com> Received: by tuxmaker.boeblingen.de.ibm.com (sSMTP sendmail emulation); Wed, 14 Jan 2015 13:46:59 +0100 Subject: Re: [PATCH 2/2] Detect 64-bit-ness in PowerPC Book III-E To: yao@codesourcery.com (Yao Qi) Date: Wed, 14 Jan 2015 12:47:00 -0000 From: "Ulrich Weigand" Cc: gdb-patches@sourceware.org In-Reply-To: <87egqyrs13.fsf@codesourcery.com> from "Yao Qi" at Jan 14, 2015 10:54:16 AM MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15011412-0029-0000-0000-000007321804 X-SW-Source: 2015-01/txt/msg00371.txt.bz2 Yao Qi wrote: > --- a/gdb/configure.ac > +++ b/gdb/configure.ac > @@ -1318,6 +1318,9 @@ AC_CHECK_FUNCS([getrusage getuid getgid \ > ttrace wborder wresize setlocale iconvlist libiconvlist btowc \ > setrlimit getrlimit posix_madvise waitpid \ > ptrace64 sigaltstack mkdtemp]) > +# glibc >= 2.16 provides getauxval(). > +AC_CHECK_FUNCS(getauxval) > + Any reason why this has to be a second AC_CHECK_FUNCS ? I thought we usually just add functions to the one AC_CHECK_FUNCS call ... > --- a/gdb/gdbserver/configure.ac > +++ b/gdb/gdbserver/configure.ac > @@ -91,6 +91,8 @@ AC_CHECK_HEADERS(sgtty.h termio.h termios.h sys/reg.h str= > ing.h dnl > sys/ioctl.h netinet/in.h sys/socket.h netdb.h dnl > netinet/tcp.h arpa/inet.h) > AC_CHECK_FUNCS(pread pwrite pread64) > +# glibc >= 2.16 provides getauxval(). > +AC_CHECK_FUNCS(getauxval) Likewise. > + unsigned char data[2 * 8]; > + FILE *f = fopen ("/proc/self/auxv", "r"); > + > + if (f == NULL) > + return; > + > + while (fread (data, sizeof (data), 1, f) > 0) > + { > + unsigned long *data_p = (unsigned long *) data; Hmm, this looks a violation of C aliasing rules. It would be better to declare the array as unsigned long in the first place, and cast to char for the fread call. Sorry for not noticing that in the first review. Otherwise this looks good. Thanks, Ulrich -- Dr. Ulrich Weigand GNU/Linux compilers and toolchain Ulrich.Weigand@de.ibm.com