Re: [PATCH] tools/perf: Fix compiling with libelf on rv32

From: Arnaldo Carvalho de Melo
Date: Wed Apr 17 2024 - 11:59:28 EST


On Tue, Apr 16, 2024 at 08:04:55AM -0700, Ian Rogers wrote:
> On Mon, Apr 15, 2024 at 2:57 AM <cp0613@xxxxxxxxxxxxxxxxx> wrote:
> >
> > From: Chen Pei <cp0613@xxxxxxxxxxxxxxxxx>
> >
> > When cross-compiling perf with libelf, the following error occurred:
> >
> > In file included from tests/genelf.c:14:
> > tests/../util/genelf.h:50:2: error: #error "unsupported architecture"
> > 50 | #error "unsupported architecture"
> > | ^~~~~
> > tests/../util/genelf.h:59:5: warning: "GEN_ELF_CLASS" is not defined, evaluates to 0 [-Wundef]
> > 59 | #if GEN_ELF_CLASS == ELFCLASS64
> >
> > Fix this by adding GEN-ELF-ARCH and GEN-ELF-CLASS definitions for rv32.
> >
> > Signed-off-by: Chen Pei <cp0613@xxxxxxxxxxxxxxxxx>
>
> Reviewed-by: Ian Rogers <irogers@xxxxxxxxxx>

Thanks, applied to perf-tools-next,

- Arnaldo