From: John David Anglin Date: Fri, 16 Dec 2022 21:44:40 +0000 (+0000) Subject: Suppress -fstack-protector warning on hppa. X-Git-Tag: release-12.2.mpacbti-rel1~29 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=abaa8f9cc4c06dcdae13a33be9253762861d8657;p=thirdparty%2Fgcc.git Suppress -fstack-protector warning on hppa. Some package builds enable -fstack-protector and -Werror. Since -fstack-protector is not supported on hppa because the stack grows up, these packages must check for the warning generated by -fstack-protector and suppress it on hppa. This is problematic since hppa is the only significant architecture where the stack grows up. 2022-12-16 John David Anglin gcc/ChangeLog: * config/pa/pa.cc (pa_option_override): Disable -fstack-protector. gcc/testsuite/ChangeLog: * lib/target-supports.exp (check_effective_target_static): Return 0 on hppa*-*-*. --- diff --git a/gcc/config/pa/pa.cc b/gcc/config/pa/pa.cc index 54ab486a02d6..9f43802075fe 100644 --- a/gcc/config/pa/pa.cc +++ b/gcc/config/pa/pa.cc @@ -567,6 +567,9 @@ pa_option_override (void) flag_reorder_blocks = 1; } + /* Disable -fstack-protector to suppress warning. */ + flag_stack_protect = 0; + /* We can't guarantee that .dword is available for 32-bit targets. */ if (UNITS_PER_WORD == 4) targetm.asm_out.aligned_op.di = NULL; diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index 3a4f65b9be69..c858bd93b8e6 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -1159,6 +1159,9 @@ proc check_effective_target_static {} { # Return 1 if the target supports -fstack-protector proc check_effective_target_fstack_protector {} { + if { [istarget hppa*-*-*] } { + return 0; + } return [check_runtime fstack_protector { #include int main (int argc, char *argv[]) {