]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Suppress -fstack-protector warning on hppa.
authorJohn David Anglin <danglin@gcc.gnu.org>
Fri, 16 Dec 2022 21:44:40 +0000 (21:44 +0000)
committerJohn David Anglin <danglin@gcc.gnu.org>
Fri, 16 Dec 2022 21:44:40 +0000 (21:44 +0000)
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  <danglin@gcc.gnu.org>

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*-*-*.

gcc/config/pa/pa.cc
gcc/testsuite/lib/target-supports.exp

index 54ab486a02d6f78948e6f8514f470e8ab0631551..9f43802075fe05ccdc2549fafe7584f9eeb8330c 100644 (file)
@@ -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;
index 61026785eef92ce2359670747f75684c02d112aa..dccd1aed7c5ad6f3b55a7a1a9939df89f273feae 100644 (file)
@@ -1218,6 +1218,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 <string.h>
        int main (int argc, char *argv[]) {