On 03/04/25 23:08, Miguel Ojeda wrote:
On Thu, Apr 3, 2025 at 8:33 PM Bastian Blank<[email protected]> wrote:
What the heck is this good for, where config dependency would be useful?
C macros in the kernel use the kernel config all the time, why would
this be different?
What is the root issue here?
I think the key issue here is Debian wants to support cross-compiling
out-of-tree kernel modules, but doing so with Rust modules requires one
to have libmacros.so compiled and packaged for the build architecture,
which in the context of cross-compilation is different than the target
architecture. Stuff for the build architecture is config-independent in
Debian's packaging and should probably remain so, as otherwise one would
need to build such stuff for every single build architecture + target
configuration (and arch) combination supported by Debian, which doesn't
scale up, if at all possible.
The difference with C is C does not compile macros into shared
libraries, so this issue does not arise. If libmacros.so (and more
generally, for the future, every proc macro) could be compiled not only
at kernel build time (which I understand is necessary anyway), but also
recompiled while the out-of-tree module is being compiled, then this
issue would not arise for Rust either. One could simply ship the headers
package without the proc macros, and rebuild the proc macros when needed.