[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 1/1] util/util/cpuinfo-riscv.c: fix riscv64 build on musl
From: |
Alistair Francis |
Subject: |
Re: [PATCH v2 1/1] util/util/cpuinfo-riscv.c: fix riscv64 build on musl libc |
Date: |
Fri, 6 Sep 2024 10:53:38 +1000 |
On Fri, Sep 6, 2024 at 1:08 AM Milan P. Stanić <mps@arvanta.net> wrote:
>
> build fails on musl libc (alpine linux) with this error:
>
> ../util/cpuinfo-riscv.c: In function 'cpuinfo_init':
> ../util/cpuinfo-riscv.c:63:21: error: '__NR_riscv_hwprobe' undeclared (first
> use in this function); did you mean 'riscv_hwprobe'?
> 63 | if (syscall(__NR_riscv_hwprobe, &pair, 1, 0, NULL, 0) == 0
> | ^~~~~~~~~~~~~~~~~~
> | riscv_hwprobe
> ../util/cpuinfo-riscv.c:63:21: note: each undeclared identifier is reported
> only once for each function it appears in
> ninja: subcommand failed
>
> add '#include "asm/unistd.h"' to util/cpuinfo-riscv.c fixes build
>
> Signed-off-by: Milan P. Stanić <mps@arvanta.net>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Alistair
> ---
> util/cpuinfo-riscv.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/util/cpuinfo-riscv.c b/util/cpuinfo-riscv.c
> index 497ce12680..8cacc67645 100644
> --- a/util/cpuinfo-riscv.c
> +++ b/util/cpuinfo-riscv.c
> @@ -9,6 +9,7 @@
> #ifdef CONFIG_ASM_HWPROBE_H
> #include <asm/hwprobe.h>
> #include <sys/syscall.h>
> +#include <asm/unistd.h>
> #endif
>
> unsigned cpuinfo;
> --
> 2.46.0
>
>