From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 2A7FD3856DD9 for ; Fri, 1 Jul 2022 12:37:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2A7FD3856DD9 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-259-6q8pH6kVNOyufM_tQb2NgA-1; Fri, 01 Jul 2022 08:37:30 -0400 X-MC-Unique: 6q8pH6kVNOyufM_tQb2NgA-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4639D1C04B71; Fri, 1 Jul 2022 12:37:30 +0000 (UTC) Received: from [10.97.116.18] (ovpn-116-18.gru2.redhat.com [10.97.116.18]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1EFF82166B26; Fri, 1 Jul 2022 12:37:28 +0000 (UTC) Message-ID: <0e0508df-0a30-8f6e-813f-e3c8c136ebae@redhat.com> Date: Fri, 1 Jul 2022 09:37:27 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH] Fix gdb.base/step-indirect-call-thunk.exp To: Carl Love , gdb-patches@sourceware.org, will schmidt , Ulrich Weigand References: From: Bruno Larsen In-Reply-To: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-13.2 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, NICE_REPLY_A, RCVD_IN_DNSWL_LOW, 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: Fri, 01 Jul 2022 12:37:39 -0000 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