From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4202 invoked by alias); 30 Oct 2018 22:47:24 -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 4189 invoked by uid 89); 30 Oct 2018 22:47:23 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.8 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1424, our, hear, respond X-HELO: rock.gnat.com Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 30 Oct 2018 22:47:21 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 7F28C56062; Tue, 30 Oct 2018 18:47:19 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id jSAyFsZOQBfn; Tue, 30 Oct 2018 18:47:19 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 46ABB56002; Tue, 30 Oct 2018 18:47:19 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id 7244585959; Tue, 30 Oct 2018 15:47:17 -0700 (PDT) Date: Tue, 30 Oct 2018 22:47:00 -0000 From: Joel Brobecker To: Simon Marchi Cc: Sergio Durigan Junior , GDB Patches Subject: Re: [PATCH] Fix PR gdb/23835: Don't redefine _FORTIFY_SOURCE if it's already defined Message-ID: <20181030224717.GA4081@adacore.com> References: <20181030214236.29081-1-sergiodj@redhat.com> <7524d20b4c0390d73fcd4225924329df@polymtl.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7524d20b4c0390d73fcd4225924329df@polymtl.ca> User-Agent: Mutt/1.9.4 (2018-02-28) X-SW-Source: 2018-10/txt/msg00734.txt.bz2 > > 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. Good point about allowing the user to override it. The patch looks OK to me too. -- Joel