lkl / linux

Linux kernel source tree

Home Page:https://lkl.github.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Compilation under different kernel versions

96613686 opened this issue · comments

I copied arch/lkl and tools/lkl to the 6.0 kernel directory and had these problems when I tried to compile
What modifications do I need to make

AR /home/xxx/linux-6.0-rc3/tools/lkl/liblkl.a
LINK /home/xxx/linux-6.0-rc3/tools/lkl/lklfuse
/usr/bin/ld: /home/xxx/linux-6.0-rc3/tools/lkl/liblkl.a(lkl.o):(.data.rel.ro+0x9aa0): undefined reference to raid6_avx2x4' /usr/bin/ld: /home/xxx/linux-6.0-rc3/tools/lkl/liblkl.a(lkl.o):(.data.rel.ro+0x9aa8): undefined reference to raid6_avx2x2'
/usr/bin/ld: /home/xxx/linux-6.0-rc3/tools/lkl/liblkl.a(lkl.o):(.data.rel.ro+0x9ab0): undefined reference to raid6_avx2x1' /usr/bin/ld: /home/xxx/linux-6.0-rc3/tools/lkl/liblkl.a(lkl.o):(.data.rel.ro+0x9ab8): undefined reference to raid6_sse2x4'
/usr/bin/ld: /home/xxx/linux-6.0-rc3/tools/lkl/liblkl.a(lkl.o):(.data.rel.ro+0x9ac0): undefined reference to raid6_sse2x2' /usr/bin/ld: /home/xxx/linux-6.0-rc3/tools/lkl/liblkl.a(lkl.o):(.data.rel.ro+0x9ac8): undefined reference to raid6_sse2x1'
/usr/bin/ld: /usr/bin/ld: DWARF error: can't find .debug_ranges section.
/home/xxx/linux-6.0-rc3/tools/lkl/lklfuse-in.o: in function lklfuse_fallocate': lklfuse.c:(.text+0x17): undefined reference to lkl_sys_fallocate'
/usr/bin/ld: /home/xxx/linux-6.0-rc3/tools/lkl/lklfuse-in.o: in function lklfuse_utimens': lklfuse.c:(.text+0x51): undefined reference to lkl_sys_utimensat'
/usr/bin/ld: /home/xxx/linux-6.0-rc3/tools/lkl/lklfuse-in.o: in function lklfuse_open': lklfuse.c:(.text+0x82): undefined reference to lkl_sys_openat'
/usr/bin/ld: /home/xxx/linux-6.0-rc3/tools/lkl/lklfuse-in.o: in function lklfuse_access': lklfuse.c:(.text+0xad): undefined reference to lkl_sys_faccessat'
....

I have been able to solve this problem by referring to lib/raid6/algos.c in LKL.

#include <linux/module.h>
#include <linux/gfp.h>
#include <linux/cpu.h> //add this

#if defined(i386) && !defined(arch_um)
change
#ifdef CONFIG_X86_32

#if defined(x86_64) && !defined(arch_um)
change
#ifdef CONFIG_X86_64

#if defined(ia64)
change
#ifdef CONFIG_IA64