From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by sourceware.org (Postfix) with ESMTPS id 531063858C39 for ; Wed, 6 Jul 2022 16:00:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 531063858C39 Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 266FoqXc002027 for ; Wed, 6 Jul 2022 16:00:00 GMT Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3h5dd586ra-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 06 Jul 2022 16:00:00 +0000 Received: from m0098410.ppops.net (m0098410.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 266FqLAR006155 for ; Wed, 6 Jul 2022 16:00:00 GMT Received: from ppma02dal.us.ibm.com (a.bd.3ea9.ip4.static.sl-reverse.com [169.62.189.10]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3h5dd586qx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 06 Jul 2022 16:00:00 +0000 Received: from pps.filterd (ppma02dal.us.ibm.com [127.0.0.1]) by ppma02dal.us.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 266FoaoE029094; Wed, 6 Jul 2022 15:59:59 GMT Received: from b01cxnp22036.gho.pok.ibm.com (b01cxnp22036.gho.pok.ibm.com [9.57.198.26]) by ppma02dal.us.ibm.com with ESMTP id 3h4ugf6qyn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 06 Jul 2022 15:59:59 +0000 Received: from b01ledav003.gho.pok.ibm.com (b01ledav003.gho.pok.ibm.com [9.57.199.108]) by b01cxnp22036.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 266FxwZ28717044 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 6 Jul 2022 15:59:58 GMT Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9080DB2064; Wed, 6 Jul 2022 15:59:58 +0000 (GMT) Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E2B26B2065; Wed, 6 Jul 2022 15:59:57 +0000 (GMT) Received: from li-e362e14c-2378-11b2-a85c-87d605f3c641.ibm.com (unknown [9.211.68.56]) by b01ledav003.gho.pok.ibm.com (Postfix) with ESMTP; Wed, 6 Jul 2022 15:59:57 +0000 (GMT) Message-ID: <47d141728a0c702e96fa5ceefb3f0396ea6d67a5.camel@us.ibm.com> Subject: [PATCH version 2] Fix gdb.base/step-indirect-call-thunk.exp From: Carl Love To: Bruno Larsen , gdb-patches@sourceware.org, will schmidt , Ulrich Weigand Date: Wed, 06 Jul 2022 08:59:57 -0700 In-Reply-To: <0e0508df-0a30-8f6e-813f-e3c8c136ebae@redhat.com> References: <0e0508df-0a30-8f6e-813f-e3c8c136ebae@redhat.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 (3.28.5-18.el8) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: OS2Cvgh0S-a-ADgYeKpP8cKwdUrTXEd- X-Proofpoint-GUID: MxtysbLKjG-AptGK4U20x-XSHURZ-Tmk X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.883,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-07-06_09,2022-06-28_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 adultscore=0 phishscore=0 mlxscore=0 bulkscore=0 impostorscore=0 lowpriorityscore=0 malwarescore=0 priorityscore=1501 clxscore=1015 suspectscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2206140000 definitions=main-2207060062 X-Spam-Status: No, score=-12.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE 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: 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: , X-List-Received-Date: Wed, 06 Jul 2022 16:00:04 -0000 GDB maintainers: version 2: Updated the commit message per comments from Bruno Larsen. The gdb regression test gdb.base/step-indirect-call-thunk.exp currently does not run on X86 due to a compile error related to incompatible gcc command line argument. Secondly, the gcc command line arguments that are used are specific to Intel thus generating an unsupported command line error when compiled on other architectures. This patch fixes the command line arguments so the test will compile on X86. It also adds a check so the test will only run on X86. Please let me know if this patch is acceptable for mainline. Carl Love ------------------------------------- Fix gdb.base/step-indirect-call-thunk.exp Due to recent changes in the default value of -fcf-protection for gcc, the test gdb.base/step-indirect-call-thunk.exp fails on Intel X86-64 with the error: Executing on host: gcc -fno-stack-protector -fdiagnostics-color=never -mindirect-branch=thunk -mfunction-return=thunk -c -g -o /.../gdb/testsuite/outputs/gdb.base/step-indirect-call-thunk/step-indirect-call-thunk0.o /.../gdb/testsuite/gdb.base/step-indirect-call-thunk.c (timeout = 300) builtin_spawn -ignore SIGHUP gcc -fno-stack-protector -fdiagnostics-color=never -mindirect-branch=thunk -mfunction-return=thunk -c -g -o /.../gdb/testsuite/outputs/gdb.base/step-indirect-call-thunk/step-indirect-call-thunk0.o /.../binutils-gdb-current/gdb/testsuite/gdb.base/step-indirect-call-thunk.c /.../gdb/testsuite/gdb.base/step-indirect-call-thunk.c: In function 'inc': /.../gdb/testsuite/gdb.base/step-indirect-call-thunk.c: 22:1: error: '-mindirect-branch' and '-fcf-protection' are not compatible 22 | { /* inc.1 */ As stated in the error message the default "-fcf-protection" and "-mindirect-branch' are in compatible. The fcf-protection argument needs to be "-fcf-protection=none" for the test to compile on Intel. The gcc command line "-mindirect-branch' is an Intel specific and will give an error on other platforms. A check for X86 is added so the test will only run on X86 platforms. The patch has been tested and verified on Power 10 and Intel X86-64 systems with no regressions. --- gdb/testsuite/gdb.base/step-indirect-call-thunk.exp | 6 +++++- 1 file changed, 5 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 761e1d9a280..7c1b53c99be 100644 --- a/gdb/testsuite/gdb.base/step-indirect-call-thunk.exp +++ b/gdb/testsuite/gdb.base/step-indirect-call-thunk.exp @@ -15,7 +15,11 @@ standard_testfile -set cflags "-mindirect-branch=thunk -mfunction-return=thunk" +if { ![istarget "x86*"] } { + return +} + +set cflags "-mindirect-branch=thunk -mfunction-return=thunk -fcf-protection=none" if { [prepare_for_testing "failed to prepare" $testfile $srcfile \ [list debug "additional_flags=$cflags"]] } { return -1 -- 2.31.1