From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CB9AC22257F; Thu, 9 Jan 2025 16:37:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736440627; cv=none; b=IdSUt695LtAMs4rNmQZACcYzKkS+aCSO/plQViqQOHu+FfG4rkYMEVhwjx3KZJc3g9EHobEXoVJxgoMEMmPyX3goNFHnVIuX1wyXUbiz1mYONTBpBsr95Mn4sN5+AoL9opMZQS62V4cLzFKeMk7BuHKSKqWgP5B5YeBImHEPb0w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736440627; c=relaxed/simple; bh=l5izUIuRQcUPxRHG1mIm9Fin1WX3o2ecdRtHcN3CCS8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=R3IzEZ4eqmcbmceCUa5jEQ6OsFA3oSC+DfigoJAmHLJyfxNidF65IoZRp1JnytFy+UWb9gJUGHSww3hxFodY54QBF/70vNTgtRSkfG0/uqZcGus7i2RjYREwz/rHPl5m9v3aREp9a9PRrIaofp5Dsl1lUXzxBEQg24/PLBpNJuI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=DVectj09; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="DVectj09" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E6662C4CED2; Thu, 9 Jan 2025 16:37:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1736440627; bh=l5izUIuRQcUPxRHG1mIm9Fin1WX3o2ecdRtHcN3CCS8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=DVectj098uLXeVwFl2HjY8t67AUrSYl5ryAxte7+1JZCEMxswMhCm/DxA/rrz7sc2 z3l+33wsAaEx8XBjCVG46XU4eCo6jmOsmkuJGygguiNt4D35XNUIXkSN1JRqkgw8+s 3FElTFaC3Droec0PDNdGpG0BprSBZi1ePs6lXJnGts39aKE8x1NBFLPMe8V0Co0XB+ uq52m9aRN5+HhFiZmCb0BO4uUDma7q1co68/ZOuVj7RMcWz66VnM1ehQr6uB7rFp0e Ye0ps++PdSeOjVtw2X9kLdGTyZJ3Vw9AVHiPUlTTerEO+8MxpwLp6LtCAoJFT7mmRd tCsO4jvwh2t+w== Date: Thu, 9 Jan 2025 13:37:04 -0300 From: Arnaldo Carvalho de Melo To: Tamir Duberstein Cc: Alice Ryhl , Neal Gompa , Miguel Ojeda , Matthew Maurer , Miguel Ojeda , Alex Gaynor , Boqun Feng , Gary Guo , =?iso-8859-1?Q?Bj=F6rn?= Roy Baron , Benno Lossin , Andreas Hindborg , Trevor Gross , linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org, Matthias Maennich , bpf , Martin KaFai Lau , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , John Fastabend , Eric Curtin , Martin Reboredo , Alessandro Decina , Michal Rostecki , Dave Tucker Subject: Re: [PATCH] rust: Disallow BTF generation with Rust + LTO Message-ID: References: <20250108-rust-btf-lto-incompat-v1-1-60243ff6d820@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Thu, Jan 09, 2025 at 01:29:47PM -0300, Arnaldo Carvalho de Melo wrote: > On Thu, Jan 09, 2025 at 10:49:49AM -0500, Tamir Duberstein wrote: > > On Thu, Jan 9, 2025 at 10:47 AM Arnaldo Carvalho de Melo wrote: > > > I was thinking about it after reading this thread yesterday, i.e. we > > > could encode constructs from Rust that can be represented in BTF and > > > skip the ones that can't, pruning types that depend on non BTF > > > representable types, etc. > > Yep, this is what bpf-linker does, along with some other things[0]. I > > highly recommend reading the code I linked to avoid re-discovering > > these things. > Sure, thanks for pointing it out and suggest I read it while > experimenting with having the same concept in pahole, I'll try a quick > hack and then look at it to see how close I got to what you guys came up > with :-) BTW, its "funny" how the DWARF loader can get things from Rust, golang, fortran and end up with things like: Rust: https://git.kernel.org/pub/scm/devel/pahole/pahole.git/commit/?id=d744d859768d6951cacd146604891c108b39f6a1 https://git.kernel.org/pub/scm/devel/pahole/pahole.git/commit/?id=c4eb1897d1f3841d291ee39dc969c4212750cf2c https://git.kernel.org/pub/scm/devel/pahole/pahole.git/commit/?id=2e8cd6a435d96335c4794794147019369b6a7b6a FORTRAN: https://git.kernel.org/pub/scm/devel/pahole/pahole.git/commit/?id=f5847773d94d4875e04e47de9b677098f34c6510 Go: https://git.kernel.org/pub/scm/devel/pahole/pahole.git/commit/?id=31bc0d7410572f6e03e3ed9da7c8c6f0d8df23c8 Now its a matter of making the BTF encoder be more permissive and just skip things it can't express in BTF. :-) - Arnaldo