From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by sourceware.org (Postfix) with ESMTPS id C883B385828D for ; Fri, 21 Oct 2022 06:36:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C883B385828D Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id BBBE81F8B4 for ; Fri, 21 Oct 2022 06:36:48 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id A69F51331A for ; Fri, 21 Oct 2022 06:36:48 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id /zGGJwA+UmPcFgAAMHmgww (envelope-from ) for ; Fri, 21 Oct 2022 06:36:48 +0000 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [pushed] [gdb/testsuite] Silence compilation fail in gdb.base/rtld-step.exp Date: Fri, 21 Oct 2022 08:36:48 +0200 Message-Id: <20221021063648.8746-1-tdevries@suse.de> X-Mailer: git-send-email 2.35.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-13.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_PASS, TXREP 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, 21 Oct 2022 06:36:51 -0000 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'? ... 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) ... 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 --- 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=[list -static-pie -fPIE \ -nostdlib -static -lc]] +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 base-commit: 68830fbae98867f63720d250a18ce64f9f2f51fc -- 2.35.3