Interestingly I have a similar problem on CentOS 7 when trying to
compile kpatch for kernel 4.9:




```

~/git/kpatch # uname -aLinux nas 4.9.0-1.el7.elrepo.x86_64 #1 SMP Sun
Dec 11 15:43:54 EST 2016 x86_64 x86_64 x86_64 GNU/Linux


~/git/kpatch # make

make -C kpatch-build

make[1]: Entering directory `/root/git/kpatch/kpatch-build'

make[1]: Nothing to be done for `all'.

make[1]: Leaving directory `/root/git/kpatch/kpatch-build'

make -C kpatch

make[1]: Entering directory `/root/git/kpatch/kpatch'

make[1]: Nothing to be done for `all'.

make[1]: Leaving directory `/root/git/kpatch/kpatch'

make -C kmod

make[1]: Entering directory `/root/git/kpatch/kmod'

make -C core clean

make[2]: Entering directory `/root/git/kpatch/kmod/core'

rm -f -Rf .*.o.cmd .*.ko.cmd .tmp_versions *.o *.ko *.mod.c \

Module.symvers

make[2]: Leaving directory `/root/git/kpatch/kmod/core'

make -C core

make[2]: Entering directory `/root/git/kpatch/kmod/core'

make -C /lib/modules/4.9.0-1.el7.elrepo.x86_64/build
M=/root/git/kpatch/kmod/core kpatch.ko
make[3]: Entering directory `/usr/src/kernels/4.9.0-1.el7.elrepo.x86_64'
  CC [M]  /root/git/kpatch/kmod/core/core.o

/root/git/kpatch/kmod/core/core.c:273:21: error: variable
‘kpatch_backtrace_ops’ has initializer but incomplete type
static const struct stacktrace_ops kpatch_backtrace_ops = {

                     ^

/root/git/kpatch/kmod/core/core.c:274:2: error: unknown field ‘address’
specified in initializer
  .address = kpatch_backtrace_address_verify,

  ^

/root/git/kpatch/kmod/core/core.c:274:2: warning: excess elements in
struct initializer [enabled by default]
/root/git/kpatch/kmod/core/core.c:274:2: warning: (near initialization
for ‘kpatch_backtrace_ops’) [enabled by default]
/root/git/kpatch/kmod/core/core.c:275:2: error: unknown field ‘stack’
specified in initializer
  .stack  = kpatch_backtrace_stack,

  ^

/root/git/kpatch/kmod/core/core.c:275:2: warning: excess elements in
struct initializer [enabled by default]
/root/git/kpatch/kmod/core/core.c:275:2: warning: (near initialization
for ‘kpatch_backtrace_ops’) [enabled by default]
/root/git/kpatch/kmod/core/core.c:276:2: error: unknown field
‘walk_stack’ specified in initializer
  .walk_stack = print_context_stack_bp,

  ^

/root/git/kpatch/kmod/core/core.c:276:16: error:
‘print_context_stack_bp’ undeclared here (not in a function)
  .walk_stack = print_context_stack_bp,

                ^

/root/git/kpatch/kmod/core/core.c:276:2: warning: excess elements in
struct initializer [enabled by default]
  .walk_stack = print_context_stack_bp,

  ^

/root/git/kpatch/kmod/core/core.c:276:2: warning: (near initialization
for ‘kpatch_backtrace_ops’) [enabled by default]
/root/git/kpatch/kmod/core/core.c:303:21: error: variable
‘kpatch_print_trace_ops’ has initializer but incomplete type
static const struct stacktrace_ops kpatch_print_trace_ops = {

                     ^

/root/git/kpatch/kmod/core/core.c:304:2: error: unknown field ‘stack’
specified in initializer
  .stack  = kpatch_print_trace_stack,

  ^

/root/git/kpatch/kmod/core/core.c:304:2: warning: excess elements in
struct initializer [enabled by default]
/root/git/kpatch/kmod/core/core.c:304:2: warning: (near initialization
for ‘kpatch_print_trace_ops’) [enabled by default]
/root/git/kpatch/kmod/core/core.c:305:2: error: unknown field ‘address’
specified in initializer
  .address = kpatch_print_trace_address,

  ^

/root/git/kpatch/kmod/core/core.c:305:2: warning: excess elements in
struct initializer [enabled by default]
/root/git/kpatch/kmod/core/core.c:305:2: warning: (near initialization
for ‘kpatch_print_trace_ops’) [enabled by default]
/root/git/kpatch/kmod/core/core.c:306:2: error: unknown field
‘walk_stack’ specified in initializer
  .walk_stack = print_context_stack,

  ^

/root/git/kpatch/kmod/core/core.c:306:16: error: ‘print_context_stack’
undeclared here (not in a function)
  .walk_stack = print_context_stack,

                ^

/root/git/kpatch/kmod/core/core.c:306:2: warning: excess elements in
struct initializer [enabled by default]
  .walk_stack = print_context_stack,

  ^

/root/git/kpatch/kmod/core/core.c:306:2: warning: (near initialization
for ‘kpatch_print_trace_ops’) [enabled by default]
/root/git/kpatch/kmod/core/core.c: In function
‘kpatch_verify_activeness_safety’:
/root/git/kpatch/kmod/core/core.c:327:3: error: implicit declaration of
function ‘dump_trace’ [-Werror=implicit-function-declaration]
   dump_trace(t, NULL, NULL, 0, &kpatch_backtrace_ops, &args);

   ^

cc1: some warnings being treated as errors

make[4]: *** [/root/git/kpatch/kmod/core/core.o] Error 1

make[3]: *** [kpatch.ko] Error 2

make[3]: Leaving directory `/usr/src/kernels/4.9.0-1.el7.elrepo.x86_64'
make[2]: *** [kpatch.ko] Error 2

make[2]: Leaving directory `/root/git/kpatch/kmod/core'

make[1]: *** [all] Error 2

make[1]: Leaving directory `/root/git/kpatch/kmod'

make: *** [build-kmod] Error 2

```

Reply via email to