Message ID | 87sh3o91y2.fsf@tromey.com |
---|---|
State | New, archived |
Headers |
Received: (qmail 126897 invoked by alias); 8 Aug 2018 17:57:33 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: <gdb-patches.sourceware.org> List-Unsubscribe: <mailto:gdb-patches-unsubscribe-##L=##H@sourceware.org> List-Subscribe: <mailto:gdb-patches-subscribe@sourceware.org> List-Archive: <http://sourceware.org/ml/gdb-patches/> List-Post: <mailto:gdb-patches@sourceware.org> List-Help: <mailto:gdb-patches-help@sourceware.org>, <http://sourceware.org/ml/#faqs> Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 126873 invoked by uid 89); 8 Aug 2018 17:57:32 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.5 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:937 X-HELO: gateway23.websitewelcome.com Received: from gateway23.websitewelcome.com (HELO gateway23.websitewelcome.com) (192.185.50.164) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 08 Aug 2018 17:57:28 +0000 Received: from cm16.websitewelcome.com (cm16.websitewelcome.com [100.42.49.19]) by gateway23.websitewelcome.com (Postfix) with ESMTP id 873D4A248 for <gdb-patches@sourceware.org>; Wed, 8 Aug 2018 12:57:26 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id nShafnz2QaSeynShtfLv4d; Wed, 08 Aug 2018 12:57:25 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=4EZhiY2s71lU6en7Wo0In6dmjAnoVNTDipjzldV8yAI=; b=vxs3uVdNJX0jFpBuRFcs3QqzCG P99utbRTU9458qECl6t3T3CoxeicUm2V+82HSU6jAkr5ummNojGtsE3CES0zWGH/zydiX/wKVYPiS wH54xfT0Rx9G3EZgiKwLAdvb0; Received: from 75-166-85-72.hlrn.qwest.net ([75.166.85.72]:56920 helo=pokyo) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.91) (envelope-from <tom@tromey.com>) id 1fnSha-000hYF-6v; Wed, 08 Aug 2018 12:56:54 -0500 From: Tom Tromey <tom@tromey.com> To: Simon Marchi <simon.marchi@polymtl.ca> Cc: Tom Tromey <tom@tromey.com>, Steve Ellcey <sellcey@cavium.com>, gdb-patches <gdb-patches@sourceware.org>, simon.marchi@ericsson.com Subject: Re: gdb build problem (gdb/unittests/scoped_mmap-selftests.c) References: <1533742957.31481.2.camel@cavium.com> <87wot092xy.fsf@tromey.com> <a1d4ea91a4a2884a72ebf4780d1138e2@polymtl.ca> Date: Wed, 08 Aug 2018 11:56:53 -0600 In-Reply-To: <a1d4ea91a4a2884a72ebf4780d1138e2@polymtl.ca> (Simon Marchi's message of "Wed, 08 Aug 2018 13:39:18 -0400") Message-ID: <87sh3o91y2.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain |
Commit Message
Tom Tromey
Aug. 8, 2018, 5:56 p.m. UTC
>>>>> "Simon" == Simon Marchi <simon.marchi@polymtl.ca> 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
Comments
On 2018-08-08 13:56, Tom Tromey wrote: >>>>>> "Simon" == Simon Marchi <simon.marchi@polymtl.ca> 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
On 08/08/2018 06:56 PM, Tom Tromey wrote: > 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]) Do we really need to put this in config.h? Wouldn't putting it straight in common/common-defs.h work out the same? We already define __STDC_CONSTANT_MACRO etc. there before any system header. Thanks, Pedro Alves
>>>>> "Pedro" == Pedro Alves <palves@redhat.com> writes: Pedro> On 08/08/2018 06:56 PM, Tom Tromey wrote: >> 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]) Pedro> Do we really need to put this in config.h? Wouldn't putting it straight Pedro> in common/common-defs.h work out the same? We already define Pedro> __STDC_CONSTANT_MACRO etc. there before any system header. That does seems simpler, and I think it will work just as well. 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])