From patchwork Fri Dec 16 21:54:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John David Anglin X-Patchwork-Id: 34100 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:e747:0:0:0:0:0 with SMTP id c7csp1216343wrn; Fri, 16 Dec 2022 13:55:35 -0800 (PST) X-Google-Smtp-Source: AMrXdXs60pnwEpe2kKZTUlwd1BUb8HLOurIPDknGa5Wbb9vSP0GRiCrSY0TYiTIGX9ek16rDMMwZ X-Received: by 2002:a17:906:390f:b0:7dd:5c07:a3ff with SMTP id f15-20020a170906390f00b007dd5c07a3ffmr4856209eje.49.1671227735339; Fri, 16 Dec 2022 13:55:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671227735; cv=none; d=google.com; s=arc-20160816; b=Fq3OUyR9q5kE2jzsAijf29+EhpTFIJ0nqGs+/SoeKK1Uz8HdZsg5xDbMVlbu7tfnkT qfsDfk5tQkG9sRt+ZHAaCRpqVHBFKnzP/vMbL+Sc/LnGQ1PKQCzpAdzIrTghxxdk98mC WvoxV2BZ/kxfAt/mvU8kGHEVPrijuM1/aOOhdy3qwnlyFpA8BVjKu6QhnaTTSmW+jOyR CVko0Qc0jNp7S+LdfPYahgI94bc66ucH/tZmRhRXKtUhvFgybVu0fuh/hd/JRMxlW9Wq QozcpxLTRytodH4DZIFrHyh5522MpshapXmhmyVx8DEWNSGhrNqyvi/S7VqGz4kVF1qc 1nsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-disposition :mime-version:message-id:subject:cc:to:from:date:dmarc-filter :delivered-to; bh=8FR0vuRsXFUj6gCT+cGjuC0oaWqx80NcPBsXBeDLVrk=; b=w1dXBv64oEro6XiYIgAEOMX2qNKIxDDgirXSgIgxYeJ9nc7fQ+2gcBoI/xySQd5bvs ye2QIXLra/oU9JpRtjbXOUWZFQB/h0doXrsfKbxagrclQCz7NhXbeqSOaSCxuQ6ltlOo 7WyTxIlrOXgnQ6kI6Ggb6vk3nlGMYp5DiMbt9xzMhLJiIakw529+zpAGlmajmbgWz21S zhQMy5Svgw+1E3V1lvX96LV0xSWY1GlDrbDUSXerbr3HoKig98rPDMPR2TCygdNaXB8d t1RmsZxd45Q7UVtraLcpw6xRrIvGF+vY+IbyvXVD6xFg5lWg2C09GXkPigOwR9q0Stb/ /CeQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id gb22-20020a170907961600b007c4f75345e2si1223294ejc.431.2022.12.16.13.55.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Dec 2022 13:55:35 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id BF161384D6C0 for ; Fri, 16 Dec 2022 21:55:26 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from dellerweb.de (unknown [IPv6:2a02:c207:3003:236::1]) by sourceware.org (Postfix) with ESMTPS id 02F9B3858C30 for ; Fri, 16 Dec 2022 21:55:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 02F9B3858C30 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=bell.net Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=bell.net Received: from mx3210.localdomain (bras-base-otwaon0925w-grc-05-174-95-50-166.dsl.bell.ca [174.95.50.166]) by dellerweb.de (Postfix) with ESMTPSA id 46AE31600210; Fri, 16 Dec 2022 22:54:59 +0100 (CET) Received: by mx3210.localdomain (Postfix, from userid 1000) id 06BD7220133; Fri, 16 Dec 2022 21:54:56 +0000 (UTC) Date: Fri, 16 Dec 2022 21:54:56 +0000 From: John David Anglin To: GCC Patches Cc: Helge Deller Subject: [committed] Suppress warning from -fstack-protector on hppa Message-ID: MIME-Version: 1.0 Content-Disposition: inline X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, KHOP_HELO_FCRDNS, SPF_HELO_NONE, SPF_SOFTFAIL, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1752409293739515982?= X-GMAIL-MSGID: =?utf-8?q?1752409293739515982?= 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 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 int main (int argc, char *argv[]) {