Welcome to the Linux Foundation Forum!

LINUX KERNEL build fail impossible to debug:

lfkd000
lfkd000 Posts: 4
edited August 2024 in Kernel Development

build error for kernel
The thing about building linux kernel is i have no idea where the error is and it does not tell clearly which file/line the error is coming from:
For example:

1)
Makefile:69: but there are so many makefiles in kernel source, it is impossible to tell which one?

2) make: *** [Makefile:1437: tools/objtool] Error 2
This above make one to believe it is a makefile in tools/objtool folder but there is a Makefile in there but it only has 71 lines.

WT...??

sudo make -j64
mkdir -p /home/nonroot/extdir/gg/git/kernelbuild/5.14.0-480.el9.x86_64/tools/objtool && make O=/home/nonroot/extdir/gg/git/kernelbuild/5.14.0-480.el9.x86_64 subdir=tools/objtool --no-print-directory -C objtool
make[2]: *** [Makefile:53: /home/nonroot/extdir/gg/git/kernelbuild/5.14.0-480.el9.x86_64/tools/objtool/objtool-in.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [Makefile:69: objtool] Error 2
make: *** [Makefile:1437: tools/objtool] Error 2
make: *** Waiting for unfinished jobs....
scripts/Makefile.build:415: warning: overriding recipe for target 'modules.order'
Makefile:1531: warning: ignoring old recipe for target 'modules.order'

Answers

  • lfkd000
    lfkd000 Posts: 4

    i managed to build with --debug option and found following but output seems too verbose and i could not make anything out of it...?

    (partial log)

    GNU Make 4.3
    Built for x86_64-redhat-linux-gnu
    Copyright (C) 1988-2020 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
    This is free software: you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law.
    Reading makefiles...
    Updating makefiles....
    Updating goal targets....
    File '__all' does not exist.
    File 'all' does not exist.
    File 'autoksyms_recursive' does not exist.
    Must remake target 'autoksyms_recursive'.
    Successfully remade target file 'autoksyms_recursive'.
    File 'descend' does not exist.
    File 'init' does not exist.
    File 'prepare' does not exist.
    File 'prepare0' does not exist.
    File 'archprepare' does not exist.
    File 'outputmakefile' does not exist.
    Must remake target 'outputmakefile'.
    Successfully remade target file 'outputmakefile'.
    File 'archheaders' does not exist.
    Must remake target 'archheaders'.
    File 'archscripts' does not exist.
    File 'scripts_basic' does not exist.
    Must remake target 'scripts_basic'.
    GNU Make 4.3
    Built for x86_64-redhat-linux-gnu
    Copyright (C) 1988-2020 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
    This is free software: you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law.
    Reading makefiles...
    Updating makefiles....
    Updating goal targets....
    File 'all' does not exist.
    File 'FORCE' does not exist.
    Must remake target 'FORCE'.
    Successfully remade target file 'FORCE'.
    Prerequisite 'FORCE' of target 'arch/x86/include/generated/uapi/asm/unistd_32.h' does not exist.
    Must remake target 'arch/x86/include/generated/uapi/asm/unistd_32.h'.
    Successfully remade target file 'arch/x86/include/generated/uapi/asm/unistd_32.h'.
    Prerequisite 'FORCE' of target 'arch/x86/include/generated/uapi/asm/unistd_64.h' does not exist.
    Must remake target 'arch/x86/include/generated/uapi/asm/unistd_64.h'.
    Successfully remade target file 'arch/x86/include/generated/uapi/asm/unistd_64.h'.
    Prerequisite 'FORCE' of target 'arch/x86/include/generated/uapi/asm/unistd_x32.h' does not exist.
    Must remake target 'arch/x86/include/generated/uapi/asm/unistd_x32.h'.
    Successfully remade target file 'arch/x86/include/generated/uapi/asm/unistd_x32.h'.
    Prerequisite 'FORCE' of target 'arch/x86/include/generated/asm/syscalls_32.h' does not exist.
    Must remake target 'arch/x86/include/generated/asm/syscalls_32.h'.
    Successfully remade target file 'arch/x86/include/generated/asm/syscalls_32.h'.
    Prerequisite 'FORCE' of target 'arch/x86/include/generated/asm/unistd_32_ia32.h' does not exist.
    Must remake target 'arch/x86/include/generated/asm/unistd_32_ia32.h'.
    Successfully remade target file 'arch/x86/include/generated/asm/unistd_32_ia32.h'.
    Prerequisite 'FORCE' of target 'arch/x86/include/generated/asm/unistd_64_x32.h' does not exist.
    Must remake target 'arch/x86/include/generated/asm/unistd_64_x32.h'.
    Successfully remade target file 'arch/x86/include/generated/asm/unistd_64_x32.h'.
    Prerequisite 'FORCE' of target 'arch/x86/include/generated/asm/syscalls_64.h' does not exist.
    Must remake target 'arch/x86/include/generated/asm/syscalls_64.h'.
    Successfully remade target file 'arch/x86/include/generated/asm/syscalls_64.h'.
    Prerequisite 'FORCE' of target 'arch/x86/include/generated/asm/xen-hypercalls.h' does not exist.
    Must remake target 'arch/x86/include/generated/asm/xen-hypercalls.h'.
    Successfully remade target file 'arch/x86/include/generated/asm/xen-hypercalls.h'.

  • That sounds incredibly frustrating, especially when the build process fails without giving any useful clues about the root cause. Sometimes checking unrelated system logs or dependency mismatches can reveal issues that the kernel output misses. I recently came across some interesting data while browsing Criminal Records Search and it reminded me how important detailed logging is when tracking down complex problems. Hopefully you can isolate the failing component and get a more actionable error message soon.

Categories

Upcoming Training