From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1983) id 15BBE384F01E; Wed, 13 Jul 2022 15:13:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 15BBE384F01E Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Carl Love To: gdb-cvs@sourceware.org Subject: [binutils-gdb] Fix gdb.base/step-indirect-call-thunk.exp X-Act-Checkin: binutils-gdb X-Git-Author: Carl Love X-Git-Refname: refs/heads/master X-Git-Oldrev: 0f443d1b70ff8c338a536b5ce1cd963f8ee8d206 X-Git-Newrev: 43127ae5714999118898511e0ec862d892af8106 Message-Id: <20220713151358.15BBE384F01E@sourceware.org> Date: Wed, 13 Jul 2022 15:13:58 +0000 (GMT) X-BeenThere: gdb-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jul 2022 15:13:58 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D43127ae57149= 99118898511e0ec862d892af8106 commit 43127ae5714999118898511e0ec862d892af8106 Author: Carl Love Date: Wed Jul 13 15:09:33 2022 +0000 Fix gdb.base/step-indirect-call-thunk.exp =20 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 t= he error: =20 Executing on host: gcc -fno-stack-protector -fdiagnostics-color=3Dnev= er -mindirect-branch=3Dthunk -mfunction-return=3Dthunk -c -g -o /.../gdb/testsuite/outputs/gdb.base/step-indirect-call-thunk/step-in= direct-call-thunk0.o /.../gdb/testsuite/gdb.base/step-indirect-call-thunk.c (timeout =3D 300) builtin_spawn -ignore SIGHUP gcc -fno-stack-protector -fdiagnostics-color=3Dnever -mindirect-branch=3Dthunk -mfunction-return= =3Dthunk -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-thu= nk.c /.../gdb/testsuite/gdb.base/step-indirect-call-thunk.c: In function 'inc': /.../gdb/testsuite/gdb.base/step-indirect-call-thun= k.c: 22:1: error: '-mindirect-branch' and '-fcf-protection' are not compatib= le 22 | { /* inc.1 */ =20 As stated in the error message the default "-fcf-protection" and "-mindirect-branch' are in compatible. The fcf-protection argument nee= ds to be "-fcf-protection=3Dnone" for the test to compile on Intel. =20 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. =20 The patch has been tested and verified on Power 10 and Intel X86-64 sys= tems with no regressions. Diff: --- 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/test= suite/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 @@ =20 standard_testfile =20 -set cflags "-mindirect-branch=3Dthunk -mfunction-return=3Dthunk" +if { ![istarget "x86*"] } { + return +} + +set cflags "-mindirect-branch=3Dthunk -mfunction-return=3Dthunk -fcf-prote= ction=3Dnone" if { [prepare_for_testing "failed to prepare" $testfile $srcfile \ [list debug "additional_flags=3D$cflags"]] } { return -1