Skip to contentSkip to conversation

loongarch64-linux-ld: kexec_core.c:undefined reference to `machine_kexec'

PATCH kernel test robot 3 participants 4 messages Nov 30, 2023

Subsystems (2)
lore
Share & tools
lore

kernel test robot

author build bot
#0 lore raw
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-unstable
head:   cb1d236cb1038fa1bbae9913803f1c655b86d931
commit: f8ff23429c625c2b2a134d87f490a89a98c544ce [25/192] kernel/Kconfig.kexec: drop select of KEXEC for CRASH_DUMP
config: loongarch-randconfig-r122-20231130 (https://download.01.org/0day-ci/archive/20231130/[email protected]/config)
compiler: loongarch64-linux-gcc (GCC) 13.2.0
reproduce: (https://download.01.org/0day-ci/archive/20231130/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All errors (new ones prefixed by >>):

loongarch64-linux-ld: kernel/kexec_core.o: in function `.L209':

>> kexec_core.c:(.text+0x1660): undefined reference to `machine_kexec_cleanup'
   loongarch64-linux-ld: kernel/kexec_core.o: in function `.L287':
>> kexec_core.c:(.text+0x1c5c): undefined reference to `machine_crash_shutdown'
>> loongarch64-linux-ld: kexec_core.c:(.text+0x1c64): undefined reference to `machine_kexec'
   loongarch64-linux-ld: kernel/kexec_core.o: in function `.L25':
>> kexec_core.c:(.text+0x2090): undefined reference to `machine_shutdown'

loongarch64-linux-ld: kexec_core.c:(.text+0x20a0): undefined reference to `machine_kexec'

Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
#1 lore raw
Quoted 14 lines · kernel test robot
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-unstable
head:   cb1d236cb1038fa1bbae9913803f1c655b86d931
commit: f8ff23429c625c2b2a134d87f490a89a98c544ce [25/192] kernel/Kconfig.kexec: drop select of KEXEC for CRASH_DUMP
config: loongarch-randconfig-r122-20231130 (https://download.01.org/0day-ci/archive/20231130/[email protected]/config)
compiler: loongarch64-linux-gcc (GCC) 13.2.0
reproduce: (https://download.01.org/0day-ci/archive/20231130/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All errors (new ones prefixed by >>):

Quoted 8 lines
   loongarch64-linux-ld: kernel/kexec_core.o: in function `.L209':
Quoted 1 line
Quoted 1 line

kexec_core.c:(.text+0x1660): undefined reference to `machine_kexec_cleanup'

loongarch64-linux-ld: kernel/kexec_core.o: in function `.L287':

Quoted 2 lines
Quoted 2 lines

kexec_core.c:(.text+0x1c5c): undefined reference to `machine_crash_shutdown'
loongarch64-linux-ld: kexec_core.c:(.text+0x1c64): undefined reference to `machine_kexec'

loongarch64-linux-ld: kernel/kexec_core.o: in function `.L25':

Quoted 1 line
Quoted 1 line

kexec_core.c:(.text+0x2090): undefined reference to `machine_shutdown'

loongarch64-linux-ld: kexec_core.c:(.text+0x20a0): undefined reference to `machine_kexec'

Thanks for report, below patch can fix it.

Hi Andrew,

There are several places in m68k, mips, sh architecture which have the similar issue. Would you prefer one patch to contain them all or separate patches for each architecture's fix?

From 0549728ffab3c2e75f71b4696fa6f9709a85b946 Mon Sep 17 00:00:00 2001
From: Baoquan He <[email protected]>
Date: Thu, 30 Nov 2023 16:22:46 +0800
Subject: [PATCH] LoongArch: change dependency of object files
Content-type: text/plain

Currently, in arch/loongarch/kernel/Makefile, building machine_kexec.o relocate_kernel.o depends on CONFIG_KEXEC.

Whereas, since we will drop the select of KEXEC for CRASH_DUMP in kernel/Kconfig.kexec, compiling error will be triggered if below config items are set:

===
CONFIG_CRASH_CORE=y
CONFIG_KEXEC_CORE=y
CONFIG_CRASH_DUMP=y
===

---------------------------------------------------------------
loongarch64-linux-ld: kernel/kexec_core.o: in function `.L209':

Quoted 1 line
Quoted 1 line

kexec_core.c:(.text+0x1660): undefined reference to `machine_kexec_cleanup'

loongarch64-linux-ld: kernel/kexec_core.o: in function `.L287':

Quoted 2 lines
Quoted 2 lines

kexec_core.c:(.text+0x1c5c): undefined reference to `machine_crash_shutdown'
loongarch64-linux-ld: kexec_core.c:(.text+0x1c64): undefined reference to `machine_kexec'

loongarch64-linux-ld: kernel/kexec_core.o: in function `.L2^B5':

Quoted 1 line
Quoted 1 line

kexec_core.c:(.text+0x2090): undefined reference to `machine_shutdown'

loongarch64-linux-ld: kexec_core.c:(.text+0x20a0): undefined reference to `machine_kexec'
---------------------------------------------------------------

Here, changing the dependency of machine_kexec.o relocate_kernel.o to CONFIG_KEXEC_CORE can fix above building error.

---
 arch/loongarch/kernel/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/loongarch/kernel/Makefile +1 -1
index 4fcc168f0732..3c808c680370 100644
@@ -57,7 +57,7 @@ obj-$(CONFIG_MAGIC_SYSRQ)	+= sysrq.o
 
 obj-$(CONFIG_RELOCATABLE)	+= relocate.o
 
-obj-$(CONFIG_KEXEC)		+= machine_kexec.o relocate_kernel.o
+obj-$(CONFIG_KEXEC_CORE)	+= machine_kexec.o relocate_kernel.o
 obj-$(CONFIG_CRASH_DUMP)	+= crash_dump.o
 
 obj-$(CONFIG_UNWINDER_GUESS)	+= unwind_guess.o
Signature · 1 line
2.41.0
maintainer
#2 lore raw
Quoted 3 lines · On Thu, 30 Nov 2023 16:43:00 +0800 Baoquan He <[email protected]> wrote:

There are several places in m68k, mips, sh architecture which have the similar issue. Would you prefer one patch to contain them all or separate patches for each architecture's fix?

Doesn't matter much. I guess a single patch would save some electrons.

#3 lore raw
Quoted 7 lines · Andrew Morton
Quoted 3 lines · On Thu, 30 Nov 2023 16:43:00 +0800 Baoquan He <[email protected]> wrote:

There are several places in m68k, mips, sh architecture which have the similar issue. Would you prefer one patch to contain them all or separate patches for each architecture's fix?

Doesn't matter much. I guess a single patch would save some electrons.

Sure, will post one patch to include them all. Thanks.