kernel-patches icon indicating copy to clipboard operation
kernel-patches copied to clipboard

Build failure when compiling 5.18 with 0001-bcachefs-after-lru.patch and bcachefs as module

Open Daedalusspacegames opened this issue 3 years ago • 6 comments

Using linux-tkg with 0001-bcachefs-after-lru.patch applied as a userpatch. Patch appears to apply with no issues, and compile occurs without incident or error until this point:

*snip*
  GEN     .version
  CHK     include/generated/compile.h
  LD      vmlinux.o
  OBJTOOL vmlinux.o
  MODPOST vmlinux.symvers
  MODINFO modules.builtin.modinfo
  GEN     modules.builtin
  LD      .tmp_vmlinux.btf
  BTF     .btf.vmlinux.bin.o
  LD      .tmp_vmlinux.kallsyms1
  KSYMS   .tmp_vmlinux.kallsyms1.S
  AS      .tmp_vmlinux.kallsyms1.S
  LD      .tmp_vmlinux.kallsyms2
  KSYMS   .tmp_vmlinux.kallsyms2.S
  AS      .tmp_vmlinux.kallsyms2.S
  LD      vmlinux
  BTFIDS  vmlinux
  SYSMAP  System.map
  SORTTAB vmlinux
  MODPOST modules-only.symvers
  HOSTCC  arch/x86/tools/insn_decoder_test
  HOSTCC  arch/x86/tools/insn_sanity
  TEST    posttest
arch/x86/tools/insn_decoder_test: success: Decoded and checked 5508460 instructions
  TEST    posttest
arch/x86/tools/insn_sanity: Success: decoded and checked 1000000 random instructions with 0 errors (seed:0x274249d0)
  CC      arch/x86/boot/a20.o
  CC      arch/x86/boot/cmdline.o
  AS      arch/x86/boot/bioscall.o
  HOSTCC  arch/x86/boot/mkcpustr
  AS      arch/x86/boot/copy.o
  CC      arch/x86/boot/cpuflags.o
  CC      arch/x86/boot/cpucheck.o
  CC      arch/x86/boot/early_serial_console.o
  CC      arch/x86/boot/edd.o
  CC      arch/x86/boot/main.o
  CC      arch/x86/boot/memory.o
  CC      arch/x86/boot/pm.o
  AS      arch/x86/boot/pmjump.o
  CC      arch/x86/boot/printf.o
  CC      arch/x86/boot/regs.o
  LDS     arch/x86/boot/compressed/vmlinux.lds
  AS      arch/x86/boot/compressed/kernel_info.o
  CC      arch/x86/boot/string.o
  AS      arch/x86/boot/compressed/head_64.o
  VOFFSET arch/x86/boot/compressed/../voffset.h
  CC      arch/x86/boot/tty.o
  CC      arch/x86/boot/video.o
  CC      arch/x86/boot/compressed/string.o
  CC      arch/x86/boot/video-mode.o
  CC      arch/x86/boot/version.o
  CC      arch/x86/boot/compressed/cmdline.o
  CC      arch/x86/boot/compressed/error.o
  CC      arch/x86/boot/video-vga.o
  OBJCOPY arch/x86/boot/compressed/vmlinux.bin
  CC      arch/x86/boot/video-vesa.o
  RELOCS  arch/x86/boot/compressed/vmlinux.relocs
  CC      arch/x86/boot/video-bios.o
  HOSTCC  arch/x86/boot/compressed/mkpiggy
  CC      arch/x86/boot/compressed/cpuflags.o
  HOSTCC  arch/x86/boot/tools/build
  CC      arch/x86/boot/compressed/early_serial_console.o
  CC      arch/x86/boot/compressed/kaslr.o
  CC      arch/x86/boot/compressed/ident_map_64.o
  CC      arch/x86/boot/compressed/idt_64.o
  CPUSTR  arch/x86/boot/cpustr.h
  AS      arch/x86/boot/compressed/idt_handlers_64.o
  AS      arch/x86/boot/compressed/mem_encrypt.o
  CC      arch/x86/boot/compressed/pgtable_64.o
  CC      arch/x86/boot/compressed/sev.o
  CC      arch/x86/boot/compressed/acpi.o
  AS      arch/x86/boot/compressed/efi_thunk_64.o
  CC      arch/x86/boot/cpu.o
  CC      arch/x86/boot/compressed/misc.o
  ZSTD22  arch/x86/boot/compressed/vmlinux.bin.zst
  MKPIGGY arch/x86/boot/compressed/piggy.S
  AS      arch/x86/boot/compressed/piggy.o
  LD      arch/x86/boot/compressed/vmlinux
  ZOFFSET arch/x86/boot/zoffset.h
  OBJCOPY arch/x86/boot/vmlinux.bin
  AS      arch/x86/boot/header.o
  LD      arch/x86/boot/setup.elf
  OBJCOPY arch/x86/boot/setup.bin
  BUILD   arch/x86/boot/bzImage
Kernel: arch/x86/boot/bzImage is ready  (#1)
ERROR: modpost: "stack_trace_save_tsk" [fs/bcachefs/bcachefs.ko] undefined!
make[1]: *** [scripts/Makefile.modpost:134: modules-only.symvers] Error 1
make[1]: *** Deleting file 'modules-only.symvers'
make: *** [Makefile:1753: modules] Error 2
  DESCEND bpf/resolve_btfids
  DESCEND objtool
  CALL    scripts/atomic/check-atomics.sh
  CALL    scripts/checksyscalls.sh
  CHK     include/generated/compile.h
  CHK     kernel/kheaders_data.tar.xz
  TEST    posttest
  MODPOST modules-only.symvers
ERROR: modpost: "stack_trace_save_tsk" [fs/bcachefs/bcachefs.ko] undefined!
make[1]: *** [scripts/Makefile.modpost:134: modules-only.symvers] Error 1
make[1]: *** Deleting file 'modules-only.symvers'
make: *** [Makefile:1753: modules] Error 2
make: *** Waiting for unfinished jobs....
arch/x86/tools/insn_decoder_test: success: Decoded and checked 5508460 instructions
  TEST    posttest
arch/x86/tools/insn_sanity: Success: decoded and checked 1000000 random instructions with 0 errors (seed:0x481afe38)
Kernel: arch/x86/boot/bzImage is ready  (#1)
==> ERROR: A failure occurred in build().
    Aborting...

Edit: In case this is relevant to the issue, I'm compiling the kernel with GCC 12.1.0

Daedalusspacegames avatar Jun 30 '22 01:06 Daedalusspacegames

Hey @Daedalusspacegames

I will merge the latest kernel tree and will run a test compile.

Thanks for the report

ptr1337 avatar Jun 30 '22 01:06 ptr1337

I should clarify as well (I thought I had included this in my original message), that I have configured bcachefs to compile as a module to be consistent with both linux-tkg's (outdated) bcachefs support and other filesystems in the Arch Config. I noticed that the default config for CachyOS's kernels compile with bcachefs support built-in, rather than as a module, so I'm guessing this is likely how this issue went unnoticed.

Daedalusspacegames avatar Jun 30 '22 01:06 Daedalusspacegames

Actually it seems to be a issue through the latest changes of the modpost:

https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/diff/Makefile?id=v5.18.8&id2=v5.18.7 https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/diff/scripts/mod/modpost.c?id=v5.18.8&id2=v5.18.7

Maybe create a issue here: https://github.com/koverstreet/bcachefs/issues

It did happen at me also - with enabled or as module. We need to wait for upstream fixes I feel like

ptr1337 avatar Jun 30 '22 01:06 ptr1337

Not a single new commit to bcachefs has come out for a few days, perhaps the developers know the problem and are working on it. As @ptr1337 suggested, report the bug to the bcachefs developers.

sirlucjan avatar Jun 30 '22 07:06 sirlucjan

Actually there seems already to be a issue - you can find it here: https://github.com/koverstreet/bcachefs/issues/429

Building it as a builtin module seems currently the solution for. Personally when I did tested that I had issue when building with with clang. It seems to be good to go with gcc or it has ben fixed in the 5.18.9-rc1

ptr1337 avatar Jul 01 '22 01:07 ptr1337

@Daedalusspacegames

Should be fixed with https://github.com/ptr1337/kernel-patches/commit/dee821fc13096ee9ea620547f08977b95abda915 But it does probably just apply fine on linux-cachyos kernels. Ill update the other one at misc/ also in some minutes

ptr1337 avatar Jul 22 '22 12:07 ptr1337