diff mbox series

RISC-V: kexec: Fix build error without CONFIG_KEXEC

Message ID 20220601070204.26882-1-lizhengyu3@huawei.com (mailing list archive)
State New, archived
Headers show
Series RISC-V: kexec: Fix build error without CONFIG_KEXEC | expand

Commit Message

Li Zhengyu June 1, 2022, 7:02 a.m. UTC
When CONFIG_KEXEC_FILE=y but CONFIG_KEXEC is not set:

kernel/kexec_core.o: In function `kimage_free':
kexec_core.c:(.text+0xa0c): undefined reference to `machine_kexec_cleanup'
kernel/kexec_core.o: In function `.L0 ':
kexec_core.c:(.text+0xde8): undefined reference to `machine_crash_shutdown'
kexec_core.c:(.text+0xdf4): undefined reference to `machine_kexec'
kernel/kexec_core.o: In function `.L231':
kexec_core.c:(.text+0xe1c): undefined reference to `riscv_crash_save_regs'
kernel/kexec_core.o: In function `.L0 ':
kexec_core.c:(.text+0x119e): undefined reference to `machine_shutdown'
kernel/kexec_core.o: In function `.L312':
kexec_core.c:(.text+0x11b2): undefined reference to `machine_kexec'
kernel/kexec_file.o: In function `.L0 ':
kexec_file.c:(.text+0xb84): undefined reference to `machine_kexec_prepare'
kernel/kexec_file.o: In function `.L177':
kexec_file.c:(.text+0xc5a): undefined reference to `machine_kexec_prepare'
Makefile:1160: recipe for target 'vmlinux' failed
make: *** [vmlinux] Error 1

These symbols should depend on CONFIG_KEXEC_CORE rather than CONFIG_KEXEC
when kexec_file has been implemented on RISC-V, like the other archs have
done.

Signed-off-by: Li Zhengyu <lizhengyu3@huawei.com>
---
 arch/riscv/kernel/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Randy Dunlap June 1, 2022, 3:59 p.m. UTC | #1
On 6/1/22 00:02, Li Zhengyu wrote:
> When CONFIG_KEXEC_FILE=y but CONFIG_KEXEC is not set:
> 
> kernel/kexec_core.o: In function `kimage_free':
> kexec_core.c:(.text+0xa0c): undefined reference to `machine_kexec_cleanup'
> kernel/kexec_core.o: In function `.L0 ':
> kexec_core.c:(.text+0xde8): undefined reference to `machine_crash_shutdown'
> kexec_core.c:(.text+0xdf4): undefined reference to `machine_kexec'
> kernel/kexec_core.o: In function `.L231':
> kexec_core.c:(.text+0xe1c): undefined reference to `riscv_crash_save_regs'
> kernel/kexec_core.o: In function `.L0 ':
> kexec_core.c:(.text+0x119e): undefined reference to `machine_shutdown'
> kernel/kexec_core.o: In function `.L312':
> kexec_core.c:(.text+0x11b2): undefined reference to `machine_kexec'
> kernel/kexec_file.o: In function `.L0 ':
> kexec_file.c:(.text+0xb84): undefined reference to `machine_kexec_prepare'
> kernel/kexec_file.o: In function `.L177':
> kexec_file.c:(.text+0xc5a): undefined reference to `machine_kexec_prepare'
> Makefile:1160: recipe for target 'vmlinux' failed
> make: *** [vmlinux] Error 1
> 
> These symbols should depend on CONFIG_KEXEC_CORE rather than CONFIG_KEXEC
> when kexec_file has been implemented on RISC-V, like the other archs have
> done.
> 
> Signed-off-by: Li Zhengyu <lizhengyu3@huawei.com>

Reported-by: Randy Dunlap <rdunlap@infradead.org>
Tested-by: Randy Dunlap <rdunlap@infradead.org>
Acked-by: Randy Dunlap <rdunlap@infradead.org>

thanks.

> ---
>  arch/riscv/kernel/Makefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/riscv/kernel/Makefile b/arch/riscv/kernel/Makefile
> index c71d6591d539..33bb60a354cd 100644
> --- a/arch/riscv/kernel/Makefile
> +++ b/arch/riscv/kernel/Makefile
> @@ -78,7 +78,7 @@ obj-$(CONFIG_SMP) += cpu_ops_sbi.o
>  endif
>  obj-$(CONFIG_HOTPLUG_CPU)	+= cpu-hotplug.o
>  obj-$(CONFIG_KGDB)		+= kgdb.o
> -obj-$(CONFIG_KEXEC)		+= kexec_relocate.o crash_save_regs.o machine_kexec.o
> +obj-$(CONFIG_KEXEC_CORE)	+= kexec_relocate.o crash_save_regs.o machine_kexec.o
>  obj-$(CONFIG_KEXEC_FILE)	+= elf_kexec.o machine_kexec_file.o
>  obj-$(CONFIG_CRASH_DUMP)	+= crash_dump.o
>
Masahiro Yamada June 16, 2022, 2:21 a.m. UTC | #2
On Thu, Jun 2, 2022 at 1:00 AM Randy Dunlap <rdunlap@infradead.org> wrote:
>
>
>
> On 6/1/22 00:02, Li Zhengyu wrote:
> > When CONFIG_KEXEC_FILE=y but CONFIG_KEXEC is not set:
> >
> > kernel/kexec_core.o: In function `kimage_free':
> > kexec_core.c:(.text+0xa0c): undefined reference to `machine_kexec_cleanup'
> > kernel/kexec_core.o: In function `.L0 ':
> > kexec_core.c:(.text+0xde8): undefined reference to `machine_crash_shutdown'
> > kexec_core.c:(.text+0xdf4): undefined reference to `machine_kexec'
> > kernel/kexec_core.o: In function `.L231':
> > kexec_core.c:(.text+0xe1c): undefined reference to `riscv_crash_save_regs'
> > kernel/kexec_core.o: In function `.L0 ':
> > kexec_core.c:(.text+0x119e): undefined reference to `machine_shutdown'
> > kernel/kexec_core.o: In function `.L312':
> > kexec_core.c:(.text+0x11b2): undefined reference to `machine_kexec'
> > kernel/kexec_file.o: In function `.L0 ':
> > kexec_file.c:(.text+0xb84): undefined reference to `machine_kexec_prepare'
> > kernel/kexec_file.o: In function `.L177':
> > kexec_file.c:(.text+0xc5a): undefined reference to `machine_kexec_prepare'
> > Makefile:1160: recipe for target 'vmlinux' failed
> > make: *** [vmlinux] Error 1
> >
> > These symbols should depend on CONFIG_KEXEC_CORE rather than CONFIG_KEXEC
> > when kexec_file has been implemented on RISC-V, like the other archs have
> > done.
> >
> > Signed-off-by: Li Zhengyu <lizhengyu3@huawei.com>
>
> Reported-by: Randy Dunlap <rdunlap@infradead.org>
> Tested-by: Randy Dunlap <rdunlap@infradead.org>
> Acked-by: Randy Dunlap <rdunlap@infradead.org>
>
> thanks.
>
> > ---
> >  arch/riscv/kernel/Makefile | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/arch/riscv/kernel/Makefile b/arch/riscv/kernel/Makefile
> > index c71d6591d539..33bb60a354cd 100644
> > --- a/arch/riscv/kernel/Makefile
> > +++ b/arch/riscv/kernel/Makefile
> > @@ -78,7 +78,7 @@ obj-$(CONFIG_SMP) += cpu_ops_sbi.o
> >  endif
> >  obj-$(CONFIG_HOTPLUG_CPU)    += cpu-hotplug.o
> >  obj-$(CONFIG_KGDB)           += kgdb.o
> > -obj-$(CONFIG_KEXEC)          += kexec_relocate.o crash_save_regs.o machine_kexec.o
> > +obj-$(CONFIG_KEXEC_CORE)     += kexec_relocate.o crash_save_regs.o machine_kexec.o
> >  obj-$(CONFIG_KEXEC_FILE)     += elf_kexec.o machine_kexec_file.o
> >  obj-$(CONFIG_CRASH_DUMP)     += crash_dump.o
> >
>
> --
> ~Randy


Perhaps, worth this:

Fixes: 6261586e0c91 ("RISC-V: Add kexec_file support")



Reviewed-by: Masahiro Yamada <masahiroy@kernel.org>
diff mbox series

Patch

diff --git a/arch/riscv/kernel/Makefile b/arch/riscv/kernel/Makefile
index c71d6591d539..33bb60a354cd 100644
--- a/arch/riscv/kernel/Makefile
+++ b/arch/riscv/kernel/Makefile
@@ -78,7 +78,7 @@  obj-$(CONFIG_SMP) += cpu_ops_sbi.o
 endif
 obj-$(CONFIG_HOTPLUG_CPU)	+= cpu-hotplug.o
 obj-$(CONFIG_KGDB)		+= kgdb.o
-obj-$(CONFIG_KEXEC)		+= kexec_relocate.o crash_save_regs.o machine_kexec.o
+obj-$(CONFIG_KEXEC_CORE)	+= kexec_relocate.o crash_save_regs.o machine_kexec.o
 obj-$(CONFIG_KEXEC_FILE)	+= elf_kexec.o machine_kexec_file.o
 obj-$(CONFIG_CRASH_DUMP)	+= crash_dump.o