Hi Serhei,
On Mon, 2025-09-08 at 12:23 -0400, Serhei Makarov wrote:
> 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 | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/libdwfl_stacktrace/dwflst_perf_frame.c
> b/libdwfl_stacktrace/dwflst_perf_frame.c
> index dc274e8e..4fc60183 100644
> --- a/libdwfl_stacktrace/dwflst_perf_frame.c
> +++ b/libdwfl_stacktrace/dwflst_perf_frame.c
> @@ -32,6 +32,13 @@
>
> #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"
Yeah, that is the simplest fix for now. Lets just go with it.
Could you also take a peek at the Debian workaround for dealing with
arches that don't support perf?
https://salsa.debian.org/toolchain-team/elfutils/-/commit/2cd08fdcfcaf15d6a2b7b085faedadfc94a4729c
I am not sure just listing all the arches that don't support perf is
really the way to go. But maybe it is the best there is?
Cheers,
Mark