From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id zslLAC3e1GLYUhUAWB0awg (envelope-from ) for ; Mon, 18 Jul 2022 00:14:37 -0400 Received: by simark.ca (Postfix, from userid 112) id E6C861E5EA; Mon, 18 Jul 2022 00:14:36 -0400 (EDT) Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=giZJCUMh; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_DYNAMIC,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 920BF1E222 for ; Mon, 18 Jul 2022 00:14:36 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id F3BBC3857830 for ; Mon, 18 Jul 2022 04:14:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F3BBC3857830 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1658117675; bh=bHgDCzWrPeTgqQbCIFuv1B6BUtDc0T/GaIu+c+bCKeA=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=giZJCUMh+DQn93BxtuAP1UEjvk7ejTtxwochjuE8PFg7+f8uAQzLxKVX6Eh3l/qgr I+KxPdEujG0yAImu1wlD+AwxMQtKsHjaw/E2Gebxo3A7LbRuCm8yUysrN1cwLJXqaf z8glsVPq+O/uj2GtP/ud12hmIEtcc2H/smv/DGUM= Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id 86AB33858CDA for ; Mon, 18 Jul 2022 04:14:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 86AB33858CDA Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 98BFB20775 for ; Mon, 18 Jul 2022 04:14:13 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 7853813754 for ; Mon, 18 Jul 2022 04:14:13 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id hPIZHBXe1GKjMwAAMHmgww (envelope-from ) for ; Mon, 18 Jul 2022 04:14:13 +0000 Date: Mon, 18 Jul 2022 06:14:12 +0200 To: gdb-patches@sourceware.org Subject: [committed][gdb/testsuite] Fix regression in step-indirect-call-thunk.exp with gcc 7 Message-ID: <20220718041410.GA17252@delia.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Tom de Vries via Gdb-patches Reply-To: Tom de Vries Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" Hi, Since commit 43127ae5714 ("Fix gdb.base/step-indirect-call-thunk.exp") I run into: ... gdb compile failed, gcc: error: unrecognized command line option \ '-fcf-protection=none'; did you mean '-flto-partition=none'? UNTESTED: gdb.base/step-indirect-call-thunk.exp: failed to prepare ... The problem is that -fcf-protection is supported starting gcc 8, but I'm using system gcc 7.5.0. Fix this by only adding -fcf-protection=none for gcc 8 and later. Tested on x86_64-linux, with gcc 7.5.0, 8.2.1 and 12.1.1. Committed to trunk. Thanks, - Tom [gdb/testsuite] Fix regression in step-indirect-call-thunk.exp with gcc 7 --- gdb/testsuite/gdb.base/step-indirect-call-thunk.exp | 6 +++++- gdb/testsuite/lib/gdb.exp | 11 +++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/gdb/testsuite/gdb.base/step-indirect-call-thunk.exp b/gdb/testsuite/gdb.base/step-indirect-call-thunk.exp index 7c1b53c99be..c4f69adc9b2 100644 --- a/gdb/testsuite/gdb.base/step-indirect-call-thunk.exp +++ b/gdb/testsuite/gdb.base/step-indirect-call-thunk.exp @@ -19,7 +19,11 @@ if { ![istarget "x86*"] } { return } -set cflags "-mindirect-branch=thunk -mfunction-return=thunk -fcf-protection=none" +set cflags "-mindirect-branch=thunk -mfunction-return=thunk" + +if { [gcc_major_version] >= 8 } { + append cflags " -fcf-protection=none" +} if { [prepare_for_testing "failed to prepare" $testfile $srcfile \ [list debug "additional_flags=$cflags"]] } { return -1 diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index 698dd14504e..5d6f1266b0f 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -8529,6 +8529,17 @@ gdb_caching_proc supports_gnuc { return [gdb_simple_compile $me $src object ""] } +# Return 1 if compiler supports __GNUC__, otherwise return 0. +gdb_caching_proc supports_gnuc { + set me "supports_gnuc" + set src { + #ifndef __GNUC__ + #error "No gnuc" + #endif + } + return [gdb_simple_compile $me $src object ""] +} + # Return 1 if target supports mpx, otherwise return 0. gdb_caching_proc have_mpx { global srcdir