lkrg-org / lkrg

Linux Kernel Runtime Guard
https://lkrg.org
Other
410 stars 72 forks source link

-DP_LKRG_DEBUG_BUILD breaks ARM builds #175

Open solardiz opened 2 years ago

solardiz commented 2 years ago

Uncommenting these lines in Makefile:

# ccflags-m := -ggdb -DP_LKRG_DEBUG_BUILD -finstrument-functions
# ccflags-y := ${ccflags-m}
# p_lkrg-objs += src/modules/print_log/p_lkrg_debug_log.o

results in:

gcc version 10.3.1 20210703 (ALT Sisyphus 10.3.1-alt2) (GCC) 
NAME="starter kit"
VERSION="p10 (Hypericum)"
ID=altlinux
VERSION_ID=p10
PRETTY_NAME="ALT Starterkit (Hypericum)"
ANSI_COLOR="1;33"
CPE_NAME="cpe:/o:alt:starterkit:p10"
HOME_URL="http://en.altlinux.org/starterkits"
BUG_REPORT_URL="https://bugs.altlinux.org/"
Removing intermediate container 86124bba825c
 ---> 81382e3daf67
Step 7/8 : RUN make -j$(nproc) KERNELRELEASE=$(cd /lib/modules; ls)
Warning: rning] The requested image's platform (linux/arm) does not match the detected host platform (linux/amd64) and no specific platform was requested
 ---> Running in 66cb569e6134
make -C /lib/modules/5.10.109-std-def-alt1/build M=/src modules
make[1]: Entering directory '/usr/src/linux-5.10.109-std-def-alt1'
  CC [M]  /src/src/modules/print_log/p_lkrg_debug_log.o
  CC [M]  /src/src/modules/ksyms/p_resolve_ksym.o
/src/src/modules/print_log/p_lkrg_debug_log.c:73:22: error: 'p_install_arch_jump_label_transform_apply_hook' undeclared here (not in a function); did you mean 'p_install_arch_jump_label_transform_hook'?
   73 |    P_LKRG_DEBUG_RULE(p_install_arch_jump_label_transform_apply_hook),
      |                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/src/src/modules/print_log/p_lkrg_debug_log.c:21:47: note: in definition of macro 'P_LKRG_DEBUG_RULE'
   21 | #define P_LKRG_DEBUG_RULE(fname) { (uintptr_t)fname, #fname }
      |                                               ^~~~~
/src/src/modules/print_log/p_lkrg_debug_log.c:74:22: error: 'p_uninstall_arch_jump_label_transform_apply_hook' undeclared here (not in a function); did you mean 'p_uninstall_arch_jump_label_transform_hook'?
   74 |    P_LKRG_DEBUG_RULE(p_uninstall_arch_jump_label_transform_apply_hook),
      |                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/src/src/modules/print_log/p_lkrg_debug_log.c:21:47: note: in definition of macro 'P_LKRG_DEBUG_RULE'
   21 | #define P_LKRG_DEBUG_RULE(fname) { (uintptr_t)fname, #fname }
      |                                               ^~~~~

and

gcc version 11.2.0 (Ubuntu 11.2.0-7ubuntu2) 
PRETTY_NAME="Ubuntu 21.10"
NAME="Ubuntu"
VERSION_ID="21.10"
VERSION="21.10 (Impish Indri)"
VERSION_CODENAME=impish
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=impish
Removing intermediate container 72d087bf6c97
 ---> e415c94e5367
Step 7/8 : RUN make -j$(nproc) KERNELRELEASE=$(cd /lib/modules; ls)
Warning: rning] The requested image's platform (linux/arm64/v8) does not match the detected host platform (linux/amd64) and no specific platform was requested
 ---> Running in fab3bdf6229b
make -C /lib/modules/5.13.0-39-generic/build M=/src modules
make[1]: Entering directory '/usr/src/linux-headers-5.13.0-39-generic'
  CC [M]  /src/src/modules/print_log/p_lkrg_debug_log.o
  CC [M]  /src/src/modules/ksyms/p_resolve_ksym.o
/src/src/modules/print_log/p_lkrg_debug_log.c:73:22: error: 'p_install_arch_jump_label_transform_apply_hook' undeclared here (not in a function); did you mean 'p_install_arch_jump_label_transform_hook'?
   73 |    P_LKRG_DEBUG_RULE(p_install_arch_jump_label_transform_apply_hook),
      |                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/src/src/modules/print_log/p_lkrg_debug_log.c:21:47: note: in definition of macro 'P_LKRG_DEBUG_RULE'
   21 | #define P_LKRG_DEBUG_RULE(fname) { (uintptr_t)fname, #fname }
      |                                               ^~~~~
/src/src/modules/print_log/p_lkrg_debug_log.c:74:22: error: 'p_uninstall_arch_jump_label_transform_apply_hook' undeclared here (not in a function); did you mean 'p_uninstall_arch_jump_label_transform_hook'?
   74 |    P_LKRG_DEBUG_RULE(p_uninstall_arch_jump_label_transform_apply_hook),
      |                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/src/src/modules/print_log/p_lkrg_debug_log.c:21:47: note: in definition of macro 'P_LKRG_DEBUG_RULE'
   21 | #define P_LKRG_DEBUG_RULE(fname) { (uintptr_t)fname, #fname }
      |                                               ^~~~~