lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Tue, 16 Apr 2024 08:04:55 -0700
From: Ian Rogers <irogers@...gle.com>
To: cp0613@...ux.alibaba.com
Cc: palmer@...belt.com, paul.walmsley@...ive.com, aou@...s.berkeley.edu, 
	linux-perf-users@...r.kernel.org, linux-kernel@...r.kernel.org, 
	linux-riscv@...ts.infradead.org
Subject: Re: [PATCH] tools/perf: Fix compiling with libelf on rv32

On Mon, Apr 15, 2024 at 2:57 AM <cp0613@...ux.alibaba.com> wrote:
>
> From: Chen Pei <cp0613@...ux.alibaba.com>
>
> 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@...ux.alibaba.com>

Reviewed-by: Ian Rogers <irogers@...gle.com>

Thanks,
Ian

> ---
>  tools/perf/util/genelf.h | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/tools/perf/util/genelf.h b/tools/perf/util/genelf.h
> index 5f18d20ea903..4e2e4f40e134 100644
> --- a/tools/perf/util/genelf.h
> +++ b/tools/perf/util/genelf.h
> @@ -43,6 +43,9 @@ int jit_add_debug_info(Elf *e, uint64_t code_addr, void *debug, int nr_debug_ent
>  #elif defined(__riscv) && __riscv_xlen == 64
>  #define GEN_ELF_ARCH   EM_RISCV
>  #define GEN_ELF_CLASS  ELFCLASS64
> +#elif defined(__riscv) && __riscv_xlen == 32
> +#define GEN_ELF_ARCH   EM_RISCV
> +#define GEN_ELF_CLASS  ELFCLASS32
>  #elif defined(__loongarch__)
>  #define GEN_ELF_ARCH   EM_LOONGARCH
>  #define GEN_ELF_CLASS  ELFCLASS64
> --
> 2.25.1
>
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ