Currently Binder only builds as built-in module, but in downstream
Android branches we update the build system to make Rust Binder
buildable as a module. The same situation applies to distros, as there
are many distros that enable Binder for support of apps such as
waydroid, which would benefit from the ability to build Binder as a
module.
Note that although the situation in Android may be temporary - once we
no longer have a C implementation, it makes sense for Rust Binder to be
built-in. But that will both take a while, and in any case, distros
enabling Binder will benefit from it being a module even if Android goes
back to built-in.
This doesn't mark C Binder buildable as a module. That would require
more intrusive Makefile changes as it's built from multiple objects, and
I'm not sure there's any way to produce a file called 'binder.ko'
containing all of those objects linked together without renaming
'binder.c', as right now there will be naming conflicts between the
object built from binder.c, and the object that results from linking
binder.o,binderfs.o,binder_alloc.o and so on together. (As an aside,
this issue is why the Rust Binder entry-point is called
rust_binder_main.rs instead of just rust_binder.rs)
Signed-off-by: Alice Ryhl <aliceryhl@google.com>
---
drivers/android/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/android/Kconfig b/drivers/android/Kconfig
index e2e402c9d1759c81591473ad02ab7ad011bc61d0..3c1755e53195b0160d0ed244f078eed96e16272c 100644
--- a/drivers/android/Kconfig
+++ b/drivers/android/Kconfig
@@ -15,7 +15,7 @@ config ANDROID_BINDER_IPC
between said processes.
config ANDROID_BINDER_IPC_RUST
- bool "Rust version of Android Binder IPC Driver"
+ tristate "Rust version of Android Binder IPC Driver"
depends on RUST && MMU && !ANDROID_BINDER_IPC
help
This enables the Rust implementation of the Binder driver.
--
2.53.0.rc2.204.g2597b5adb4-goog
On Thu Feb 5, 2026 at 10:51 AM GMT, Alice Ryhl wrote: > Currently Binder only builds as built-in module, but in downstream > Android branches we update the build system to make Rust Binder > buildable as a module. The same situation applies to distros, as there > are many distros that enable Binder for support of apps such as > waydroid, which would benefit from the ability to build Binder as a > module. > > Note that although the situation in Android may be temporary - once we > no longer have a C implementation, it makes sense for Rust Binder to be > built-in. But that will both take a while, and in any case, distros > enabling Binder will benefit from it being a module even if Android goes > back to built-in. > > This doesn't mark C Binder buildable as a module. That would require > more intrusive Makefile changes as it's built from multiple objects, and > I'm not sure there's any way to produce a file called 'binder.ko' > containing all of those objects linked together without renaming > 'binder.c', as right now there will be naming conflicts between the > object built from binder.c, and the object that results from linking > binder.o,binderfs.o,binder_alloc.o and so on together. (As an aside, > this issue is why the Rust Binder entry-point is called > rust_binder_main.rs instead of just rust_binder.rs) > > Signed-off-by: Alice Ryhl <aliceryhl@google.com> > --- > drivers/android/Kconfig | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/android/Kconfig b/drivers/android/Kconfig > index e2e402c9d1759c81591473ad02ab7ad011bc61d0..3c1755e53195b0160d0ed244f078eed96e16272c 100644 > --- a/drivers/android/Kconfig > +++ b/drivers/android/Kconfig > @@ -15,7 +15,7 @@ config ANDROID_BINDER_IPC > between said processes. > > config ANDROID_BINDER_IPC_RUST > - bool "Rust version of Android Binder IPC Driver" > + tristate "Rust version of Android Binder IPC Driver" > depends on RUST && MMU && !ANDROID_BINDER_IPC > help > This enables the Rust implementation of the Binder driver. Hi Alice, AFAIK Rust binder doesn't specifically handle module unloading, so global statics (e.g. CONTEXTS doesn't get dropped). If we're going to build Binder as module, we need to ensure that we have the mechanism in the module macro to prevent unloading of Binder. Best, Gary
© 2016 - 2026 Red Hat, Inc.