From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 81321 invoked by alias); 8 Aug 2018 22:17:49 -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 81307 invoked by uid 89); 8 Aug 2018 22:17:49 -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=Hx-languages-length:1179 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; Wed, 08 Aug 2018 22:17:45 +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 w78MHcH0023354 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 8 Aug 2018 18:17:43 -0400 Received: by simark.ca (Postfix, from userid 112) id E4FF51EF38; Wed, 8 Aug 2018 18:17:38 -0400 (EDT) Received: from simark.ca (localhost [127.0.0.1]) by simark.ca (Postfix) with ESMTP id 209C81E077; Wed, 8 Aug 2018 18:17:29 -0400 (EDT) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Wed, 08 Aug 2018 22:17:00 -0000 From: Simon Marchi To: Tom Tromey Cc: Steve Ellcey , gdb-patches , simon.marchi@ericsson.com Subject: Re: gdb build problem (gdb/unittests/scoped_mmap-selftests.c) In-Reply-To: <87sh3o91y2.fsf@tromey.com> References: <1533742957.31481.2.camel@cavium.com> <87wot092xy.fsf@tromey.com> <87sh3o91y2.fsf@tromey.com> Message-ID: <46300fe0449e77cf8470a4cc391a9e8b@polymtl.ca> X-Sender: simon.marchi@polymtl.ca User-Agent: Roundcube Webmail/1.3.6 X-IsSubscribed: yes X-SW-Source: 2018-08/txt/msg00184.txt.bz2 On 2018-08-08 13:56, Tom Tromey wrote: >>>>>> "Simon" == Simon Marchi writes: > > Simon> I think that enabling _FORTIFY_SOURCE can only do some good. > > What do you think of the appended? > The check for __OPTIMIZE__ has to be done since otherwise a glibc > header > will complain. > > Building with this patch applied (after autoheader etc) let me > reproduce > Steve's original problem. > > Tom > > diff --git a/gdb/configure.ac b/gdb/configure.ac > index 13bc5f9a8f2..76a1ba0364f 100644 > --- a/gdb/configure.ac > +++ b/gdb/configure.ac > @@ -2279,6 +2279,10 @@ dnl At the moment, we just assume it's UTF-8. > AC_DEFINE(GDB_DEFAULT_HOST_CHARSET, "UTF-8", > [Define to be a string naming the default host character > set.]) > > +AH_BOTTOM([#if defined __OPTIMIZE__ && __OPTIMIZE__ > 0 > +#define _FORTIFY_SOURCE 2 > +#endif]) > + > if $development; then > AC_DEFINE(GDB_SELF_TEST, 1, > [Define if self-testing features should be enabled]) Oh right, _FORTIFY_SOURCE requires building with optimization. That code will end up at the bottom of config.h, is that it? If so, it LGTM. Simon