From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by sourceware.org (Postfix) with ESMTPS id CBC363858C39 for ; Wed, 6 Jul 2022 15:57:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org CBC363858C39 Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 266FkwsE002139 for ; Wed, 6 Jul 2022 15:57:30 GMT Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com (PPS) with ESMTPS id 3h5db508c3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 06 Jul 2022 15:57:30 +0000 Received: from m0098416.ppops.net (m0098416.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 266Fmxdw011365 for ; Wed, 6 Jul 2022 15:57:29 GMT Received: from ppma02dal.us.ibm.com (a.bd.3ea9.ip4.static.sl-reverse.com [169.62.189.10]) by mx0b-001b2d01.pphosted.com (PPS) with ESMTPS id 3h5db508bq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 06 Jul 2022 15:57:29 +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 266FoaPC029073; Wed, 6 Jul 2022 15:57:29 GMT Received: from b03cxnp07028.gho.boulder.ibm.com (b03cxnp07028.gho.boulder.ibm.com [9.17.130.15]) by ppma02dal.us.ibm.com with ESMTP id 3h4ugf6qhc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 06 Jul 2022 15:57:29 +0000 Received: from b03ledav006.gho.boulder.ibm.com (b03ledav006.gho.boulder.ibm.com [9.17.130.237]) by b03cxnp07028.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 266FvRtJ35127578 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 6 Jul 2022 15:57:27 GMT Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id CB39BC6057; Wed, 6 Jul 2022 15:57:27 +0000 (GMT) Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7EB9BC6055; Wed, 6 Jul 2022 15:57:27 +0000 (GMT) Received: from li-e362e14c-2378-11b2-a85c-87d605f3c641.ibm.com (unknown [9.211.68.56]) by b03ledav006.gho.boulder.ibm.com (Postfix) with ESMTP; Wed, 6 Jul 2022 15:57:27 +0000 (GMT) Message-ID: <6ea9eab4fb30ee3768e359d2d1ff3b1932dc8ae0.camel@us.ibm.com> Subject: Re: [PATCH] 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:57:27 -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: ZecK7SfBqzustTKcE9rkqsg7hXUl3Zkj X-Proofpoint-GUID: CgZf4hv0HkcUbIyLTFe4A8NCnysQ8KpB 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 malwarescore=0 mlxlogscore=999 adultscore=0 phishscore=0 priorityscore=1501 suspectscore=0 lowpriorityscore=0 mlxscore=0 impostorscore=0 clxscore=1015 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2206140000 definitions=main-2207060062 X-Spam-Status: No, score=-12.0 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 15:57:32 -0000 Bruno: Thanks for the feedback. I updated the commit message and will send out version 2 of the patch. Carl Love On Fri, 2022-07-01 at 09:37 -0300, Bruno Larsen wrote: > On 6/15/22 13:21, Carl Love via Gdb-patches wrote: > > GDB maintainers: > > > > 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 > > > > Hi Carl! > > Thanks for looking at this. The code part of the patch looks good, > but I'd suggest a bit > of a change to the commit message. > > > > -------------------------------------------------------------- > > Fix gdb.base/step-indirect-call-thunk.exp > > > > This test 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. > > This problem doesn't happen on my machine, which is using gcc-8.5.0; > I think the default > -fcf-protection value was changed somewhere between gcc-8.5.0 and the > one you're using. > I'd mention something along these lines: > > "Due to changes in the default value of -fcf-protection on > newer gccs, the test ... can fail." > > Also, remember that the commit message should assume the title of the > commit was not read, > so please use the full test name instead of "This test". > > > > The test also fails on PowerPC as the "-mindirect-branch' is an > > Intel specific > > GCC command line argument. A check for X86 is added so the test > > will only run > > on X86 platforms. > > I'd remove the specific mention to PowerPC and just say that > -mindirect-branch is x86 > specific. > > With these, I'd give an OK to this patch, but I can't approve it for > pushing. > > Cheers! > Bruno Larsen > > 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