From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27173 invoked by alias); 30 Oct 2018 21:54:04 -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 27110 invoked by uid 89); 30 Oct 2018 21:54:01 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-24.9 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: smtp.polymtl.ca Received: from smtp.polymtl.ca (HELO smtp.polymtl.ca) (132.207.4.11) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 30 Oct 2018 21:53:59 +0000 Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id w9ULrrcQ023108 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 30 Oct 2018 17:53:58 -0400 Received: by simark.ca (Postfix, from userid 112) id A65C91EA80; Tue, 30 Oct 2018 17:53:53 -0400 (EDT) Received: from simark.ca (localhost [127.0.0.1]) by simark.ca (Postfix) with ESMTP id DA6101E514; Tue, 30 Oct 2018 17:53:52 -0400 (EDT) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Tue, 30 Oct 2018 21:54:00 -0000 From: Simon Marchi To: Sergio Durigan Junior Cc: GDB Patches Subject: Re: [PATCH] Fix PR gdb/23835: Don't redefine _FORTIFY_SOURCE if it's already defined In-Reply-To: <20181030214236.29081-1-sergiodj@redhat.com> References: <20181030214236.29081-1-sergiodj@redhat.com> Message-ID: <7524d20b4c0390d73fcd4225924329df@polymtl.ca> X-Sender: simon.marchi@polymtl.ca User-Agent: Roundcube Webmail/1.3.6 X-IsSubscribed: yes X-SW-Source: 2018-10/txt/msg00733.txt.bz2 On 2018-10-30 17:42, Sergio Durigan Junior wrote: > Gentoo has a local GCC patch which always defines _FORTIFY_SOURCE=2. > This causes a build problem when building GDB there, because > "common/common-defs.h" also defines _FORTIFY_SOURCE=2: > > CXX gdb.o > In file included from ../../gdb/defs.h:28:0, > from ../../gdb/gdb.c:19: > ../../gdb/common/common-defs.h:71:0: error: "_FORTIFY_SOURCE" > redefined [-Werror] > #define _FORTIFY_SOURCE 2 > > : note: this is the location of the previous definition > cc1plus: all warnings being treated as errors > make[2]: *** [Makefile:1619: gdb.o] Error 1 > > Even though it is questionable whether Gentoo's approach is the > correct one: > > https://jira.mongodb.org/browse/SERVER-29982 > https://bugs.gentoo.org/621036 > > it is still possible for GDB to be a bit more robust here and make > sure it just defines _FORTIFY_SOURCE if it hasn't been defined > already. This patch does that. > > Tested by rebuilding and making sure the macro was defined. I think it makes sense, it also gives the user the possibility to override it, if they don't like our value. Give it a few days to give others a change to respond. If you don't hear anything in ~1 week, please go ahead and push. > gdb/ChangeLog: > 2018-10-30 Sergio Durigan Junior > > PR gdb/23835 > * common/common-defs.h: Don't redefine _FORTIFY_SOURCE is it's > already defined. > --- > gdb/ChangeLog | 6 ++++++ > gdb/common/common-defs.h | 5 +++-- > 2 files changed, 9 insertions(+), 2 deletions(-) > > diff --git a/gdb/ChangeLog b/gdb/ChangeLog > index 940300f95a..239d7e16c2 100644 > --- a/gdb/ChangeLog > +++ b/gdb/ChangeLog > @@ -1,3 +1,9 @@ > +2018-10-30 Sergio Durigan Junior > + > + PR gdb/23835 > + * common/common-defs.h: Don't redefine _FORTIFY_SOURCE is it's is -> if. Simon