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: 1716724 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4NYjZW66zWz2405 for ; Sat, 17 Dec 2022 08:55:15 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E2BC5384DDB5 for ; Fri, 16 Dec 2022 21:55:13 +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+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" 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[]) {