• Li Zhengyu's avatar
    RISC-V: kexec: Fix build error without CONFIG_KEXEC · 3a66a087
    Li Zhengyu authored
    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: default avatarLi Zhengyu <lizhengyu3@huawei.com>
    Reviewed-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
    Acked-by: default avatarRandy Dunlap <rdunlap@infradead.org>
    Tested-by: default avatarRandy Dunlap <rdunlap@infradead.org>
    Link: https://lore.kernel.org/r/20220601070204.26882-1-lizhengyu3@huawei.com
    Fixes: 6261586e ("RISC-V: Add kexec_file support")
    Cc: stable@vger.kernel.org
    Signed-off-by: default avatarPalmer Dabbelt <palmer@rivosinc.com>
    3a66a087
Makefile 2.36 KB