From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id cscWK8uOTmoCnywAWB0awg (envelope-from ) for ; Wed, 08 Jul 2026 13:54:19 -0400 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=I53EkxhZ; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 9CF4A1E098; Wed, 08 Jul 2026 13:54:19 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [IPv6:2620:52:6:3111::32]) (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 78F4B1E024 for ; Wed, 08 Jul 2026 13:54:18 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id AA2944BA2E21 for ; Wed, 8 Jul 2026 17:54:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AA2944BA2E21 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=I53EkxhZ Received: from DM1PR04CU001.outbound.protection.outlook.com (mail-centralusazon11010066.outbound.protection.outlook.com [52.101.61.66]) by sourceware.org (Postfix) with ESMTPS id 77A4B4BA5434 for ; Wed, 8 Jul 2026 17:53:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 77A4B4BA5434 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=amd.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 77A4B4BA5434 Authentication-Results: sourceware.org; arc=pass smtp.remote-ip=52.101.61.66 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1783533232; cv=pass; b=Vqg7J5C0sjz7UnRbpeLLYDoKGTLWNofp4e8dCmQzcCmtuM3TpLu8o9r0tDe+UulZmPjEYteqeycyQhfk3Nep/5jAEWCcJyTGDsuDDgcmXQ78lLmFpb+eElVfDk507J080mH7WCptWmE666rwc0XbnBYrcWjjPQubgBb7se9ljhE= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1783533232; c=relaxed/simple; bh=0cPSxS65sXvxi/ckR68mxbCv8Zzxm5T95xPCof65Gbg=; h=DKIM-Signature:Message-ID:Date:Subject:To:From:MIME-Version; b=N9lDZBn3sjb34OUfvbEfNCkvSb6K04dxHRfF+MRr2sjg+/3oUsuC4GYzFdg5MLO7KGvcKFzpw4lHo3MmFdXZ1CnW5YywJQk0lTNTo4kPwnkP1PPqHF9wiSjl2rEHjlMCJTP84G7FmKZtk/4DF2I2TLfYz4IRkFT5QKA+JRb+8YU= ARC-Authentication-Results: i=2; sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=I53EkxhZ DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 77A4B4BA5434 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=kTFBL2IKzG8GWmiQjR7aP5H3jUJqP6W01UIUp/4+a7g7QbaJwUV6tV1gAj+55xzaarEdH/dgLFluFFvuyEJ59ubG6p7+MWimh+2/1nWgKth2gmnkjFWn5Gxux+0Ebqiu4bjtO3/IOxI8LJm3nqIHZ3nXRSDSH5RQpHUND7GCcz7sSo3pzfcHCzfBBT5KqNofCYHLF1K+sskujvBlVNKi5v4ZYSPYfDd6eVSzAEbgrGJtETiDuLubQ61TrMTtOJ22DStza8+yulOtJXqDIFhl/ZLuJj40gVix1K4SfJTxAqM6N5+idHjDWem//UJ+C1Lo+QeSc8CPv6CSTVts8ya8JA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=fw00p69iOKW/SWqZEchXeLNnucK6oXBxcF5zgsfbz8w=; b=rOQBkfMfCDtOPCO9ystnFa+NqqdocvK1JTVNZr6OsmMgzbkeXEGbAuYvmIbgYtnDLAr1G3YiouCI+pN8I463QJqBjr6sMsFsoSbQz04kJPwDtAio7+hojxpR+thPSi11lV7Bc59mWZWHdlL1ZQ5+WhjNLooTicr91hEV6G8m7tpeYJ5Ku0nW0+7knDWEnpKbnU5D+PnEzsmwU3OoJgN5qUHCLI7UMqZlUAbKdDkquY0t4SQuvp18ctCC9O2MavY+2fYSR9MKPVTgRgKUKL4sj/uSHlhm3shsW9oBNCqhMwVao2F3m+fcnlclCRXin1EOOseSTQ87j/WLHIpTWt4/Gg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=fw00p69iOKW/SWqZEchXeLNnucK6oXBxcF5zgsfbz8w=; b=I53EkxhZeEjkjJgECik69uX0gd8jE/m5Z2qtkJpp9IZ+sImrIJXkt1D9v3n/6RKyow2iDbf2NkuyAahCty+PJcs2VjeL0QghKdOnevS70RV47jwBbn/9ieowI/Ag3RSfZSmGrb+DvbwP1ozvV4unk+M5LcGOpNft0B5WudwDa/k= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from CH3PR12MB9079.namprd12.prod.outlook.com (2603:10b6:610:1a1::9) by CYXPR12MB9320.namprd12.prod.outlook.com (2603:10b6:930:e6::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.10; Wed, 8 Jul 2026 17:53:48 +0000 Received: from CH3PR12MB9079.namprd12.prod.outlook.com ([fe80::5a7a:2adf:1862:35c3]) by CH3PR12MB9079.namprd12.prod.outlook.com ([fe80::5a7a:2adf:1862:35c3%5]) with mapi id 15.21.0181.009; Wed, 8 Jul 2026 17:53:48 +0000 Message-ID: Date: Wed, 8 Jul 2026 18:53:44 +0100 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] gdb/hip: Prepare for DWARF-assembler-based HIP testcases To: Pedro Alves , gdb-patches@sourceware.org References: <20260707111527.1211730-1-pedro@palves.net> Content-Language: en-US From: Lancelot SIX In-Reply-To: <20260707111527.1211730-1-pedro@palves.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: FR4P281CA0173.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:b7::16) To CH3PR12MB9079.namprd12.prod.outlook.com (2603:10b6:610:1a1::9) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH3PR12MB9079:EE_|CYXPR12MB9320:EE_ X-MS-Office365-Filtering-Correlation-Id: 4437544e-6fbc-4c3b-7c0c-08dedd19dc99 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|366016|1800799024|376014|23010399003|22082099003|18002099003|3023799007|56012099006|11063799006; X-Microsoft-Antispam-Message-Info: V0NCXRwTG0xKAcBesxvfqnZGqFL2Mu5BWhAaXbSKUaEZPLs9m4KYmJTCKri3jBTI6HTZahizRiBdmNmC2hclRsTCG3xMv7EqeGYJcfHFmS7A1rNVSnm/LZ0+Yy1Kau7HkJU6C0BNspikanSSgPv+iaKB7Oe9KHCjIr4CbmkSqLCn97aCePvlup6bPaw3Q29yR6lDPq0L5b0VFm26ldIIFaf4ZRkow5iZ5lT7PHY84HolWQeCbRLs+So2eH+4p+hicUM5iXH9u8qnJFRDlqs9f57aGpIfFs/z2X37YLdGznD0B43uiYb03TuM7dJD512cBa0dnluWP5CBU6/z2tHHPXGFkOjfYrmGn1BEOJ7/Nsl/wfsCGpXy6BmKITNFG16Cn6ccafeLgXXUi8xrOMsXWhi/Kv/vnyhmq1QnmqfMVp+a7T7hwjZGT4eaGsBfkLBebe1arMk5jqrFqZBj+ZuPoLQF3bpRICyDWljNz2CFem5EL73kQbe0V9Et60kUeFaLaKGCBWjBDrbRlnsg/3j0XDqSmHUaeGbwXYikLXuvHtc1qfzsXqajjqNSvzKU1fofEIsg+Xkt0nYA3ZbRjj4ZWTs21zFpmEQ870APagsnV0Sp/TfLmefunZ/a2ykc079QkCywbcYkEH3onhr0NStvoZiBwr14bFVdqjczyQABL1g= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CH3PR12MB9079.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(1800799024)(376014)(23010399003)(22082099003)(18002099003)(3023799007)(56012099006)(11063799006); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?bSs4RDZkeFZVaWw1ZWt6bGZ3ODRNMmU3OWp2VHdvQk1JSlBHeS8vaWx1V1Fp?= =?utf-8?B?enl3bjNNaytKUktJN1FNaDRQOFNRREdCWG5EblowZlNWMThPZG9aL2NCMDU0?= =?utf-8?B?WU1wa0V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5Kzht?= =?utf-8?B?SVFaQ0lIRkNkMDJVa0pmVGNaTDZIUWtQblRYQ1gyeTlHSTBiMGJPMnl6OEZo?= =?utf-8?B?dWFnQTk3QVhkOUtuaXNMWnV1L05jRW1FeEN3M21hT3Z6Ulkxd1k2VFc1QUJq?= =?utf-8?B?T1JqYThuVTR3YTVhdFdSTHR3dU1DRXQ4QVIyMGEyZzFsb0lwaDVmSXBnV0tu?= =?utf-8?B?THJRWXI1ZWxDTHNJQXViZzVTbW5HL3hwNUM3SlkyL1N5dHdlbFBiM3E4MW5X?= =?utf-8?B?bGdGVldsNFFzaHdLZlRDdUNZVzl5UzIyQXRsZGpZaElFeUZuVjhqUzFsbmFl?= =?utf-8?B?RC9KbHlWMGk0YXZ0VVdSZlpjRkcyRUZETDF3NUxlRGJSZkJlNlZWaWVZM3dQ?= =?utf-8?Q?xQjBBhfMoBt7tGQWxe?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4437544e-6fbc-4c3b-7c0c-08dedd19dc99 X-MS-Exchange-CrossTenant-AuthSource: CH3PR12MB9079.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jul 2026 17:53:47.9955 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: l0iF8eOnF6fLR+3VwHEKJ151qouMwZkEviqWy1xpSsfByBF8jj6zd2RPpPpjLobwm3cZdGrvxddu9ar7mfAF7Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CYXPR12MB9320 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 07/07/2026 12:15, Pedro Alves wrote: > Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding. > > > Compiling a testcase with debug info (by passing passing "debug" as > gdb_compile option) has the effect of passing -g to the compiler. -g > in turn enables an LLVM option that is essential for debugging: > '-mllvm -amdgpu-spill-cfi-saved-regs'. > > That option affects code generation, and some features of the DWARF > assembler machinery rely on code generated by the compiler without -g > to be the exact same as the code generated with -g. > > This patch addresses that by always compiling with the LLVM option > that -g would enable. Hi Pedro, That looks good to me. This change lives in lib/gdb.exp, but really only applies when building hip testcases. If you are happy for this to fall under the amdgpu umbrella, then Approved-by: Lancelot Six (amdgpu) Otherwise, you can change this to a Reviewed-by. Best, Lancelot. > > Change-Id: I64a938edf97c85d0ea9fc34b37071daa560de7e7 > --- > gdb/testsuite/lib/gdb.exp | 32 ++++++++++++++++++++++++++++---- > 1 file changed, 28 insertions(+), 4 deletions(-) > > diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp > index a19e8ba6729..a40c87c6727 100644 > --- a/gdb/testsuite/lib/gdb.exp > +++ b/gdb/testsuite/lib/gdb.exp > @@ -6745,11 +6745,35 @@ proc gdb_compile {source dest type options} { > lappend new_options "early_flags=-fno-stack-protector" > } > > - # hipcc defaults to -O2, so add -O0 to early flags for the hip language. > - # If "optimize" is also requested, another -O flag (e.g. -O2) will be added > - # to the flags, overriding this -O0. > if {[lsearch -exact $options hip] != -1} { > - lappend new_options "early_flags=-O0" > + # The -g option enables an LLVM option that is essential for > + # debugging (-mllvm -amdgpu-spill-cfi-saved-regs), but that > + # unfortunately also affects code generation. We don't want > + # to hardcode -g here though, because some tests want to test > + # debugging without debug info, and yet others want to compile > + # their binary without debug info or with -gline-info-only, > + # and then use the DWARF assembler to generate their own debug > + # info. Some features of the DWARF assembler rely on nodebug > + # and debug binaries having the exact same generated code, so, > + # explicitly compile with the LLVM option that -g would > + # enable, and leave adding -g to the testcase, via the "debug" > + # option, as normal. > + # > + # Disable -Wunused-command-line-argument to avoid warnings > + # like: > + # > + # clang: warning: argument unused during compilation: \ > + # '-mllvm=-amdgpu-spill-cfi-saved-regs' [-Wunused-command-line-argument] > + # > + # These happen when we're compiling an executable _and_ all > + # the input files are .o files, like: hipcc foo.o -o foo ... > + # > + # HIPCC defaults to -O2, so add -O0 to early flags for the HIP > + # language. If "optimize" is also requested, another -O flag > + # (e.g. -O2) will be added to the flags, overriding this -O0. > + lappend new_options "early_flags=-O0\ > + -mllvm=-amdgpu-spill-cfi-saved-regs\ > + -Wno-unused-command-line-argument" > } > > # Because we link with libraries using their basename, we may need > > base-commit: 57d9dfcf39cd3c2897bb76c2dbd7074f065685df > -- > 2.54.0 >