From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14890 invoked by alias); 19 Jan 2019 17:30:44 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 14719 invoked by uid 89); 19 Jan 2019 17:30:25 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-11.9 required=5.0 tests=BAYES_00,GIT_PATCH_2,GIT_PATCH_3,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=36AM, 36am, aarch64opt, aarch64.opt X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 19 Jan 2019 17:30:23 +0000 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id ECA51D5520; Sat, 19 Jan 2019 17:30:13 +0000 (UTC) Received: from tucnak.zalov.cz (ovpn-116-69.ams2.redhat.com [10.36.116.69]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 70A6C600CC; Sat, 19 Jan 2019 17:30:13 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.15.2/8.15.2) with ESMTP id x0JHUAFK027730; Sat, 19 Jan 2019 18:30:11 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id x0JHU9Er027728; Sat, 19 Jan 2019 18:30:09 +0100 Date: Sat, 19 Jan 2019 17:30:00 -0000 From: Jakub Jelinek To: Ramana Radhakrishnan Cc: James Greenhalgh , Richard Earnshaw , Marcus Shawcroft , "gcc-patches@gcc.gnu.org" , Ard Biesheuvel , Will Deacon , Mark Rutland , nd Subject: Re: [RFC][AArch64] Add support for system register based stack protector canary access Message-ID: <20190119173009.GA30353@tucnak> Reply-To: Jakub Jelinek References: <7a5a57fa-629d-d2ff-6292-e0893647ec8a@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7a5a57fa-629d-d2ff-6292-e0893647ec8a@arm.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-IsSubscribed: yes X-SW-Source: 2019-01/txt/msg01128.txt.bz2 On Mon, Dec 03, 2018 at 09:55:36AM +0000, Ramana Radhakrishnan wrote: > 2018-11-23 Ramana Radhakrishnan > > * 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): 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 * 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