Project

General

Profile

Actions

Bug #1426

open

lttng-modules 2.13.18 fails to compile for arm64

Added by Mikko Rapeli 5 days ago. Updated 5 days ago.

Status:
New
Priority:
Normal
Assignee:
-
Target version:
Start date:
04/24/2025
Due date:
% Done:

0%

Estimated time:

Description

Hi,

Yocto Project updates lttng-modules from 2.13.17 to 2.13.18 but on genericarm64 configuration there is a compile failure
when cross compiling for arm64 with kernel 6.12.23:

NOTE: make -j 64 KERNEL_SRC=/home/mcfrisk/src/base/repo/poky/build_test/tmp/work-shared/genericarm64/kernel-source KERNELDIR=/home/mcfrisk/src/base/repo/poky/build_test/tmp/work-shared/genericarm64/kernel-source KERNEL_PATH=/home/mcfrisk/src/base/repo/poky/build_test/tmp/work-shared/genericarm64/kernel-source KERNEL_VERSION=6.12.23-yocto-standard CC=aarch64-poky-linux-gcc    -fuse-ld=bfd  -ffile-prefix-map=/home/mcfrisk/src/base/repo/poky/build_test/tmp/work/genericarm64-poky-linux/lttng-modules/2.13.18/lttng-modules-2.13.18=/usr/src/debug/lttng-modules/2.13.18  -ffile-prefix-map=/home/mcfrisk/src/base/repo/poky/build_test/tmp/work/genericarm64-poky-linux/lttng-modules/2.13.18/lttng-modules-2.13.18=/usr/src/debug/lttng-modules/2.13.18  -ffile-prefix-map=/home/mcfrisk/src/base/repo/poky/build_test/tmp/work/genericarm64-poky-linux/lttng-modules/2.13.18/recipe-sysroot=  -ffile-prefix-map=/home/mcfrisk/src/base/repo/poky/build_test/tmp/work/genericarm64-poky-linux/lttng-modules/2.13.18/recipe-sysroot-native=   -ffile-prefix-map=/home/mcfrisk/src/base/repo/poky/build_test/tmp/work-shared/genericarm64/kernel-source=/usr/src/kernel  -ffile-prefix-map=/home/mcfrisk/src/base/repo/poky/build_test/tmp/work-shared/genericarm64/kernel-build-artifacts=/usr/src/kernel  LD=aarch64-poky-linux-ld.bfd   AR=aarch64-poky-linux-ar  OBJCOPY=aarch64-poky-linux-objcopy  STRIP=aarch64-poky-linux-strip O=/home/mcfrisk/src/base/repo/poky/build_test/tmp/work-shared/genericarm64/kernel-build-artifacts KBUILD_EXTRA_SYMBOLS=
make -C /home/mcfrisk/src/base/repo/poky/build_test/tmp/work-shared/genericarm64/kernel-source M=/home/mcfrisk/src/base/repo/poky/build_test/tmp/work/genericarm64-poky-linux/lttng-modules/2.13.18/lttng-modules-2.13.18/src \
        CONFIG_LTTNG=m CONFIG_LTTNG_CLOCK_PLUGIN_TEST=m \
        KCPPFLAGS='' \
        modules
make[1]: Entering directory '/home/mcfrisk/src/base/repo/poky/build_test/tmp/work-shared/genericarm64/kernel-source'
make[2]: Entering directory '/home/mcfrisk/src/base/repo/poky/build_test/tmp/work-shared/genericarm64/kernel-build-artifacts'
  CC [M]  /home/mcfrisk/src/base/repo/poky/build_test/tmp/work/genericarm64-poky-linux/lttng-modules/2.13.18/lttng-modules-2.13.18/src/lttng-ring-buffer-client-discard.o
  CC [M]  /home/mcfrisk/src/base/repo/poky/build_test/tmp/work/genericarm64-poky-linux/lttng-modules/2.13.18/lttng-modules-2.13.18/src/lttng-ring-buffer-client-overwrite.o
  CC [M]  /home/mcfrisk/src/base/repo/poky/build_test/tmp/work/genericarm64-poky-linux/lttng-modules/2.13.18/lttng-modules-2.13.18/src/lttng-ring-buffer-metadata-client.o
  CC [M]  /home/mcfrisk/src/base/repo/poky/build_test/tmp/work/genericarm64-poky-linux/lttng-modules/2.13.18/lttng-modules-2.13.18/src/lttng-ring-buffer-client-mmap-discard.o
  CC [M]  /home/mcfrisk/src/base/repo/poky/build_test/tmp/work/genericarm64-poky-linux/lttng-modules/2.13.18/lttng-modules-2.13.18/src/lttng-ring-buffer-client-mmap-overwrite.o
  CC [M]  /home/mcfrisk/src/base/repo/poky/build_test/tmp/work/genericarm64-poky-linux/lttng-modules/2.13.18/lttng-modules-2.13.18/src/lttng-ring-buffer-metadata-mmap-client.o
...
/home/mcfrisk/src/base/repo/poky/build_test/tmp/work/genericarm64-poky-linux/lttng-modules/2.13.18/lttng-modules-2.13.18/src/lttng-syscalls-exit-compat-table.c:94:31: error: '__event_probe__compat_syscall_exit_sigaction' undeclared here (not in a function); did you mean '__event_probe__compat_syscall_exit_rt_sigaction'?
   94 |                 .event_func = __event_probe__compat_syscall_exit_##_template, \
      |                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/mcfrisk/src/base/repo/poky/build_test/tmp/work/genericarm64-poky-linux/lttng-modules/2.13.18/lttng-modules-2.13.18/src/../include/instrumentation/syscalls/headers/arm-32-syscalls_pointers.h:1894:1: note: in expansion of macro 'TRACE_SYSCALL_TABLE'
 1894 | TRACE_SYSCALL_TABLE(sigaction, sigaction, 67, 3)
      | ^~~~~~~~~~~~~~~~~~~
/home/mcfrisk/src/base/repo/poky/build_test/tmp/work/genericarm64-poky-linux/lttng-modules/2.13.18/lttng-modules-2.13.18/src/lttng-syscalls-exit-compat-table.c:96:27: error: '__event_fields___compat_syscall_exit_sigaction' undeclared here (not in a function); did you mean '__event_fields___compat_syscall_exit_rt_sigaction'?
   96 |                 .fields = __event_fields___compat_syscall_exit_##_template, \
      |                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/mcfrisk/src/base/repo/poky/build_test/tmp/work/genericarm64-poky-linux/lttng-modules/2.13.18/lttng-modules-2.13.18/src/../include/instrumentation/syscalls/headers/arm-32-syscalls_pointers.h:1894:1: note: in expansion of macro 'TRACE_SYSCALL_TABLE'
 1894 | TRACE_SYSCALL_TABLE(sigaction, sigaction, 67, 3)
      | ^~~~~~~~~~~~~~~~~~~
/home/mcfrisk/src/base/repo/poky/build_test/tmp/work/genericarm64-poky-linux/lttng-modules/2.13.18/lttng-modules-2.13.18/src/lttng-syscalls-exit-compat-table.c:97:26: error: '__event_desc___compat_syscall_exit_sigaction' undeclared here (not in a function); did you mean '__event_desc___compat_syscall_exit_rt_sigaction'?
   97 |                 .desc = &__event_desc___compat_syscall_exit_##_name, \
      |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/mcfrisk/src/base/repo/poky/build_test/tmp/work/genericarm64-poky-linux/lttng-modules/2.13.18/lttng-modules-2.13.18/src/../include/instrumentation/syscalls/headers/arm-32-syscalls_pointers.h:1894:1: note: in expansion of macro 'TRACE_SYSCALL_TABLE'
 1894 | TRACE_SYSCALL_TABLE(sigaction, sigaction, 67, 3)
      | ^~~~~~~~~~~~~~~~~~~
make[4]: *** [/home/mcfrisk/src/base/repo/poky/build_test/tmp/work-shared/genericarm64/kernel-source/scripts/Makefile.build:229: /home/mcfrisk/src/base/repo/poky/build_test/tmp/work/genericarm64-poky-linux/lttng-modules/2.13.18/lttng-modules-2.13.18/src/lttng-syscalls-exit-compat-table.o] Error 1
make[4]: *** Waiting for unfinished jobs....
/home/mcfrisk/src/base/repo/poky/build_test/tmp/work/genericarm64-poky-linux/lttng-modules/2.13.18/lttng-modules-2.13.18/src/lttng-syscalls-entry-compat-table.c:95:31: error: '__event_probe__compat_syscall_entry_sigaction' undeclared here (not in a function); did you mean '__event_probe__compat_syscall_entry_rt_sigaction'?
   95 |                 .event_func = __event_probe__compat_syscall_entry_##_template, \
      |                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/mcfrisk/src/base/repo/poky/build_test/tmp/work/genericarm64-poky-linux/lttng-modules/2.13.18/lttng-modules-2.13.18/src/../include/instrumentation/syscalls/headers/arm-32-syscalls_pointers.h:1894:1: note: in expansion of macro 'TRACE_SYSCALL_TABLE'
 1894 | TRACE_SYSCALL_TABLE(sigaction, sigaction, 67, 3)
      | ^~~~~~~~~~~~~~~~~~~
/home/mcfrisk/src/base/repo/poky/build_test/tmp/work/genericarm64-poky-linux/lttng-modules/2.13.18/lttng-modules-2.13.18/src/lttng-syscalls-entry-compat-table.c:97:27: error: '__event_fields___compat_syscall_entry_sigaction' undeclared here (not in a function); did you mean '__event_fields___compat_syscall_entry_rt_sigaction'?
   97 |                 .fields = __event_fields___compat_syscall_entry_##_template, \
      |                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/mcfrisk/src/base/repo/poky/build_test/tmp/work/genericarm64-poky-linux/lttng-modules/2.13.18/lttng-modules-2.13.18/src/../include/instrumentation/syscalls/headers/arm-32-syscalls_pointers.h:1894:1: note: in expansion of macro 'TRACE_SYSCALL_TABLE'
 1894 | TRACE_SYSCALL_TABLE(sigaction, sigaction, 67, 3)
      | ^~~~~~~~~~~~~~~~~~~
/home/mcfrisk/src/base/repo/poky/build_test/tmp/work/genericarm64-poky-linux/lttng-modules/2.13.18/lttng-modules-2.13.18/src/lttng-syscalls-entry-compat-table.c:98:26: error: '__event_desc___compat_syscall_entry_sigaction' undeclared here (not in a function); did you mean '__event_desc___compat_syscall_entry_rt_sigaction'?
   98 |                 .desc = &__event_desc___compat_syscall_entry_##_name, \
      |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/mcfrisk/src/base/repo/poky/build_test/tmp/work/genericarm64-poky-linux/lttng-modules/2.13.18/lttng-modules-2.13.18/src/../include/instrumentation/syscalls/headers/arm-32-syscalls_pointers.h:1894:1: note: in expansion of macro 'TRACE_SYSCALL_TABLE'
 1894 | TRACE_SYSCALL_TABLE(sigaction, sigaction, 67, 3)
      | ^~~~~~~~~~~~~~~~~~~
make[4]: *** [/home/mcfrisk/src/base/repo/poky/build_test/tmp/work-shared/genericarm64/kernel-source/scripts/Makefile.build:229: /home/mcfrisk/src/base/repo/poky/build_test/tmp/work/genericarm64-poky-linux/lttng-modules/2.13.18/lttng-modules-2.13.18/src/lttng-syscalls-entry-compat-table.o] Error 1

The build config is described in https://git.yoctoproject.org/poky/tree/meta/recipes-kernel/lttng/lttng-modules_2.13.18.bb
and one patch https://git.yoctoproject.org/poky/tree/meta/recipes-kernel/lttng/lttng-modules/0001-src-Kbuild-change-missing-CONFIG_TRACEPOINTS-to-warn.patch is applied on top of the release.

v2.13.17 is compiling and AFAIK working without issues.

Could you hint on how this could be fixed? Thanks


Files

genericarm64_kernel_config.txt (256 KB) genericarm64_kernel_config.txt Mikko Rapeli, 04/24/2025 11:27 AM
Actions #2

Updated by Kienan Stewart 5 days ago

Hi Mikko,

is this in a specific revision of poky? Are there any additional kernel patches being carried?

thanks,
kienan

Actions #3

Updated by Kienan Stewart 5 days ago

Thanks for the link to the yocto ticket!

Actions #4

Updated by Mikko Rapeli 5 days ago

Kienan Stewart wrote in #note-2:

is this in a specific revision of poky? Are there any additional kernel patches being carried?

Yocto does patch the kernel a bit but AFAIK not towards usespace.

Kernel tree and branch are: https://git.yoctoproject.org/linux-yocto/log/?h=v6.12/standard/base

I think something in the sigaction handling broke with the new generation of syscall wrappers.

rt_sigaction seems to work while plain sigaction not. Attached the effective "genericarm64" kernel config,
if that matters.
It does not enable OLD_SIGACTION or COMPAT_OLD_SIGACTION.

Actions #5

Updated by Mikko Rapeli 5 days ago

This workaround allows compilation to pass:

--- include/instrumentation/syscalls/headers/arm-32-syscalls_pointers.h_orig    2025-04-24 13:45:25.416423401 +0000
+++ include/instrumentation/syscalls/headers/arm-32-syscalls_pointers.h 2025-04-24 15:50:30.510443988 +0000
@@ -1890,9 +1890,11 @@ TRACE_SYSCALL_TABLE(chroot, chroot, 61,
 #ifndef OVERRIDE_TABLE_32_ustat
 TRACE_SYSCALL_TABLE(ustat, ustat, 62, 2)
 #endif
+#ifdef CONFIG_COMPAT_OLD_SIGACTION
 #ifndef OVERRIDE_TABLE_32_sigaction
 TRACE_SYSCALL_TABLE(sigaction, sigaction, 67, 3)
 #endif
+#endif /* CONFIG_COMPAT_OLD_SIGACTION */
 #ifndef OVERRIDE_TABLE_32_sigpending
 TRACE_SYSCALL_TABLE(sigpending, sigpending, 73, 1)
 #endif

I could not figure out how to handle this through include/instrumentation/syscalls/headers/arm-32-syscalls_pointers_override.h

Actions #6

Updated by Kienan Stewart 5 days ago

Thanks! Makes sense if the config doesn't have OLD_SIGACTION or COMPAT_OLD_SIGACTION.

I can prepare a patch for upstream inclusion. My approach will be to check CONFIG_COMPAT_OLD_SIGACTION in include/instrumentation/syscalls/syscalls_pointers_override.h and set OVERRIDE_TABLE_32_sigaction in consequence

Actions #7

Updated by Kienan Stewart 5 days ago

There could be other similar cases so I'll do a pass on the other instrumented COMPAT syscalls as well.

Actions

Also available in: Atom PDF