From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from olivedrab.birch.relay.mailchannels.net (olivedrab.birch.relay.mailchannels.net [23.83.209.135]) by sourceware.org (Postfix) with ESMTPS id 0A0543857820 for ; Fri, 11 Dec 2020 01:36:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 0A0543857820 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 A0C8D181B56; Fri, 11 Dec 2020 01:36:14 +0000 (UTC) Received: from pdx1-sub0-mail-a28.g.dreamhost.com (100-96-27-97.trex.outbound.svc.cluster.local [100.96.27.97]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 37BEF182625; Fri, 11 Dec 2020 01:36:13 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|siddhesh@gotplt.org Received: from pdx1-sub0-mail-a28.g.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.18.11); Fri, 11 Dec 2020 01:36:14 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|siddhesh@gotplt.org X-MailChannels-Auth-Id: dreamhost X-Society-Whimsical: 14018fd374f912a3_1607650573495_3287024671 X-MC-Loop-Signature: 1607650573495:3539237681 X-MC-Ingress-Time: 1607650573494 Received: from pdx1-sub0-mail-a28.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a28.g.dreamhost.com (Postfix) with ESMTP id C560D7E6BD; Thu, 10 Dec 2020 17:36:12 -0800 (PST) Received: from [192.168.1.111] (unknown [1.186.101.110]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: siddhesh@gotplt.org) by pdx1-sub0-mail-a28.g.dreamhost.com (Postfix) with ESMTPSA id 5EA0A7F125; Thu, 10 Dec 2020 17:36:09 -0800 (PST) Subject: Re: [PATCH 1/2] string: _FORTIFY_SOURCE=3 using __builtin_dynamic_object_size To: Paul Eggert , libc-alpha@sourceware.org Cc: jakub@redhat.com, fweimer@redhat.com References: <20201210181327.1577769-1-siddhesh@sourceware.org> <20201210181327.1577769-2-siddhesh@sourceware.org> <11032ad8-821f-541a-4622-680b7c604458@cs.ucla.edu> X-DH-BACKEND: pdx1-sub0-mail-a28 From: Siddhesh Poyarekar Message-ID: <08a25ebb-08df-8001-5582-bfcd64bb1036@sourceware.org> Date: Fri, 11 Dec 2020 07:06:05 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.5.0 MIME-Version: 1.0 In-Reply-To: <11032ad8-821f-541a-4622-680b7c604458@cs.ucla.edu> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=1.7 required=5.0 tests=BAYES_00, JMQ_SPF_NEUTRAL, KAM_DMARC_NONE, KAM_DMARC_STATUS, NICE_REPLY_A, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NEUTRAL, TXREP autolearn=no autolearn_force=no version=3.4.2 X-Spam-Level: * X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2020 01:36:17 -0000 On 12/11/20 12:40 AM, Paul Eggert wrote: > On 12/10/20 10:13 AM, Siddhesh Poyarekar via Libc-alpha wrote: >=20 >> +checks are applied. If defined to @math{3}, @theglibc{} attempts to u= se >> +compiler-specific checks that may be more computationally expensive. >=20 > Please change "attempts to use compiler-specific checks" to "may also=20 > use checks". The documentation need not mention compilers here, and the= =20 > "also" documents that 3 subsumes 2. Thanks, I'll fix this. >> =C2=A0# elif !__GNUC_PREREQ (4, 1) >> =C2=A0#=C2=A0 warning _FORTIFY_SOURCE requires GCC 4.1 or later >> -# elif _FORTIFY_SOURCE > 1 >> -#=C2=A0 define __USE_FORTIFY_LEVEL 2 >> +# elif _FORTIFY_SOURCE > 2 >> +#=C2=A0 define __USE_FORTIFY_LEVEL 3 >> =C2=A0# else >> -#=C2=A0 define __USE_FORTIFY_LEVEL 1 >> +#=C2=A0 define __USE_FORTIFY_LEVEL _FORTIFY_SOURCE >> =C2=A0# endif >=20 > The existing code warns if you define _FORTIFY_SOURCE on a platform tha= t=20 > doesn't support _FORTIFY_SOURCE. Shouldn't the revised code warn if you= =20 > define _FORTIFY_SOURCE to 3 on a platform that doesn't support that?=20 > Otherwise people may be lulled into the belief that -D_FORTIFY_SOURCE=3D= 3=20 > means something even on platforms where it doesn't. Thanks, that's a good idea, I'll add a check. I suppose I ought to=20 document in the NEWS too that _FORTIFY_SOURCE=3D3 at present only adds=20 additional checks with llvm 9 and later and that gcc-10.2 does not have=20 the needed support? Thanks, Siddhesh