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 EF0BA3FFD; Sat, 14 Mar 2026 00:40:19 +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=1773448820; cv=none; b=TOU7/uFpih32Lna0/v3N0owEE9MTZJNPGxXyqsXlxMn6aTD7LjP0WJE2XfWJcO/fQvTgU89esCHDVsGeqPWUVViO036Z6sqqOZ8sGMuyc1RFNLtiog3Uo2JBx7rTbYMfuiWz5aKNKzAitgm6TcVpYFCVL1XraMwbvM3ZVepXq7A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773448820; c=relaxed/simple; bh=0gr9KSxldAsVL37ewdEm7gS+QwXkMqtMYEStjECI/A0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=aHvbDkvPo2TSgPfMuqtL1M02DO2Z2v7wqIBpcvKIdY/ZT1XhPsaOxoeIZ1KcJGss+DYPsA0hQKwcREJ8HbWDcjh7QUDHlPGZ6fcmVDloNBxjW9sLej3MU+XtRfhOXfvIlkQt4mfevf6SOn0Y41BKdF5W3oMZJo35WWnw24xwpCI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=SymjV1g9; 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="SymjV1g9" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 17F20C19421; Sat, 14 Mar 2026 00:40:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1773448819; bh=0gr9KSxldAsVL37ewdEm7gS+QwXkMqtMYEStjECI/A0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=SymjV1g9y9ackIFgNet5bLgMQiyOi+sQJ3HWOAAavOgS556/ugt+dfQ6Wl/j1jzc8 Tm87cle8BQTjx1hOok2oZek/8PSILyrU8EaUm1CDgBGexy+w3hbhdYxgLYFBXlJcGm xQ4/vGTpHXi1lLJMWPqrir6QkVZVjMYdp3R7oZrrV3TRfd5O3bouY9utN6q2p3OrH9 bA1J3HOjBlmxaSdTsY6Y6uOerD+hwaRY93rHxGCzwWuvk4Jt6cMQAPBPlLRnpATnUv zDFR7eI4UJ5e+bfXP5qKuS0ptUR2JKTATZ1bd54cYt3Ow1OSpnduBdc9czgQHEr4ig M7Xtxnz3uxMjg== Date: Fri, 13 Mar 2026 17:40:12 -0700 From: Nathan Chancellor To: Alice Ryhl Cc: Miguel Ojeda , Boqun Feng , Gary Guo , =?iso-8859-1?Q?Bj=F6rn?= Roy Baron , Benno Lossin , Andreas Hindborg , Trevor Gross , Danilo Krummrich , Alexandre Courbot , Will Deacon , Peter Zijlstra , Mark Rutland , Nick Desaulniers , Bill Wendling , Justin Stitt , Nicolas Schier , Andrew Morton , Uladzislau Rezki , rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev, linux-kbuild@vger.kernel.org, linux-mm@kvack.org, Matthew Maurer Subject: Re: [PATCH v2 3/3] build: rust: provide an option to inline C helpers into Rust Message-ID: <20260314004012.GD534169@ax162> References: <20260203-inline-helpers-v2-0-beb8547a03c9@google.com> <20260203-inline-helpers-v2-3-beb8547a03c9@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=us-ascii Content-Disposition: inline In-Reply-To: On Fri, Mar 06, 2026 at 05:32:33PM +0000, Alice Ryhl wrote: > On Tue, Feb 03, 2026 at 11:34:10AM +0000, Alice Ryhl wrote: > > $(obj)/bindings/bindings_helpers_generated.rs: $(src)/helpers/helpers.c FORCE > > $(call if_changed_dep,bindgen) > > > > +quiet_cmd_rust_helper = HELPER $@ > > + cmd_rust_helper = \ > > + $(CC) $(filter-out $(CFLAGS_REMOVE_helpers/helpers.o), $(c_flags)) \ > > + -c -g0 $< $(if $(filter %_module.bc,$@),-DMODULE) -emit-llvm -o $@ > > + > > +$(obj)/helpers/helpers.bc $(obj)/helpers/helpers_module.bc: $(src)/helpers/helpers.c FORCE > > + +$(call if_changed_dep,rust_helper) > > I think this needs: > > $(obj)/helpers/helpers.bc: private part-of-builtin := y > $(obj)/helpers/helpers_module.bc: private part-of-module := y > > at least it seems to make a difference for AutoFDO. Would $(obj)/helpers/helpers.bc $(obj)/helpers/helpers_module.bc: private is-kernel-object := y work as well? Presumably, this is because c_flags only has the AutoFDO flags when is-kernel-object is set, which is only true when helpers/helpers.o is a part of obj-y. Cheers, Nathan