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 777953858D35 for ; Mon, 24 Apr 2023 12:48:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 777953858D35 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de 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 A70C01FD84 for ; Mon, 24 Apr 2023 12:48:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1682340525; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=JZlTBOBGPIkgNy5PIuFvERImR3wt/dVTbQnKdyrm0gA=; b=mQUtXgCWIKQyMmSs04e8Z8iLyrykRWydzdIcrPUOpXxkgFSZP98gCgh7TlVLaAcHyODEyx pQZ51/7hQG1swETLAq/3TLGlOo6FD1uh0sghu1VGNE4ezxNZmO/e552St+bEUANPmspH3j vSGFxFg3YYO+6u1VGUbVRjdT4iU50zo= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1682340525; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=JZlTBOBGPIkgNy5PIuFvERImR3wt/dVTbQnKdyrm0gA=; b=SWsJ9mFFChJBXrT1JMZyPh6icB8u66jZtQq+32zADfzgqyCrav5dJMFjQ2JkIkQiyEu4s/ sWM8bH0BE2a73uCg== 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 932811390E for ; Mon, 24 Apr 2023 12:48:45 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id MA7RIq16RmRdBAAAMHmgww (envelope-from ) for ; Mon, 24 Apr 2023 12:48:45 +0000 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [pushed 3/4] [gdb/testsuite] Fix gdb.multi/multi-arch.exp on powerpc64le Date: Mon, 24 Apr 2023 14:48:45 +0200 Message-Id: <20230424124846.29580-3-tdevries@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20230424124846.29580-1-tdevries@suse.de> References: <20230424124846.29580-1-tdevries@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.4 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,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 List-Id: When running test-case gdb.multi/multi-arch.exp on powerpc64le-linux, I run into: ... Running gdb/testsuite/gdb.multi/multi-arch.exp ... gdb compile failed, In file included from /usr/include/features.h:399:0, from /usr/include/stdio.h:27, from gdb/testsuite/gdb.multi/hangout.c:18: /usr/include/gnu/stubs.h:8:27: fatal error: gnu/stubs-32.h: \ No such file or directory # include ^ compilation terminated. ... The problem is that the test-case attempts to use gcc -m32 to produce an executable while that's not available. Fix this by: - introduce a new caching proc have_compile_and_link_flag, and - using have_compile_and_link_flag in test-case gdb.multi/multi-arch.exp. Tested on: - x86_64-linux (openSUSE Leap 15.4), and - powerpc64le-linux (CentOS-7). --- gdb/testsuite/gdb.multi/multi-arch.exp | 8 ++++++++ gdb/testsuite/lib/gdb.exp | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/gdb/testsuite/gdb.multi/multi-arch.exp b/gdb/testsuite/gdb.multi/multi-arch.exp index f2c8a282a61..e1fbe1bcab1 100644 --- a/gdb/testsuite/gdb.multi/multi-arch.exp +++ b/gdb/testsuite/gdb.multi/multi-arch.exp @@ -50,6 +50,14 @@ if [istarget "s390*-*-*"] { set march2 "-m32" } +if { $march1 != "" } { + require "have_compile_and_link_flag $march1" +} + +if { $march2 != "" } { + require "have_compile_and_link_flag $march2" +} + if { [build_executable "failed to prepare" ${exec1} "${srcfile1}" \ [list debug additional_flags=${march1}]] } { return -1 diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index 9d711e8aa66..45588d85aea 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -9668,6 +9668,14 @@ gdb_caching_proc have_compile_flag { flag } { additional_flags=$flag] } +# Return 1 if we can create an executable using compile and link flag FLAG. + +gdb_caching_proc have_compile_and_link_flag { flag } { + set src { int main () { return 0; } } + return [gdb_can_simple_compile have_compile_and_link_flag_$flag $src executable \ + additional_flags=$flag] +} + # Handle include file $srcdir/$subdir/FILE. proc include_file { file } { -- 2.35.3