[PATCH v4 0/2] Change Rust Binder crate name to rust_binder

Alice Ryhl posted 2 patches 1 day, 8 hours ago
drivers/android/binder/rust_binder_main.rs |  2 ++
scripts/Makefile.build                     |  1 -
scripts/generate_rust_analyzer.py          | 46 ++++++++++++++++--------------
3 files changed, 26 insertions(+), 23 deletions(-)
[PATCH v4 0/2] Change Rust Binder crate name to rust_binder
Posted by Alice Ryhl 1 day, 8 hours ago
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@google.com>
---
Changes in v4:
- Rebase on rust-next.
- Link to v3: https://lore.kernel.org/r/20260323-binder-crate-name-v3-0-c6e00f239fb1@google.com

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@google.com

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@google.com

---
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          | 46 ++++++++++++++++--------------
 3 files changed, 26 insertions(+), 23 deletions(-)
---
base-commit: 3418d862679ac6da0b6bd681b18b3189c4fad20d
change-id: 20260224-binder-crate-name-15f14e134fca

Best regards,
-- 
Alice Ryhl <aliceryhl@google.com>
Re: [PATCH v4 0/2] Change Rust Binder crate name to rust_binder
Posted by Miguel Ojeda 9 hours ago
On Thu, Apr 2, 2026 at 12:55 PM Alice Ryhl <aliceryhl@google.com> wrote:
>
> 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.

Applied to `rust-next` -- thanks everyone!

    [ Applied Python type hints. - Miguel ]

Cheers,
Miguel