Re: Package for development of out-of-tree kernel modules written in Rust
On Thu, Apr 03, 2025 at 11:08:08PM +0200, Miguel Ojeda wrote:
> On Thu, Apr 3, 2025 at 8:33 PM Bastian Blank <waldi@debian.org> 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?
C macros are read by the preprocessor shipped in the compiler. The
preprocessor changes it's behaviour depending on the input files.
However you don't recompile the preprocessor depending on the kernel
config.
But this is not what the macros crate is. This crate _is_ a custom
preprocessor. So, if it just reads the C macros the same way a C
preprocessor would, during compilation of the final result, then we
don't have a problem.
> What is the root issue here?
The root issue is: libmacros.so, the output file, must be independent
from the kernel config.
> > So, either "macros" is static and unchanging, then we can just build it
> > and don't care. Or it is dynamic, then it needs to be built next to the
> > external module and not be shipped at all.
> What "external module" are you referring to?
The one you build with "make M="
Bastian
--
Beam me up, Scotty, there's no intelligent life down here!
Reply to: