From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id 098D7385040C for ; Wed, 12 Oct 2022 14:51:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 098D7385040C 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-out1.suse.de (Postfix) with ESMTPS id 2EFEA21B5F for ; Wed, 12 Oct 2022 14:51:07 +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 E7E2D13A5C for ; Wed, 12 Oct 2022 14:51:06 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 0TY0N1rURmNGLQAAMHmgww (envelope-from ) for ; Wed, 12 Oct 2022 14:51:06 +0000 Date: Wed, 12 Oct 2022 16:51:05 +0200 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [committed][gdb/testsuite] Fix gdb.base/nested-subp{2,3}.exp with recent ld Message-ID: <20221012145103.GA3425@delia.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-12.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, 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: Wed, 12 Oct 2022 14:51:09 -0000 Hi, On openSUSE Tumbleweed (with ld 2.39) I get for test-case gdb.base/nested-subp2.exp: ... gdb compile failed, ld: warning: tmp.o: requires executable stack \ (because the .note.GNU-stack section is executable) ... Fix this by compiling with -Wl,--no-warn-execstack. Likewise in gdb.base/nested-subp3.exp Tested on x86_64-linux. Committed to trunk. Thanks, - Tom [gdb/testsuite] Fix gdb.base/nested-subp{2,3}.exp with recent ld --- gdb/testsuite/gdb.base/nested-subp2.exp | 15 ++++++++++++--- gdb/testsuite/gdb.base/nested-subp3.exp | 15 ++++++++++++--- 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/gdb/testsuite/gdb.base/nested-subp2.exp b/gdb/testsuite/gdb.base/nested-subp2.exp index efc8dc5c25b..7716e7c8ace 100644 --- a/gdb/testsuite/gdb.base/nested-subp2.exp +++ b/gdb/testsuite/gdb.base/nested-subp2.exp @@ -29,10 +29,19 @@ if ![support_nested_function_tests] { return -1 } +set flags {} +lappend flags debug +lappend flags additional_flags=-std=gnu99 + +set ld_flags additional_flags=-Wl,--no-warn-execstack +if { [gdb_can_simple_compile ld-flags {int main () { return 0; }} executable \ + $ld_flags] } { + lappend flags $ld_flags +} + if { [gdb_compile "${srcdir}/${subdir}/${testcase}.c" \ - [standard_output_file "${testcase}"] \ - executable \ - [list debug "additional_flags=-std=gnu99"]] != "" } { + [standard_output_file "${testcase}"] \ + executable $flags] != "" } { return -1 } diff --git a/gdb/testsuite/gdb.base/nested-subp3.exp b/gdb/testsuite/gdb.base/nested-subp3.exp index fc87631c342..b547b8efd35 100644 --- a/gdb/testsuite/gdb.base/nested-subp3.exp +++ b/gdb/testsuite/gdb.base/nested-subp3.exp @@ -29,10 +29,19 @@ if ![support_nested_function_tests] { return -1 } +set flags {} +lappend flags debug +lappend flags additional_flags=-std=gnu99 + +set ld_flags additional_flags=-Wl,--no-warn-execstack +if { [gdb_can_simple_compile ld-flags {int main () { return 0; }} executable \ + $ld_flags] } { + lappend flags $ld_flags +} + if { [gdb_compile "${srcdir}/${subdir}/${testcase}.c" \ - [standard_output_file "${testcase}"] \ - executable \ - [list debug "additional_flags=-std=gnu99"]] != "" } { + [standard_output_file "${testcase}"] \ + executable $flags] != "" } { return -1 }