From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28357 invoked by alias); 7 Apr 2014 21:07:41 -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 28344 invoked by uid 89); 7 Apr 2014 21:07:41 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.3 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-qa0-f51.google.com Received: from mail-qa0-f51.google.com (HELO mail-qa0-f51.google.com) (209.85.216.51) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Mon, 07 Apr 2014 21:07:39 +0000 Received: by mail-qa0-f51.google.com with SMTP id j7so9438qaq.24 for ; Mon, 07 Apr 2014 14:07:37 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.224.165.139 with SMTP id i11mr6086922qay.94.1396904857597; Mon, 07 Apr 2014 14:07:37 -0700 (PDT) Received: by 10.140.30.74 with HTTP; Mon, 7 Apr 2014 14:07:37 -0700 (PDT) In-Reply-To: <21315.4246.96784.712706@ruffy.mtv.corp.google.com> References: <21315.4246.96784.712706@ruffy.mtv.corp.google.com> Date: Mon, 07 Apr 2014 21:07:00 -0000 Message-ID: Subject: Re: gdb/testsuite/compiler.c[c]: Identify clang From: David Blaikie To: Doug Evans Cc: gdb-patches@sourceware.org, Eric Christopher Content-Type: text/plain; charset=ISO-8859-1 X-IsSubscribed: yes X-SW-Source: 2014-04/txt/msg00085.txt.bz2 On Mon, Apr 7, 2014 at 1:54 PM, Doug Evans wrote: > David Blaikie writes: > > Adding support for the testsuite to correctly identify the clang > > compiler (previously it caught the generic GCC detection and was > > identified as GCC 4.2). > > > > This reduces some of the test failures when running the suite with > > Clang - for example the macro tests no longer run or fail (since > > they're only enabled for GCC). > > > > * compiler.c: identify the clang compiler > > > > (do I need a separate ChangeLog line for compiler.cc too? should the > > ChangeLog entry have the full path (gdb/testsuite/lib/compiler.c)?) > > diff --git gdb/testsuite/lib/compiler.c gdb/testsuite/lib/compiler.c > > index afa0e59..c28367b 100644 > > --- gdb/testsuite/lib/compiler.c > > +++ gdb/testsuite/lib/compiler.c > > @@ -73,3 +73,7 @@ set need_a_set [regsub -all {\.} [join {xlc __xlc__} -] - compiler_info] > > #if defined (__ARMCC_VERSION) > > set compiler_info [join {armcc __ARMCC_VERSION} -] > > #endif > > + > > +#if defined (__clang__) > > +set compiler_info [join {clang __clang_major__ __clang_minor__ __clang_patchlevel__} -] > > +#endif > > diff --git gdb/testsuite/lib/compiler.cc gdb/testsuite/lib/compiler.cc > > index ee251bc..79c68b4 100644 > > --- gdb/testsuite/lib/compiler.cc > > +++ gdb/testsuite/lib/compiler.cc > > @@ -61,3 +61,7 @@ set need_a_set [regsub -all {\.} [join {xlc __xlc__} -] - compiler_info] > > #if defined (__ARMCC_VERSION) > > set compiler_info [join {armcc __ARMCC_VERSION} -] > > #endif > > + > > +#if defined (__clang__) > > +set compiler_info [join {clang __clang_major__ __clang_minor__ __clang_patchlevel__} -] > > +#endif > > Hi. > > Here's a changelog entry to use for this particular case. > The format has lots of precise rules behind it, but Monkey-See-Monkey-Do hacking should get you most if not all of the way there. > > 2014-04-07 David Blaikie > > * lib/compiler.c: Identify the clang compiler. > * lib/compiler.cc: Ditto. > > In general, all edited files need to be mentioned (though there is debate over this for some cases, wheee....), and path names are required to be relative to the directory in which the ChangeLog lives. > There is a convention for how to submit a changelog entry involving multiple ChangeLog files, but there's no need to go into that here. Thanks Oh, and I realized I didn't actually specify, but I don't have commit access to gdb so if the patch (and suggested ChangeLog) are acceptable it'd be great if someone could commit it for me. Thanks! - David