Building BCacheFS module with Rust support via DKMS package
Greetings.
I am building my own kernel with:
time eatmydata make LLVM=1 -j16 bindeb-pkg LOCALVERSION=-t14g5
I do have rustc and rust-src as of 1.95.0+dfsg1-2, bindgen as of 0.72.1-1+b2 on Devuan Ceres which is based on Debian Unstable aka Sid.
I am quite confident my kernel is build with rust support:
% grep _RUST /boot/config-7.1.6-t14g5 CONFIG_RUSTC_VERSION=109500CONFIG_RUST_IS_AVAILABLE=y CONFIG_RUSTC_LLVM_VERSION=210108 CONFIG_RUSTC_LLVM_MAJOR_VERSION=21 CONFIG_RUSTC_CLANG_LLVM_COMPATIBLE=y CONFIG_RUSTC_HAS_SPAN_FILE=y CONFIG_RUSTC_HAS_UNNECESSARY_TRANSMUTES=y CONFIG_RUSTC_HAS_FILE_WITH_NUL=y CONFIG_RUSTC_HAS_FILE_AS_C_STR=yCONFIG_RUST=yCONFIG_RUSTC_VERSION_TEXT=
"rustc 1.95.0 (59807616e 2026-04-14) (built from a source tarball)"CONFIG_HAVE_RUST=y CONFIG_HAVE_CFI_ICALL_NORMALIZE_INTEGERS_RUSTC=y
# CONFIG_RUST_FW_LOADER_ABSTRACTIONS is not set
# CONFIG_BLK_DEV_RUST_NULL is not set
# CONFIG_ANDROID_BINDER_IPC_RUST is not set
# CONFIG_RUST_BITMAP_HARDENED is not set
# CONFIG_FIND_BIT_BENCHMARK_RUST is not set
# CONFIG_RUST_DEBUG_ASSERTIONS is not set CONFIG_RUST_OVERFLOW_CHECKS=y
# CONFIG_RUST_BUILD_ASSERT_ALLOW is not set CONFIG_RUST_INLINE_HELPERS=y
I install linux-image and linux-header packages.
Yet with bcachefs-kernel-dkms up to 1:1.39.0 I see:
built without Rust support; this will be required in the near future - ensure a compatible Rust toolchain (rustc + bindgen + rust-src) is available at module build time
Would bcachefs-kernel-dkms use LLVM automatically? AFAIR I did not manage to have a kernel with Rust support using GCC which I used previously.
Best
Signature · 1 line
Martin
Greetings.
Martin Steigerwald - 06.08.26, 19:07:33 CEST:
Quoted 24 lines
I am building my own kernel with:
time eatmydata make LLVM=1 -j16 bindeb-pkg LOCALVERSION=-t14g5
I do have rustc and rust-src as of 1.95.0+dfsg1-2, bindgen as of 0.72.1-1+b2 on Devuan Ceres which is based on Debian Unstable aka Sid.
I am quite confident my kernel is build with rust support:
% grep
_RUST/boot/config-7.1.6-t14g5CONFIG_RUSTC_VERSION=109500CONFIG_RUST_IS_AVAILABLE=yCONFIG_RUSTC_LLVM_VERSION=210108CONFIG_RUSTC_LLVM_MAJOR_VERSION=21CONFIG_RUSTC_CLANG_LLVM_COMPATIBLE=yCONFIG_RUSTC_HAS_SPAN_FILE=yCONFIG_RUSTC_HAS_UNNECESSARY_TRANSMUTES=yCONFIG_RUSTC_HAS_FILE_WITH_NUL=yCONFIG_RUSTC_HAS_FILE_AS_C_STR=yCONFIG_RUST=yCONFIG_RUSTC_VERSION_TEXT=
"rustc 1.95.0 (59807616e2026-04-14) (built from a source tarball)"CONFIG_HAVE_RUST=yCONFIG_HAVE_CFI_ICALL_NORMALIZE_INTEGERS_RUSTC=y
[…]
Quoted 8 lines
CONFIG_RUST_OVERFLOW_CHECKS=y
#CONFIG_RUST_BUILD_ASSERT_ALLOWis not setCONFIG_RUST_INLINE_HELPERS=yI install linux-image and linux-header packages.
Yet with bcachefs-kernel-dkms up to 1:1.39.0 I see:
Quoted 7 lines
built without Rust support; this will be required in the near future - ensure a compatible Rust toolchain (rustc + bindgen + rust-src) is available at module build time
Would bcachefs-kernel-dkms use LLVM automatically? AFAIR I did not manage to have a kernel with Rust support using GCC which I used previously.
It does.
Also rust source files are being built into object files.
Also things like "rust/libcore.rmeta" are build.
Yet not included into linux-headers package.
So for some reason the Debian build does not include the necessary Rust files within the linux-headers.
This is why Rust build is disabled during DKMS module build as indicated by "make.log":
bcachefs: building without Rust — missing the kernel's prebuilt Rust stdlib (/usr/src/linux-headers-7.1.7-t14g5/rust/libcore.rmeta); the kernel was built/installed without its rust/ artifacts
I leave it at that for now.
Best,
Signature · 1 line
Martin