[PATCH v3 0/2] Change Rust Binder crate name to rust_binder
From: Alice Ryhl
Date: Mon Mar 23 2026 - 06:37:29 EST
Currently the crate name of the Rust Binder driver is rust_binder_main,
but I'd like it to be called rust_binder instead, matching the .ko file.
This affects e.g. symbol names in stack traces.
Thus, allow use of the #![crate_name] annotation, and set it for Rust
Binder.
I tried just using RUSTFLAGS_stem.o and RUSTFLAGS_REMOVE_stem.o, but
RUSTFLAGS_REMOVE_ is incapable of removing the --crate-name argument.
(Even after changing --crate-name to be passed with = instead of space
as the separator to the name.)
This cross-subsystem series is intended to be merged via rust-next.
Signed-off-by: Alice Ryhl <aliceryhl@xxxxxxxxxx>
---
Changes in v3:
- Move #![crate_name = "rust_binder] a few lines down.
- Expand on file names not changing in commit message.
- Make rust analyzer python script a bit cleaner.
- Link to v2: https://lore.kernel.org/r/20260310-binder-crate-name-v2-0-0f7c97900d36@xxxxxxxxxx
Changes in v2:
- Do not pass --crate-name and specify crate name using annotation
inside .rs file.
- Link to v1: https://lore.kernel.org/r/20260224-binder-crate-name-v1-0-7dfc1289abbd@xxxxxxxxxx
---
Alice Ryhl (2):
rust: support overriding crate_name
rust_binder: override crate name to rust_binder
drivers/android/binder/rust_binder_main.rs | 2 ++
scripts/Makefile.build | 1 -
scripts/generate_rust_analyzer.py | 28 +++++++++++++++++++---------
3 files changed, 21 insertions(+), 10 deletions(-)
---
base-commit: 1f318b96cc84d7c2ab792fcc0bfd42a7ca890681
change-id: 20260224-binder-crate-name-15f14e134fca
Best regards,
--
Alice Ryhl <aliceryhl@xxxxxxxxxx>