public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: John David Anglin <dave.anglin@bell.net>
To: GCC Patches <gcc-patches@gcc.gnu.org>
Cc: Helge Deller <deller@gmx.de>
Subject: [committed] Suppress warning from -fstack-protector on hppa
Date: Fri, 16 Dec 2022 21:54:56 +0000	[thread overview]
Message-ID: <Y5zpMNyFTOcgqqDf@mx3210.localdomain> (raw)

[-- Attachment #1: Type: text/plain, Size: 1717 bytes --]

Committed to trunk.

Dave
---

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

diff --git a/gcc/config/pa/pa.cc b/gcc/config/pa/pa.cc
index 54ab486a02d..9f43802075f 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 2a058c67c53..0ed20bf9e45 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -1214,6 +1214,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[]) {


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

                 reply	other threads:[~2022-12-16 21:55 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y5zpMNyFTOcgqqDf@mx3210.localdomain \
    --to=dave.anglin@bell.net \
    --cc=deller@gmx.de \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).