On 31.01.25 8:40 AM, Arnd Bergmann wrote: > On Thu, Jan 23, 2025, at 23:40, Christian Schrefl wrote: >> This commit allows building ARMv7 kernels with Rust support. >> >> The rust core library expects some __eabi_... functions >> that are not implemented in the kernel. >> Those functions are some float operations and __aeabi_uldivmod. >> For now those are implemented with define_panicking_intrinsics!. > > I see you are doing this part the same as the other architectures, > but I don't see why it's done like this in the first place: > > In C code, we really want to get a link failure rather than a > runtime error in order to catch those bugs as early as possible > and fix them before even trying to run the kernel. Is there a > reason this doesn't work in rust, or is there a plan to change > this later when the existing callers of those functions have > been fixed? I agree having a linker error instead of a runtime panic would be ideal, but it is currently impossible to build without these intrinsics. To fix this Rust would have to provide a way to build the core library without float support. I don't know if there is a plan already to allow this. > > 202397be76d8037b531b34dee16c7dfcfd0124ef..3375c91e698c024f95a85682f5a91d9815c355e5 >> 100644 >> --- a/arch/arm/Kconfig >> +++ b/arch/arm/Kconfig >> @@ -130,6 +130,7 @@ config ARM >> select MMU_GATHER_RCU_TABLE_FREE if SMP && ARM_LPAE >> select HAVE_REGS_AND_STACK_ACCESS_API >> select HAVE_RSEQ >> + select HAVE_RUST if CPU_LITTLE_ENDIAN && CPU_32v7 > > The ARMv7 dependency makes sense, but I think it needs > be disabled on combined v6/v7 kernels, like (CPU_V7 && !CPU_V6 && !CPU_V6K). That might be correct, I don't know much about the build system for the kernel. I've tried it and it still builds with this change. Also it should probably be relatively easy to support armv6 as well. Cheers Christian