From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) by sourceware.org (Postfix) with ESMTP id 155713857B98 for ; Fri, 31 Mar 2023 18:38:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 155713857B98 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gentoo.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gentoo.org References: <20230221092726.420571-1-sam@gentoo.org> <0f500f68-2d7d-f777-90df-0de6688ca215@gotplt.org> User-agent: mu4e 1.8.14; emacs 29.0.60 From: Sam James To: Siddhesh Poyarekar Cc: libc-alpha@sourceware.org Subject: Re: [PATCH] stdio-common: tests: don't double-define _FORTIFY_SOURCE Date: Fri, 31 Mar 2023 19:38:29 +0100 In-reply-to: <0f500f68-2d7d-f777-90df-0de6688ca215@gotplt.org> Message-ID: <87tty0yddz.fsf@gentoo.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Status: No, score=-10.1 required=5.0 tests=BAYES_00,GIT_PATCH_0,JMQ_SPF_NEUTRAL,KAM_DMARC_STATUS,SPF_HELO_PASS,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: --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Siddhesh Poyarekar writes: > On 2023-02-21 04:27, Sam James via Libc-alpha wrote: >> Exactly the same as 35bcb08eaa953c9b8bef6ab2486dc4361e1f26c0. >> If using -D_FORITFY_SOURCE=3D3 (in my case, I've patched GCC to add >> =3D3 instead of =3D2 (we've done =3D2 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=3D2 >> 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 =3D3, >> 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= =3D3 >> (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, very kind of you & much appreciated. All set up now! \o/ > > Thanks, > Sid > best, sam >> 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 +=3D -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 +=3D -D_FORTIFY_SOURCE=3D2 >> +CFLAGS-tst-bz11319-fortify2.c +=3D -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE= =3D2 >> CFLAGS-tst-memstream-string.c +=3D -fno-builtin-fprintf >>=20=20=20 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iOUEARYKAI0WIQQlpruI3Zt2TGtVQcJzhAn1IN+RkAUCZCcouF8UgAAAAAAuAChp c3N1ZXItZnByQG5vdGF0aW9ucy5vcGVucGdwLmZpZnRoaG9yc2VtYW4ubmV0MjVB NkJCODhERDlCNzY0QzZCNTU0MUMyNzM4NDA5RjUyMERGOTE5MA8cc2FtQGdlbnRv by5vcmcACgkQc4QJ9SDfkZD0OQD9HiJW1Z2q93n8xr1lswx1RP6x4QSLIjEkggVA Vy/+NVwA+gNr/wLFz1KY7Tg40+sDl77GAjQvIgPx+24Ej28M8rME =P2lx -----END PGP SIGNATURE----- --=-=-=--