aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/bpf
diff options
context:
space:
mode:
authorJose E. Marchesi <jose.marchesi@oracle.com>2023-01-17 17:16:32 +0100
committerJose E. Marchesi <jose.marchesi@oracle.com>2023-01-17 17:16:32 +0100
commit3b81f5c4d8e0d79cbd6927d004185707c14e54b2 (patch)
treecf80fc5ed988c6d85fba906fc79c44cbd828d5e7 /gcc/config/bpf
parent1fce7d29ebb47c805ad4d38b68e00f7b1178f467 (diff)
downloadgcc-3b81f5c4d8e0d79cbd6927d004185707c14e54b2.zip
gcc-3b81f5c4d8e0d79cbd6927d004185707c14e54b2.tar.gz
gcc-3b81f5c4d8e0d79cbd6927d004185707c14e54b2.tar.bz2
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.
Diffstat (limited to 'gcc/config/bpf')
-rw-r--r--gcc/config/bpf/bpf.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/config/bpf/bpf.cc b/gcc/config/bpf/bpf.cc
index 576a1fe8..b268801 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