- 论坛徽章:
- 0
|
之前看到linux动态打补丁的帖子,在ubuntu上尝试了下,发现了个问题,请教大神们:
在32位的ubuntu14.04.1LTS上从官网上下载kpatch源码包,然后按照README将依赖包都安装了,然后make,报错退出,log:
mildren@mildrengong-virtual-PC:~/Downloads/kpatch-master$ make
make -C kpatch-build
make[1]: Entering directory `/home/mildren/Downloads/kpatch-master/kpatch-build'
gcc -MMD -MP -I../kmod/patch -Iinsn -Wall -g -c -o create-diff-object.o create-diff-object.c
create-diff-object.c: In function ‘kpatch_create_symbol_list’:
create-diff-object.c:455:6: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 8 has type ‘Elf64_Addr’ [-Wformat=]
ERROR("symbol %s at offset %lu within section %s, expected 0",
^
gcc -MMD -MP -I../kmod/patch -Iinsn -Wall -g -c -o lookup.o lookup.c
gcc -MMD -MP -I../kmod/patch -Iinsn -Wall -g -c -o insn/insn.o insn/insn.c
gcc -MMD -MP -I../kmod/patch -Iinsn -Wall -g -c -o insn/inat.o insn/inat.c
gcc -I../kmod/patch -Iinsn -Wall -g create-diff-object.o lookup.o insn/insn.o insn/inat.o -o create-diff-object -lelf
make[1]: Leaving directory `/home/mildren/Downloads/kpatch-master/kpatch-build'
make -C kpatch
make[1]: Entering directory `/home/mildren/Downloads/kpatch-master/kpatch'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/mildren/Downloads/kpatch-master/kpatch'
make -C kmod
make[1]: Entering directory `/home/mildren/Downloads/kpatch-master/kmod'
make -C core clean
make[2]: Entering directory `/home/mildren/Downloads/kpatch-master/kmod/core'
rm -f -Rf .*.o.cmd .*.ko.cmd .tmp_versions *.o *.ko *.mod.c \
Module.symvers
make[2]: Leaving directory `/home/mildren/Downloads/kpatch-master/kmod/core'
make -C core
make[2]: Entering directory `/home/mildren/Downloads/kpatch-master/kmod/core'
make -C /lib/modules/3.13.0-36-generic/build M=/home/mildren/Downloads/kpatch-master/kmod/core kpatch.ko
make[3]: Entering directory `/usr/src/linux-headers-3.13.0-36-generic'
CC [M] /home/mildren/Downloads/kpatch-master/kmod/core/core.o
/home/mildren/Downloads/kpatch-master/kmod/core/core.c:54:2: error: #error "CONFIG_FUNCTION_TRACER, CONFIG_HAVE_FENTRY, CONFIG_MODULES, CONFIG_SYSFS, CONFIG_KALLSYMS_ALL kernel config options are required"
#error "CONFIG_FUNCTION_TRACER, CONFIG_HAVE_FENTRY, CONFIG_MODULES, CONFIG_SYSFS, CONFIG_KALLSYMS_ALL kernel config options are required"
^
/home/mildren/Downloads/kpatch-master/kmod/core/core.c: In function ‘kpatch_write_relocations’:
/home/mildren/Downloads/kpatch-master/kmod/core/core.c:614:8: error: ‘R_X86_64_NONE’ undeclared (first use in this function)
case R_X86_64_NONE:
^
/home/mildren/Downloads/kpatch-master/kmod/core/core.c:614:8: note: each undeclared identifier is reported only once for each function it appears in
/home/mildren/Downloads/kpatch-master/kmod/core/core.c:616:8: error: ‘R_X86_64_PC32’ undeclared (first use in this function)
case R_X86_64_PC32:
^
/home/mildren/Downloads/kpatch-master/kmod/core/core.c:622:8: error: ‘R_X86_64_32S’ undeclared (first use in this function)
case R_X86_64_32S:
^
/home/mildren/Downloads/kpatch-master/kmod/core/core.c:627:8: error: ‘R_X86_64_64’ undeclared (first use in this function)
case R_X86_64_64:
^
/home/mildren/Downloads/kpatch-master/kmod/core/core.c:654:28: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
ret = probe_kernel_write((void *)loc, &val, size);
^
make[4]: *** [/home/mildren/Downloads/kpatch-master/kmod/core/core.o] Error 1
make[3]: *** [kpatch.ko] Error 2
make[3]: Leaving directory `/usr/src/linux-headers-3.13.0-36-generic'
make[2]: *** [kpatch.ko] Error 2
make[2]: Leaving directory `/home/mildren/Downloads/kpatch-master/kmod/core'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/mildren/Downloads/kpatch-master/kmod'
make: *** [build-kmod] Error 2
mildren@mildrengong-virtual-PC:~/Downloads/kpatch-master$
求大神解答 |
|