From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from caracal.birch.relay.mailchannels.net (caracal.birch.relay.mailchannels.net [23.83.209.30]) by sourceware.org (Postfix) with ESMTPS id EF5493858D39 for ; Mon, 27 Mar 2023 13:11:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org EF5493858D39 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=gotplt.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gotplt.org X-Sender-Id: dreamhost|x-authsender|siddhesh@gotplt.org Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id E0B01920E2F; Mon, 27 Mar 2023 13:11:55 +0000 (UTC) Received: from pdx1-sub0-mail-a307.dreamhost.com (unknown [127.0.0.6]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 7E168921B33; Mon, 27 Mar 2023 13:11:55 +0000 (UTC) ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1679922715; a=rsa-sha256; cv=none; b=vXetL1znbLbdNu7Gmk41dBiuAQaOAqO5tshYvi0mt8KpE3Gf9/zVrCUjFmRZzZ3nEw/Erd uEeySfzYrPI/TNhgD4YSfHYm/O0XnBbH1tw7uRCBoxEPTQw2Ccz8/L/Ay+euUIWnz+qoXF sjz26MIW0bOd5xvf262XfRmLR0tT0j2gaRdlS9b9NYPva2TNkdFQv+Rfhf9p56EyJMAyLa z4F+scJOh8s5x7WsY0XIZXKrmS/5r0xk9x8Br/5Jd3iPbikK4pDOX0OrA+/C+R6Bl4Br5I 2Nbk4OAadAJCanJ2En8KzWxMcbPeK/wMVMUhwr28y2F6lIeuWY8MZPeXnwJnWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=mailchannels.net; s=arc-2022; t=1679922715; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=WNMyLeRNRB0cPvyUPWIrSqfX+XKBFvXlKrxUNuGkOdU=; b=SNsjPmjaSG8u1iqiYBTsTMC9VZEAG9eUMWDL0wYpPg94QMa91OaHHILAZmiav5Yx8fI6OT oqw1dswq5k3c8sy8A2S+OtO5cSlva5fTRCBwRuyA3CvfSMc7mKPyPKfsRxTznlmTP6A+k2 ifhFiqHYnRBmNTHveI0jlO2Iyrx+liXHhwERXt6rPvEk1lxt1H+ThnPOSlX9AY2nN4KNpO vEbMVQdU9St7/HVI13wiCSlwQPzyDQ21SivtZHR9WxXv2zSUjV5481OzvcJ60Q8YkB5ul8 U7rzvSdX+Wy+ESmZ43JOxIoGEE/PuWsizidFWtyiEY4hP27r9miLhwgK1sojIQ== ARC-Authentication-Results: i=1; rspamd-646fc45f85-6wx98; auth=pass smtp.auth=dreamhost smtp.mailfrom=siddhesh@gotplt.org X-Sender-Id: dreamhost|x-authsender|siddhesh@gotplt.org X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|siddhesh@gotplt.org X-MailChannels-Auth-Id: dreamhost X-Abortive-Whistle: 67f1f1f32d8798b6_1679922715739_429821400 X-MC-Loop-Signature: 1679922715739:1638912873 X-MC-Ingress-Time: 1679922715738 Received: from pdx1-sub0-mail-a307.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384) by 100.125.42.137 (trex/6.7.2); Mon, 27 Mar 2023 13:11:55 +0000 Received: from [192.168.0.182] (bras-vprn-toroon4834w-lp130-09-174-91-45-153.dsl.bell.ca [174.91.45.153]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: siddhesh@gotplt.org) by pdx1-sub0-mail-a307.dreamhost.com (Postfix) with ESMTPSA id 4PlYB31HpFzLC; Mon, 27 Mar 2023 06:11:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gotplt.org; s=dreamhost; t=1679922715; bh=WNMyLeRNRB0cPvyUPWIrSqfX+XKBFvXlKrxUNuGkOdU=; h=Date:Subject:To:From:Content-Type:Content-Transfer-Encoding; b=kcn7yU5N25vn0JKHkTDO1TGC3I/REe5tSHiTqfXZ1MHsB9AGMJpcFvNGU2xbiygyW TZ8Gaue2Hm9m5VdL0Z000Z7IY6DY1Xo4GwubGUVyGp0eMAtSzY48QM+omFZpwDufCA s9cPZeDkYhcDNUrYlgAkItXtd//N5pngF3BNtG8cpUNe2pogijQtN12hZ2kUtGIYxl TbYzKfiZrl/sLaEnYU0qxyBiCrsXia85OtV/gyVMm5of5b73E4pTRGWXmRSEnNT+4F kBx6i2Mrbwdt7z4lriMPx8VQg7afR4klX2JMXk/b/PNxeK8JqTTkPnHs4ai/HX9Kiy P9R48E/r4863g== Message-ID: <0f500f68-2d7d-f777-90df-0de6688ca215@gotplt.org> Date: Mon, 27 Mar 2023 09:11:54 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Subject: Re: [PATCH] stdio-common: tests: don't double-define _FORTIFY_SOURCE Content-Language: en-US To: Sam James , libc-alpha@sourceware.org References: <20230221092726.420571-1-sam@gentoo.org> From: Siddhesh Poyarekar In-Reply-To: <20230221092726.420571-1-sam@gentoo.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3036.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,NICE_REPLY_A,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 2023-02-21 04:27, Sam James via Libc-alpha wrote: > Exactly the same as 35bcb08eaa953c9b8bef6ab2486dc4361e1f26c0. > > If using -D_FORITFY_SOURCE=3 (in my case, I've patched GCC to add > =3 instead of =2 (we've done =2 for years in Gentoo)), building > glibc tests will fail on tst-bz11319-fortify2 like: > ``` > : error: "_FORTIFY_SOURCE" redefined [-Werror] > : note: this is the location of the previous definition > cc1: all warnings being treated as errors > ``` > > It's just because we're always setting -D_FORTIFY_SOURCE=2 > rather than unsetting it first. If F_S is already 2, it's harmless, > but if it's another value (say, 1, or 3), the compiler will bawk. > > (I'm not aware of a reason this couldn't be tested with =3, > but the toolchain support is limited for that (too new), and we want > to run the tests everywhere possible.) > > As Siddhesh noted previously, we could implement some fallback > logic to determine the maximal F_S value supported by the toolchain, > which is a bit easier now that autoconf-archive has been updated for F_S=3 > (https://github.com/autoconf-archive/autoconf-archive/pull/269), but let's > revisit this if it continues to crop up. > > Signed-off-by: Sam James > --- > stdio-common/Makefile | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Reviewed-by: Siddhesh Poyarekar Sam, if you're going to post patches regularly enough, please consider asking for write access. You could add me as a sponsor. https://sourceware.org/cgi-bin/pdw/ps_form.cgi Thanks, Sid > > diff --git a/stdio-common/Makefile b/stdio-common/Makefile > index 92a3499a94..abb398fdb7 100644 > --- a/stdio-common/Makefile > +++ b/stdio-common/Makefile > @@ -436,7 +436,7 @@ CFLAGS-tst-gets.c += -Wno-deprecated-declarations > > # BZ #11319 was first fixed for regular vdprintf, then reopened because > # the fortified version had the same bug. > -CFLAGS-tst-bz11319-fortify2.c += -D_FORTIFY_SOURCE=2 > +CFLAGS-tst-bz11319-fortify2.c += -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 > > CFLAGS-tst-memstream-string.c += -fno-builtin-fprintf >