On Tue, 2023-01-17 17:25:08 +0100, Jose E. Marchesi via Gcc-patches 
<gcc-patches@gcc.gnu.org> 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 == -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;
> +    }

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 'void 
bpf_option_override()':
[all 2023-01-27 16:26:25] ../../gcc/gcc/config/bpf/bpf.cc:260:51: error: 
unquoted sequence of 2 consecutive space characters in format 
[-Werror=format-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]       |               ~~                              
     
[all 2023-01-27 16:26:27] cc1plus: all warnings being treated as errors

MfG, JBG

-- 

Attachment: signature.asc
Description: PGP signature

Reply via email to