From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1861) id 39C293858D28; Tue, 17 Jan 2023 16:19:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 39C293858D28 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1673972384; bh=3ItwANwZNAGV0yWZS+SI0lLoExUPoPDfy92+2UvesHc=; h=From:To:Subject:Date:From; b=F29CPrCp8sUVj2TMCyadZ8ZnYs041EDWe4grzyyLC8msSCZ61eiJSNWL74r6jp+HM CXvKM4Rg/IrGRcvTCu2lleHbpVzqEOrGtrdzsTUCZkOkDFozUCz1iouE9pYh6EROZk bBs+pZxx/zHfA83hYABx6bG76SQvMq+hbrcfucFg= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Jose E. Marchesi To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-5230] bpf: disable -fstack-protector in BPF X-Act-Checkin: gcc X-Git-Author: Jose E. Marchesi X-Git-Refname: refs/heads/master X-Git-Oldrev: 1fce7d29ebb47c805ad4d38b68e00f7b1178f467 X-Git-Newrev: 3b81f5c4d8e0d79cbd6927d004185707c14e54b2 Message-Id: <20230117161944.39C293858D28@sourceware.org> Date: Tue, 17 Jan 2023 16:19:44 +0000 (GMT) List-Id: https://gcc.gnu.org/g:3b81f5c4d8e0d79cbd6927d004185707c14e54b2 commit r13-5230-g3b81f5c4d8e0d79cbd6927d004185707c14e54b2 Author: Jose E. Marchesi Date: Tue Jan 17 17:16:32 2023 +0100 bpf: disable -fstack-protector in BPF 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. Regtested in bpf-unknown-none. gcc/ChangeLog: * config/bpf/bpf.cc (bpf_option_override): Disable -fstack-protector. Diff: --- gcc/config/bpf/bpf.cc | 8 ++++++++ 1 file changed, 8 insertions(+) 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 == -1) bpf_has_jmp32 = (bpf_isa >= ISA_V3); + /* 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 = 0; + } } #undef TARGET_OPTION_OVERRIDE