From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id YMllOXN+2WcD7BMAWB0awg (envelope-from ) for ; Tue, 18 Mar 2025 10:08:51 -0400 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=BRTdRN6s; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=nqK+YWdS; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=BRTdRN6s; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=nqK+YWdS; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id E78A21E100; Tue, 18 Mar 2025 10:08:51 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-5.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=unavailable autolearn_force=no version=4.0.1 Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 7A0961E0C0 for ; Tue, 18 Mar 2025 10:08:51 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 0F3353858CD1 for ; Tue, 18 Mar 2025 14:08:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0F3353858CD1 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=BRTdRN6s; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=nqK+YWdS; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=BRTdRN6s; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=nqK+YWdS Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2a07:de40:b251:101:10:150:64:2]) by sourceware.org (Postfix) with ESMTPS id 3141C3858D29 for ; Tue, 18 Mar 2025 14:08:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3141C3858D29 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 3141C3858D29 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a07:de40:b251:101:10:150:64:2 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1742306900; cv=none; b=rvTBZ2ivyufOT6KOQdImbuIw7XX42z/J+zpeYUjBXxEKmv9W1f/BKRqfsI4WH3FqHsdHGw8o0PA/TqbBOcBcSKFsoflHQLYUwHfdbKlnt2iOQY+9Bt2KZWdJizpg3TIbkASaUYrragyYS0raMsoa89FbObFKxFK5bw1eqStbR2Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1742306900; c=relaxed/simple; bh=a5Go/RpfbPXAk/AXz5gCUeQjamsbCqcopLYLH7rKJm8=; h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature: Message-ID:Date:MIME-Version:Subject:To:From; b=PKihgtE/BAN7TUepMOTaYZsqRbk8mK3KMDCyLUK/BNlln7+u2autzx0eqImlwTTMaI53+PGEFNfbFqF48xNEqEMJChunc6CcXmb86trLTQ1eTxEEg6fh81dFVllItoHfSFjRreFxw7sTBlk2rV59XfVkagzYGp2pHjphPfYjleA= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3141C3858D29 Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 35A941F84B; Tue, 18 Mar 2025 14:08:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1742306899; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=E/yUjs/upZTfrYuEF59PUD7yXzqqCgIXvGeorl9IfUg=; b=BRTdRN6s1G9F8ntCpg76tiUk5QwwRqxni9qfGlU7WaY2O88LDDKFuBmhKqF8FcJR0V9JmN 2GCF+U7cRz53ke1vEpns2C1l/p3UlOHBZUMxeaCuL8Qi2esw3VVo2PeuFpgyiqp5SHmJw0 6jgJGi8ktbiLlDe8yzAaD1FH5+PsW4g= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1742306899; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=E/yUjs/upZTfrYuEF59PUD7yXzqqCgIXvGeorl9IfUg=; b=nqK+YWdSOviPKspZ6cJCiQX5BkjZoauo8XZWLyQyS5iurYd4sTktTFXNEGahfjSzqLFxzf 2AfWj/D5uw1QdICA== Authentication-Results: smtp-out2.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1742306899; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=E/yUjs/upZTfrYuEF59PUD7yXzqqCgIXvGeorl9IfUg=; b=BRTdRN6s1G9F8ntCpg76tiUk5QwwRqxni9qfGlU7WaY2O88LDDKFuBmhKqF8FcJR0V9JmN 2GCF+U7cRz53ke1vEpns2C1l/p3UlOHBZUMxeaCuL8Qi2esw3VVo2PeuFpgyiqp5SHmJw0 6jgJGi8ktbiLlDe8yzAaD1FH5+PsW4g= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1742306899; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=E/yUjs/upZTfrYuEF59PUD7yXzqqCgIXvGeorl9IfUg=; b=nqK+YWdSOviPKspZ6cJCiQX5BkjZoauo8XZWLyQyS5iurYd4sTktTFXNEGahfjSzqLFxzf 2AfWj/D5uw1QdICA== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 0C6411379A; Tue, 18 Mar 2025 14:08:19 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id 6rNtAVN+2WclBQAAD6G6ig (envelope-from ); Tue, 18 Mar 2025 14:08:19 +0000 Message-ID: <958bb09e-486d-48f1-9ad9-66b42842bd96@suse.de> Date: Tue, 18 Mar 2025 15:08:25 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2] [gdb/testsuite] Fix gdb.base/enum_cond.exp on arm-linux To: Simon Marchi , gdb-patches@sourceware.org References: <20250318072806.23981-1-tdevries@suse.de> <8675f079-170b-493b-8a06-338d334f30bb@simark.ca> Content-Language: en-US From: Tom de Vries In-Reply-To: <8675f079-170b-493b-8a06-338d334f30bb@simark.ca> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spamd-Result: default: False [-4.30 / 50.00]; BAYES_HAM(-3.00)[100.00%]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; FROM_HAS_DN(0.00)[]; FUZZY_BLOCKED(0.00)[rspamd.com]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; RCPT_COUNT_TWO(0.00)[2]; MIME_TRACE(0.00)[0:+]; ARC_NA(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_TLS_ALL(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; TO_DN_SOME(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; MID_RHS_MATCH_FROM(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo,suse.de:mid] X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org On 3/18/25 14:46, Simon Marchi wrote: > > > On 2025-03-18 03:28, Tom de Vries wrote: >> On arm-linux, I run into: >> ... >> gdb compile failed, ld: warning: enum_cond.o uses variable-size enums yet \ >> the output is to use 32-bit enums; use of enum values across objects may fail >> UNTESTED: gdb.base/enum_cond.exp: failed to compile >> ... >> >> Fix this by using -nostdlib. >> >> Tested on arm-linux and x86_64-linux. >> --- >> gdb/testsuite/gdb.base/enum_cond.c | 16 ++++++++++++++++ >> gdb/testsuite/gdb.base/enum_cond.exp | 15 ++++++++++++++- >> gdb/testsuite/lib/gdb.exp | 12 ++++++++++++ >> 3 files changed, 42 insertions(+), 1 deletion(-) >> >> diff --git a/gdb/testsuite/gdb.base/enum_cond.c b/gdb/testsuite/gdb.base/enum_cond.c >> index 35e126aed45..df8830f0c9e 100644 >> --- a/gdb/testsuite/gdb.base/enum_cond.c >> +++ b/gdb/testsuite/gdb.base/enum_cond.c >> @@ -46,3 +46,19 @@ main (void) >> return 0; >> } >> >> +void >> +exit (int status) >> +{ >> +#if HAVE_BUILTIN_TRAP >> + __builtin_trap (); >> +#endif >> + while (1) >> + ; > > Huh, it would be nice to find something that works everywhere. > We do > have "my_exit" in lib/my-syscalls.h, which we could call, but we would > need to provide a syscall implementation for all arches we want to test > (not too hard, but still). > > What about having a global: > > volatile int *dummy = nullptr; > > and then do: > > *dummy = 1; > > Would that successfully stop the program on all known platforms? AFAIU that's undefined behaviour, so a valid implementation might just skip the store. I can submit a v3 using this (note NULL instead of nullptr since this is C, not C++): ... void exit (int status) { #if HAVE_BUILTIN_TRAP __builtin_trap (); #endif { volatile int *dummy = NULL; *dummy = 1; } while (1) ; ... but AFAIC I'm fine with this v2. Thanks, - Tom