From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@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 ; 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 ) id 1fnSha-000hYF-6v; Wed, 08 Aug 2018 12:56:54 -0500 From: Tom Tromey To: Simon Marchi Cc: Tom Tromey , Steve Ellcey , gdb-patches , 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> Date: Wed, 08 Aug 2018 17:57:00 -0000 In-Reply-To: (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 X-SW-Source: 2018-08/txt/msg00174.txt.bz2 >>>>> "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])