Hi Alice, On Tue, Dec 02, 2025 at 08:27:59PM +0000, Alice Ryhl wrote: ... > diff --git a/Makefile b/Makefile > index > 96ddbaae7e12de71bcfabef4639de3a13a6e4815..5834bfd568548d1bee34b328dccce5d60f85526f > 100644 > --- a/Makefile > +++ b/Makefile > @@ -517,6 +517,8 @@ OBJCOPY = > $(LLVM_PREFIX)llvm-objcopy$(LLVM_SUFFIX) > OBJDUMP = $(LLVM_PREFIX)llvm-objdump$(LLVM_SUFFIX) > READELF = $(LLVM_PREFIX)llvm-readelf$(LLVM_SUFFIX) > STRIP = $(LLVM_PREFIX)llvm-strip$(LLVM_SUFFIX) > +LLVM_LINK = $(LLVM_PREFIX)llvm-link$(LLVM_SUFFIX) > +LLVM_AS = $(LLVM_PREFIX)llvm-as$(LLVM_SUFFIX)
Please keep the binutils alphabetized (i.e, put LLVM_LINK between AR and NM). Other than that, this seems fine from a Kbuild perspective (but I did not look too hard). > else > CC = $(CROSS_COMPILE)gcc > LD = $(CROSS_COMPILE)ld > @@ -625,7 +627,7 @@ export RUSTC_BOOTSTRAP := 1 > export CLIPPY_CONF_DIR := $(srctree) > > export ARCH SRCARCH CONFIG_SHELL BASH HOSTCC KBUILD_HOSTCFLAGS CROSS_COMPILE > LD CC HOSTPKG_CONFIG > -export RUSTC RUSTDOC RUSTFMT RUSTC_OR_CLIPPY_QUIET RUSTC_OR_CLIPPY BINDGEN > +export RUSTC RUSTDOC RUSTFMT RUSTC_OR_CLIPPY_QUIET RUSTC_OR_CLIPPY BINDGEN > LLVM_LINK LLVM_AS > export HOSTRUSTC KBUILD_HOSTRUSTFLAGS > export CPP AR NM STRIP OBJCOPY OBJDUMP READELF PAHOLE RESOLVE_BTFIDS LEX > YACC AWK INSTALLKERNEL > export PERL PYTHON3 CHECK CHECKFLAGS MAKE UTS_MACHINE HOSTCXX > diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug > index > 3034e294d50df55c4003c5fa5df442f59e711bd8..e63c5eb57b049aff988419ccd12dfd99d59f5080 > 100644 > --- a/lib/Kconfig.debug > +++ b/lib/Kconfig.debug > @@ -3427,6 +3427,21 @@ config RUST_KERNEL_DOCTESTS > > If unsure, say N. > > +config RUST_INLINE_HELPERS > + bool "Inline C helpers into Rust crates (EXPERIMENTAL)" > + depends on RUST && RUSTC_CLANG_LLVM_COMPATIBLE > + depends on EXPERT > + help > + Links C helpers into Rust crates through LLVM IR. > + > + If this option is enabled, instead of generating object files > directly, > + rustc is asked to produce LLVM IR, which is then linked together with > + the LLVM IR of C helpers, before object file is generated. > + > + This requires a matching LLVM version for Clang and rustc. > + > + If unsure, say N. > + I am just curious, why would someone want (or not) to do this? This help text does not really indicate the point of the option, just what it does. Is it just the standard tradeoffs with inlining (potential improvements in performance due to better optimization opportunities versus text size increase and icache pressure) or something else? Cheers, Nathan
