Welcome to the Linux Foundation Forum!

Kernel compilation error on Arch, any idea how to make it pass?

➜  linux_stable git:(linux-5.12.y) make -j3 all
  SYNC    include/config/auto.conf
  DESCEND  objtool
  DESCEND  bpf/resolve_btfids
In file included from help.c:12:
subcmd-util.h: In function ‘xrealloc’:
subcmd-util.h:58:31: error: pointer ‘ptr’ may be used after ‘realloc’ [-Werror=use-after-free]
   58 |                         ret = realloc(ptr, 1);
      |                               ^~~~~~~~~~~~~~~
subcmd-util.h:52:21: note: call to ‘realloc’ here
   52 |         void *ret = realloc(ptr, size);
      |                     ^~~~~~~~~~~~~~~~~~
subcmd-util.h:56:23: error: pointer ‘ptr’ may be used after ‘realloc’ [-Werror=use-after-free]
   56 |                 ret = realloc(ptr, size);
      |                       ^~~~~~~~~~~~~~~~~~
subcmd-util.h:52:21: note: call to ‘realloc’ here
   52 |         void *ret = realloc(ptr, size);
      |                     ^~~~~~~~~~~~~~~~~~
In file included from help.c:12:
subcmd-util.h: In function ‘xrealloc’:
subcmd-util.h:58:31: error: pointer ‘ptr’ may be used after ‘realloc’ [-Werror=use-after-free]
   58 |                         ret = realloc(ptr, 1);
      |                               ^~~~~~~~~~~~~~~
subcmd-util.h:52:21: note: call to ‘realloc’ here
   52 |         void *ret = realloc(ptr, size);
      |                     ^~~~~~~~~~~~~~~~~~
subcmd-util.h:56:23: error: pointer ‘ptr’ may be used after ‘realloc’ [-Werror=use-after-free]
   56 |                 ret = realloc(ptr, size);
      |                       ^~~~~~~~~~~~~~~~~~
subcmd-util.h:52:21: note: call to ‘realloc’ here
   52 |         void *ret = realloc(ptr, size);
      |                     ^~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make[4]: *** [/home/nanonej/Projects/linux_work/linux_stable/tools/build/Makefile.build:97: /home/nanonej/Projects/linux_work/linux_stable/tools/bpf/resolve_btfids/libsubcmd/help.o] Error 1
make[4]: *** Waiting for unfinished jobs....
cc1: all warnings being treated as errors
make[4]: *** [/home/nanonej/Projects/linux_work/linux_stable/tools/build/Makefile.build:97: /home/nanonej/Projects/linux_work/linux_stable/tools/objtool/help.o] Error 1
make[4]: *** Waiting for unfinished jobs....
  HOSTCC  scripts/selinux/mdp/mdp
make[3]: *** [Makefile:59: /home/nanonej/Projects/linux_work/linux_stable/tools/bpf/resolve_btfids/libsubcmd/libsubcmd-in.o] Error 2
make[2]: *** [Makefile:41: /home/nanonej/Projects/linux_work/linux_stable/tools/bpf/resolve_btfids//libsubcmd/libsubcmd.a] Error 2
make[1]: *** [Makefile:72: bpf/resolve_btfids] Error 2
make: *** [Makefile:1986: tools/bpf/resolve_btfids] Error 2
make: *** Waiting for unfinished jobs....
make[3]: *** [Makefile:59: /home/nanonej/Projects/linux_work/linux_stable/tools/objtool/libsubcmd-in.o] Error 2
make[2]: *** [Makefile:63: /home/nanonej/Projects/linux_work/linux_stable/tools/objtool/libsubcmd.a] Error 2
make[1]: *** [Makefile:69: objtool] Error 2
make: *** [Makefile:1986: tools/objtool] Error 2

Best Answer

Answers

  • nanonej
    nanonej Posts: 4

    I wonder if its because of new compilation checks that didn't exist at the time of this branch and I'm not sure if I should try to modify the code to make it pass the warnings or change some rules to ignore those ones?

  • nanonej
    nanonej Posts: 4

    So, I managed to compile 6.19.y version, so I guess I should use some exception flags if I want to ignore those errors on 5.12.y, but no idea which ones

Categories

Upcoming Training