]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
libdwfl_stacktrace: fix non-Linux build dep on PERF_SAMPLE_REGS_ABI users/serhei/eu-stacktrace
authorSerhei Makarov <serhei@serhei.io>
Mon, 8 Sep 2025 16:10:54 +0000 (12:10 -0400)
committerSerhei Makarov <serhei@serhei.io>
Mon, 8 Sep 2025 16:12:34 +0000 (12:12 -0400)
Reported on a GNU Hurd build of elfutils. This is a quick fix pending
my more complex patch to reduce dependency on linux perf concepts for
the libdwfl_stacktrace code.

* libdwfl_stacktrace/dwflst_perf_frame.c (perf_sample_regs_abi):
  Define this Linux enum on non-Linux platforms.

libdwfl_stacktrace/dwflst_perf_frame.c

index dc274e8ec548cf9d6c8cddeefa30848d70f6287a..4fc60183deef2ceed0a328e897d6a61c48634e28 100644 (file)
 
 #if defined(__linux__)
 # include <linux/perf_event.h>
+#else
+/* XXX required by copy_word() below */
+enum perf_sample_regs_abi {
+    PERF_SAMPLE_REGS_ABI_NONE       = 0,
+    PERF_SAMPLE_REGS_ABI_32         = 1,
+    PERF_SAMPLE_REGS_ABI_64         = 2,
+};
 #endif
 
 #include "libdwfl_stacktraceP.h"