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 5AE933856944 for ; Sun, 1 Oct 2023 11:14:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5AE933856944 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 29F6B1F74D; Sun, 1 Oct 2023 11:14:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1696158888; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=WoeJZtK2GEFzGpWyVXqiJ7L7+EqwOPiUoEX0nHwM1q4=; b=H73fkh9JnmghmTGTW/0nmRmCsCakG5JaT3ODxdJrNLVOwxwNv6Buza/QMFyjm1hZDIdmuC /oEpBqRCDLSqn73yRzsMRXe4XcAKLAQAbVX1ncMVucSqgDphUG5VTKspE8RqPc76LzSHiB uGBibnsNNXICrOAsFmWPqsUhpjMcPjo= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1696158888; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=WoeJZtK2GEFzGpWyVXqiJ7L7+EqwOPiUoEX0nHwM1q4=; b=pPBzRlFQV+V08aMIw0rOnKHGoWdbUfycPi7muElxfmDbsAutKBTs7m3rw5Gk15WAwvRilF YetMucJ9mBwMBCAA== 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 0F785132BE; Sun, 1 Oct 2023 11:14:48 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id uqiTAqhUGWVOXQAAMHmgww (envelope-from ); Sun, 01 Oct 2023 11:14:48 +0000 From: Tom de Vries To: gdb-patches@sourceware.org Cc: Jan Beulich Subject: [PATCH] [gdb/testsuite] Fix gdb.arch/i386-signal.exp on x86_64 Date: Sun, 1 Oct 2023 13:14:50 +0200 Message-Id: <20231001111450.2719-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=-11.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,KAM_NUMSUBJECT,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 List-Id: On x86_64-linux, with test-case gdb.arch/i386-signal.exp I run into: ... builtin_spawn -ignore SIGHUP gcc -fno-stack-protector i386-signal.c \ -fdiagnostics-color=never -fno-pie -g -no-pie -lm -o i386-signal^M /tmp/cc2xydTG.s: Assembler messages:^M /tmp/cc2xydTG.s:50: Error: operand size mismatch for `push'^M compiler exited with status 1 output is: /tmp/cc2xydTG.s: Assembler messages:^M /tmp/cc2xydTG.s:50: Error: operand size mismatch for `push'^M gdb compile failed, /tmp/cc2xydTG.s: Assembler messages: /tmp/cc2xydTG.s:50: Error: operand size mismatch for `push' UNTESTED: gdb.arch/i386-signal.exp: failed to compile ... This is with gas 2.41, it compiles without problems with gas 2.40. Some more strict checking was added in commit 5cc007751cd ("x86: further adjust extend-to-32bit-address conditions"). The offending bit is: ... " push $sigframe\n" ... which refers to a function: ... " .globl sigframe\n" "sigframe:\n" ... The test-case passes with target board unix/-m32. Make the test-case work by using pushq instead of push for the is_amd64_regs_target case. Tested on x86_64-linux, with target boards: - unix/-m64 (is_amd64_regs_target == 1), and - unix/-m32 (is_amd64_regs_target == 0), PR testsuite/30928 Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30928 --- gdb/testsuite/gdb.arch/i386-signal.c | 4 ++++ gdb/testsuite/gdb.arch/i386-signal.exp | 7 ++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/gdb/testsuite/gdb.arch/i386-signal.c b/gdb/testsuite/gdb.arch/i386-signal.c index 19bb1bbaaf8..4bf97e5f159 100644 --- a/gdb/testsuite/gdb.arch/i386-signal.c +++ b/gdb/testsuite/gdb.arch/i386-signal.c @@ -45,7 +45,11 @@ asm(".text\n" " .align 8\n" " .globl setup\n" "setup:\n" +#if IS_AMD64_REGS_TARGET + " pushq $sigframe\n" +#else " push $sigframe\n" +#endif " jmp func\n" "\n" " .cfi_startproc\n" diff --git a/gdb/testsuite/gdb.arch/i386-signal.exp b/gdb/testsuite/gdb.arch/i386-signal.exp index f6a88719a40..a69172ed5cb 100644 --- a/gdb/testsuite/gdb.arch/i386-signal.exp +++ b/gdb/testsuite/gdb.arch/i386-signal.exp @@ -19,8 +19,13 @@ require {is_any_target "i?86-*-*" "x86_64-*-*"} standard_testfile +set opts {} +lappend opts debug +lappend opts nopie +lappend opts additional_flags=-DIS_AMD64_REGS_TARGET=[is_amd64_regs_target] + if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" \ - executable { debug nopie }] != "" } { + executable $opts] != "" } { untested "failed to compile" return -1 } base-commit: 23b5268986d9b68b965939416a7aa96e8698e403 -- 2.35.3