From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id /klvMZYVNGoBtw0AWB0awg (envelope-from ) for ; Thu, 18 Jun 2026 11:58:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1781798294; bh=DwvVb1I7gAoB5d5roSPQCPSLvJ2w2LKVlqCvk0PUb98=; h=Date:Subject:To:References:From:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=kl1A1ZXoq21WhR8o9sQrDkMdRvj5m3uNGo8cp6X+L6c2NeRY5KmFzXdRYb4M5QQUC fn2BMroUmt4rU7UmQtJF0U5fnXTRIkKWxDUMZLE+cgsfbgCDLvZZbWwx5fD4vJ0C0z Oyb4VN6Wfy6Sv/idZfZQzCOLKdmLZuOp542L4o2Y= Received: by simark.ca (Postfix, from userid 112) id B55DC1E070; Thu, 18 Jun 2026 11:58:14 -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=ham autolearn_force=no version=4.0.1 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=simark.ca header.i=@simark.ca header.a=rsa-sha256 header.s=mail header.b=DZEUSVJZ; dkim-atps=neutral Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.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 F0FE51E070 for ; Thu, 18 Jun 2026 11:58:13 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 1EA304B9DB6C for ; Thu, 18 Jun 2026 15:58:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1EA304B9DB6C Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=simark.ca header.i=@simark.ca header.a=rsa-sha256 header.s=mail header.b=DZEUSVJZ Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 0D5514BA2E0D for ; Thu, 18 Jun 2026 15:57:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0D5514BA2E0D Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=simark.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=simark.ca ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 0D5514BA2E0D Authentication-Results: sourceware.org; arc=none smtp.remote-ip=158.69.221.121 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1781798269; cv=none; b=aKkYnTpXz597T9gZVdy+S8/87IdDyTstPbyB+xubncyP+9OPhAOTp5CoR/i8ISnZQdcCbiF1WF/oVQ/dzQ1RvpHCAQ6JnGc0P4ldhn7/DCeDqC6hWmyd8A1vwZSjthIMQ2TXftpBC/mPO3+MRyzBQO1Z2DAgNwayQruf9ryiWEA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1781798269; c=relaxed/simple; bh=DwvVb1I7gAoB5d5roSPQCPSLvJ2w2LKVlqCvk0PUb98=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=vGkKam9zEDqIgGcuUspJ/eXctDiS9jql/pGqFPWhviToFTf5tUpV/DZMOuVQXboVRZyM+Nrn/P+RN6K7YG555BuDmCwI5P15iZkIchxpLmQa46I0nF7+CQdeVPWUJGx6zdp1Pwufk4GVPx5ZppCDWQBCkP/1Ga1XI3P4TntqPfA= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=simark.ca header.i=@simark.ca header.a=rsa-sha256 header.s=mail header.b=DZEUSVJZ DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0D5514BA2E0D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1781798267; bh=DwvVb1I7gAoB5d5roSPQCPSLvJ2w2LKVlqCvk0PUb98=; h=Date:Subject:To:References:From:In-Reply-To:From; b=DZEUSVJZvUTahYZdOuFeZWd3c/aZxWHyfyBmeeb0jByg7TYmeTiJhk0ywlJ51IGKE wT5nWB7agv03pMN07bDFt9XhW52m2jchfmDWc9SLmc/zTKJKaNFAxi6fiKVL/i5KYr GdpurtqMiE4Dl4UGJb7qeL3+97GS3C00l9sFtPgE= Received: by simark.ca (Postfix) id A1A2F1E070; Thu, 18 Jun 2026 11:57:46 -0400 (EDT) Message-ID: <3ce6ea60-f107-480a-8ca3-d8a2de2ec6ec@simark.ca> Date: Thu, 18 Jun 2026 11:57:46 -0400 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 0/2] Fix ODR violations in regformat target descriptions To: Keith Seitz , gdb-patches@sourceware.org References: Content-Language: en-US From: Simon Marchi In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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 2026-06-18 10:23, Keith Seitz wrote: > Commit 1a5362ce51ef ("gdb, gdbserver: propagate use of target_desc unique > pointers") changd most target descriptions to "const_target_desc_up," but > deliberately left gdb/regformats/regdat.sh unchanged because those descriptions > were still emitted as file-local static "struct target_desc" objects declared > "const struct target_desc *". > > That mismatch breaks gdbserver on ppc64le when LTO is enabled. The shared > header gdb/arch/ppc-linux-tdesc.h declares symbols such as > "tdesc_powerpc_isa207_htm_vsx64l" as "const_target_desc_up," while regdat- > generated translation units still define them as raw pointers. This reintroduces > previously settled ODR violations. > > This series updates regdat.sh to generate code consistent with the unique-pointer > API, then updates gdbserver targets that declare those symbols locally. > > There are no intended user-visible changes. Other than the little nit I sent on patch 1, this series LGTM (although I still don't fully understand why regdat exists and how it works). Approved-By: Simon Marchi It's unfortunate that this problem was only found by building with LTO. If one builds without LTO, then I suppose it goes unnoticed and the program could misbehave. Although in this case, a unique_ptr and a raw pointer have the same memory footprint, so it was probably fine, by chance. The problem is that we have hardcoded declarations for whatever is in the generated files. And since the generated files don't see the declarations, the compiler doesn't complain about any mismatch. I think it would be nice to change the scripts that generate these .c files to also generate header files with matching declarations, and then have the hand-written source files include these generated header files. Simon