From 3e5c0306ccaa277a6bcf189a26789825841a0402 Mon Sep 17 00:00:00 2001 From: William Cohen Date: Wed, 6 Nov 2024 16:24:06 -0500 Subject: [PATCH] Deal with kernels pre-6.12 kernel that relocated unaligned.h Observed on kernel-6.11.0-28.el10 the was moved to . The check was just looking at the kernel version which was not sufficient on this Linux 6.11 with a backport moving unaligned.h. --- buildrun.cxx | 3 +++ runtime/linux/autoconf-linux-unaligned-h.c | 1 + runtime/sym.c | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 runtime/linux/autoconf-linux-unaligned-h.c diff --git a/buildrun.cxx b/buildrun.cxx index b08d06ed3..e5cb563b8 100644 --- a/buildrun.cxx +++ b/buildrun.cxx @@ -555,6 +555,9 @@ compile_pass (systemtap_session& s) output_autoconf(s, o, cs, "autoconf-files_lookup_fd_raw.c", "STAPCONF_FILES_LOOKUP_FD_RAW", NULL); output_autoconf(s, o, cs, "autoconf-task-state.c", "STAPCONF_TASK_STATE", NULL); + + output_autoconf(s, o, cs, "autoconf-linux-unaligned-h.c", "STAPCONF_LINUX_UNALIGNED_H", NULL); + // used by runtime/linux/netfilter.c output_exportconf(s, o2, "nf_register_hook", "STAPCONF_NF_REGISTER_HOOK"); diff --git a/runtime/linux/autoconf-linux-unaligned-h.c b/runtime/linux/autoconf-linux-unaligned-h.c new file mode 100644 index 000000000..6359283b3 --- /dev/null +++ b/runtime/linux/autoconf-linux-unaligned-h.c @@ -0,0 +1 @@ +#include diff --git a/runtime/sym.c b/runtime/sym.c index acae95818..a1a25f30e 100644 --- a/runtime/sym.c +++ b/runtime/sym.c @@ -18,7 +18,7 @@ #ifdef STP_NEED_LINE_DATA #include "unwind/unwind.h" #endif -#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,12,0) +#ifdef STAPCONF_LINUX_UNALIGNED_H #include #else #include -- 2.43.5