From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2205) id 4621C3858D39; Fri, 21 Oct 2022 06:36:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4621C3858D39 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666334182; bh=y/aNZ/uL+bc/wUuaFHnaAFdwsrQXcFuaO7YXYsqJncA=; h=From:To:Subject:Date:From; b=v+XtLKNqGKjacArA6+2fUWum5BdY6EaN3IEFBO1l5b1plCCHiUCD2UyDgJuROoxQ+ F8Pmg8AqjWUqda9kQIuvcakSMWTCvTSGCxrCRQxUFzkp9td5skm2T3KE4Mwad7ETYW y/dPdS+18+GmJIOmbuJi5X/LMfCMmhLEl80MI2X4= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Tom de Vries To: gdb-cvs@sourceware.org Subject: [binutils-gdb] [gdb/testsuite] Silence compilation fail in gdb.base/rtld-step.exp X-Act-Checkin: binutils-gdb X-Git-Author: Tom de Vries X-Git-Refname: refs/heads/master X-Git-Oldrev: 68830fbae98867f63720d250a18ce64f9f2f51fc X-Git-Newrev: b4d6b738075e2d4be9b4a8d2080bcf94e6b7e229 Message-Id: <20221021063622.4621C3858D39@sourceware.org> Date: Fri, 21 Oct 2022 06:36:22 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3Db4d6b738075e= 2d4be9b4a8d2080bcf94e6b7e229 commit b4d6b738075e2d4be9b4a8d2080bcf94e6b7e229 Author: Tom de Vries Date: Fri Oct 21 08:36:18 2022 +0200 [gdb/testsuite] Silence compilation fail in gdb.base/rtld-step.exp =20 With gcc 7.5.0 and test-case gdb.base/rtld-step.exp, I run into: ... gdb compile failed, gcc: error: unrecognized command line option \ '-static-pie'; did you mean '-static'? ... =20 Silence this by checking in the test-case that -static-pie is supported= , and emitting instead: ... UNTESTED: gdb.base/rtld-step.exp: \ failed to compile (-static-pie not supported or static libc missing) ... =20 Tested on x86_64-linux, with: - gcc 7.5.0: UNTESTED - gcc 12.2.1 with static glibc not installed: UNTESTED - gcc 12.2.1 with static glibc installed: PASS Diff: --- gdb/testsuite/gdb.base/rtld-step.exp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/gdb/testsuite/gdb.base/rtld-step.exp b/gdb/testsuite/gdb.base/= rtld-step.exp index 4773fa8de3d..0aa2ab0fe1f 100644 --- a/gdb/testsuite/gdb.base/rtld-step.exp +++ b/gdb/testsuite/gdb.base/rtld-step.exp @@ -87,6 +87,14 @@ set binfile_rtld [standard_output_file ${rtld_basename}] set rtld_flags [list debug additional_flags=3D[list -static-pie -fPIE \ -nostdlib -static -lc]] =20 +if { ![gdb_can_simple_compile static-pie-static-libc \ + "void _start (void) { _exit (0); }" \ + executable $rtld_flags] } { + set reason "-static-pie not supported or static libc missing" + untested "failed to compile ($reason)" + return -1 +} + # Main program file names and flags: set main_basename ${::gdb_test_file_name}-main set srcfile_main ${srcdir}/${subdir}/${main_basename}.c