Re: [PATCH v10 5/5] rust: add arch_static_branch

From: Alice Ryhl
Date: Tue Oct 15 2024 - 09:07:23 EST


On Tue, Oct 15, 2024 at 2:11 PM Miguel Ojeda
<miguel.ojeda.sandonis@xxxxxxxxx> wrote:
>
> On Tue, Oct 15, 2024 at 1:06 PM kernel test robot <lkp@xxxxxxxxx> wrote:
> >
> > >> /bin/sh: 1: cannot create rust/kernel/arch_static_branch_asm.rs: Directory nonexistent
>
> This happens because we run `RSCPP` even when it is not a target. We
> can add the dependency conditionally:
>
> @@ -423,8 +425,10 @@ $(obj)/uapi.o: $(src)/uapi/lib.rs \
> $(obj)/kernel.o: private rustc_target_flags = --extern alloc \
> --extern build_error --extern macros --extern bindings --extern uapi
> $(obj)/kernel.o: $(src)/kernel/lib.rs $(obj)/alloc.o $(obj)/build_error.o \
> - $(obj)/libmacros.so $(obj)/bindings.o $(obj)/uapi.o \
> - $(obj)/kernel/arch_static_branch_asm.rs FORCE
> + $(obj)/libmacros.so $(obj)/bindings.o $(obj)/uapi.o FORCE
> +$(call if_changed_rule,rustc_library)
> +ifneq ($(CONFIG_JUMP_LABEL),)
> +$(obj)/kernel.o: $(obj)/kernel/arch_static_branch_asm.rs
> +endif

Thank you. I was able to reproduce the error locally. It only happens
when CONFIG_JUMP_LABEL is disabled. I've verified that this fixes it.

Alice