From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lug-owl.de (lug-owl.de [188.68.32.151]) by sourceware.org (Postfix) with ESMTPS id 9731E3858D20 for ; Sat, 28 Jan 2023 14:12:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9731E3858D20 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=lug-owl.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=lug-owl.de Received: by lug-owl.de (Postfix, from userid 1001) id 2AFAB4207B; Sat, 28 Jan 2023 15:12:55 +0100 (CET) Date: Sat, 28 Jan 2023 15:12:55 +0100 From: Jan-Benedict Glaw To: "Jose E. Marchesi" Cc: gcc-patches@gcc.gnu.org Subject: Re: [COMMITTED] bpf: disable -fstack-protector in BPF Message-ID: <20230128141255.nps3jzmcfmp2df3z@lug-owl.de> References: <20230117162508.74789-1-jose.marchesi@oracle.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="pxjecday5b4ay7rt" Content-Disposition: inline In-Reply-To: <20230117162508.74789-1-jose.marchesi@oracle.com> X-Operating-System: Linux chamaeleon 5.14.0-0.bpo.2-amd64 X-gpg-fingerprint: 250D 3BCF 7127 0D8C A444 A961 1DBD 5E75 8399 E1BB X-gpg-key: wwwkeys.de.pgp.net X-Echelon-Enable: howto poison arsenous mail psychological biological nuclear warfare test the bombastical terror of flooding the spy listeners explosion sex drugs and rock'n'roll X-TKUeV: howto poison arsenous mail psychological biological nuclear warfare test the bombastical terror of flooding the spy listeners explosion sex drugs and rock'n'roll X-message-flag: Please send plain text messages only. Do not send HTML emails. Thank you. User-Agent: NeoMutt/20170113 (1.7.2) X-Spam-Status: No, score=-9.8 required=5.0 tests=BAYES_00,GIT_PATCH_0,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: --pxjecday5b4ay7rt Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, 2023-01-17 17:25:08 +0100, Jose E. Marchesi via Gcc-patches wrote: > The stack protector is not supported in BPF. This patch disables > -fstack-protector in bpf-* targets, along with the emission of a note > indicating that the feature is not supported in this platform. [...] > diff --git a/gcc/config/bpf/bpf.cc b/gcc/config/bpf/bpf.cc > index 576a1fe8eab..b268801d00c 100644 > --- a/gcc/config/bpf/bpf.cc > +++ b/gcc/config/bpf/bpf.cc > @@ -253,6 +253,14 @@ bpf_option_override (void) > if (bpf_has_jmp32 =3D=3D -1) > bpf_has_jmp32 =3D (bpf_isa >=3D ISA_V3); > =20 > + /* Disable -fstack-protector as it is not supported in BPF. */ > + if (flag_stack_protect) > + { > + inform (input_location, > + "%<-fstack-protector%> does not work " > + " on this architecture"); > + flag_stack_protect =3D 0; > + } Building with a recent GCC with (noticed during a -Werror build), this results in a new warning: [all 2023-01-27 16:26:25] ../../gcc/gcc/config/bpf/bpf.cc: In function 'voi= d bpf_option_override()': [all 2023-01-27 16:26:25] ../../gcc/gcc/config/bpf/bpf.cc:260:51: error: un= quoted sequence of 2 consecutive space characters in format [-Werror=3Dform= at-diag] [all 2023-01-27 16:26:25] 260 | "%<-fstack-protector%> does= not work " [all 2023-01-27 16:26:25] | = ^~ [all 2023-01-27 16:26:25] 261 | " on this architecture"); [all 2023-01-27 16:26:25] | ~~ = =20 [all 2023-01-27 16:26:27] cc1plus: all warnings being treated as errors MfG, JBG --=20 --pxjecday5b4ay7rt Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABECAB0WIQQlDTvPcScNjKREqWEdvV51g5nhuwUCY9UtZAAKCRAdvV51g5nh u3OGAJsFvAGm5DwVmtw/68hf+58sc8D3FQCeO9bZmlZWGCMT3TSBTz7D1+ca990= =brWL -----END PGP SIGNATURE----- --pxjecday5b4ay7rt--