diff options
author | Milan P. Stanić <mps@arvanta.net> | 2024-09-05 17:06:54 +0200 |
---|---|---|
committer | Alistair Francis <alistair.francis@wdc.com> | 2024-10-02 15:11:51 +1000 |
commit | c5757f808bd74db7ef1a90ee28334f3b5afb8179 (patch) | |
tree | 7efbfde2fa07e205bb3d57ae70c9970a94c300fb /util/cpuinfo-riscv.c | |
parent | af0b5b7b2a3bd78cd1a01115103c28e2f54d34bc (diff) |
util/util/cpuinfo-riscv.c: fix riscv64 build on musl libc
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>
Message-ID: <20240905150702.2484-1-mps@arvanta.net>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Diffstat (limited to 'util/cpuinfo-riscv.c')
-rw-r--r-- | util/cpuinfo-riscv.c | 1 |
1 files changed, 1 insertions, 0 deletions
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; |