public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: Ramana Radhakrishnan <Ramana.Radhakrishnan@arm.com>
Cc: James Greenhalgh <James.Greenhalgh@arm.com>,
	       Richard Earnshaw <Richard.Earnshaw@arm.com>,
	       Marcus Shawcroft <Marcus.Shawcroft@arm.com>,
	       "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>,
	       Ard Biesheuvel <ard.biesheuvel@linaro.org>,
	       Will Deacon <Will.Deacon@arm.com>,
	Mark Rutland <Mark.Rutland@arm.com>,        nd <nd@arm.com>
Subject: Re: [RFC][AArch64] Add support for system register based stack protector canary access
Date: Sat, 19 Jan 2019 17:30:00 -0000	[thread overview]
Message-ID: <20190119173009.GA30353@tucnak> (raw)
In-Reply-To: <7a5a57fa-629d-d2ff-6292-e0893647ec8a@arm.com>

On Mon, Dec 03, 2018 at 09:55:36AM +0000, Ramana Radhakrishnan wrote:
> 2018-11-23  Ramana Radhakrishnan  <ramana.radhakrishnan@arm.com>
> 
>          * config/aarch64/aarch64-opts.h (enum stack_protector_guard): New
>          * config/aarch64/aarch64.c (aarch64_override_options_internal): 
> Handle
>          and put in error checks for stack protector guard options.
>          (aarch64_stack_protect_guard): New.
>          (TARGET_STACK_PROTECT_GUARD): Define.
>          * config/aarch64/aarch64.md (UNSPEC_SSP_SYSREG): New.
>          (reg_stack_protect_address<mode>): New.
>          (stack_protect_set): Adjust for SSP_GLOBAL.
>          (stack_protect_test): Likewise.
>          * config/aarch64/aarch64.opt (-mstack-protector-guard-reg): New.
>          (-mstack-protector-guard): Likewise.
>          (-mstack-protector-guard-offset): Likewise.
>          * doc/invoke.texi: Document new AArch64 options.

> @@ -17872,8 +17907,24 @@ aarch64_run_selftests (void)
>  
>  } // namespace selftest
>  
> +/* Implement TARGET_STACK_PROTECT_GUARD. In case of a
> +   global variable based guard use the default else
> +   return a null tree.  */
> +static tree
> +aarch64_stack_protect_guard (void)
> +{
> +  if (aarch64_stack_protector_guard == SSP_GLOBAL)
> +    return default_stack_protect_guard ();
> +
> +  return NULL_TREE;
> +}
> +
> +
>  #endif /* #if CHECKING_P */
>  
> +#undef TARGET_STACK_PROTECT_GUARD
> +#define TARGET_STACK_PROTECT_GUARD aarch64_stack_protect_guard
> +

The above change broke aarch64 --enable-checking=release bootstrap.
I've committed as obvious following change to unbreak it:

2019-01-19  Jakub Jelinek  <jakub@redhat.com>

	* config/aarch64/aarch64.c (aarch64_stack_protect_guard): Move
	outside of #if CHECKING_P code.

--- gcc/config/aarch64/aarch64.c.jj	2019-01-19 09:39:18.859831024 +0100
+++ gcc/config/aarch64/aarch64.c	2019-01-19 18:25:18.037239167 +0100
@@ -18662,6 +18662,19 @@ aarch64_simd_clone_usable (struct cgraph
     }
 }
 
+/* Implement TARGET_STACK_PROTECT_GUARD. In case of a
+   global variable based guard use the default else
+   return a null tree.  */
+static tree
+aarch64_stack_protect_guard (void)
+{
+  if (aarch64_stack_protector_guard == SSP_GLOBAL)
+    return default_stack_protect_guard ();
+
+  return NULL_TREE;
+}
+
+
 /* Target-specific selftests.  */
 
 #if CHECKING_P
@@ -18706,19 +18719,6 @@ aarch64_run_selftests (void)
 
 } // namespace selftest
 
-/* Implement TARGET_STACK_PROTECT_GUARD. In case of a
-   global variable based guard use the default else
-   return a null tree.  */
-static tree
-aarch64_stack_protect_guard (void)
-{
-  if (aarch64_stack_protector_guard == SSP_GLOBAL)
-    return default_stack_protect_guard ();
-
-  return NULL_TREE;
-}
-
-
 #endif /* #if CHECKING_P */
 
 #undef TARGET_STACK_PROTECT_GUARD


	Jakub

  parent reply	other threads:[~2019-01-19 17:30 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-03  9:55 Ramana Radhakrishnan
2018-12-03  9:59 ` Jakub Jelinek
2018-12-03 10:03   ` Ramana Radhakrishnan
2018-12-03 15:31 ` Florian Weimer
2018-12-03 16:40 ` Ard Biesheuvel
2019-01-10 16:53   ` Ramana Radhakrishnan
2019-01-10 10:53 ` Ramana Radhakrishnan
2019-01-10 11:05   ` Jakub Jelinek
2019-01-10 12:51     ` Ramana Radhakrishnan
2019-01-10 15:49 ` James Greenhalgh
2019-01-10 15:55   ` Will Deacon
2019-01-10 16:49   ` Ramana Radhakrishnan
2019-01-19 17:30 ` Jakub Jelinek [this message]
2018-12-04  3:51 Wilco Dijkstra
2018-12-04 12:58 ` Florian Weimer
2018-12-07 14:51   ` Ramana Radhakrishnan

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=20190119173009.GA30353@tucnak \
    --to=jakub@redhat.com \
    --cc=James.Greenhalgh@arm.com \
    --cc=Marcus.Shawcroft@arm.com \
    --cc=Mark.Rutland@arm.com \
    --cc=Ramana.Radhakrishnan@arm.com \
    --cc=Richard.Earnshaw@arm.com \
    --cc=Will.Deacon@arm.com \
    --cc=ard.biesheuvel@linaro.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=nd@arm.com \
    /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).