google / google/XNNPACK

RISC-V cpuinfo build error

Open
#4,650 7 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
2.5k
Forks
560
Avg merge
1d 6h
Merged PRs (30d)
163

Description

I am trying to cross-compile xnnpack for risc-v by using `scripts/build-linux-riscv64.sh` with some modification of the toolchain path in `cmake/riscv64.toolchain`. But I got build error message when compiling cpuinfo:
```
/scratch/honghsu/XNNPACK/build/linux/riscv64/cpuinfo-source/src/api.c:319:23: error: call to undeclared function 'syscall'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
if CPUINFO_UNLIKELY(syscall(__NR_getcpu, &cpu, NULL, NULL) != 0) {
^
/scratch/honghsu/XNNPACK/build/linux/riscv64/cpuinfo-source/src/api.c:338:23: error: call to undeclared function 'syscall'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
if CPUINFO_UNLIKELY(syscall(__NR_getcpu, &cpu, NULL, NULL) != 0) {
^
2 errors generated.
```
Do you have any suggestions for how to solve this issue?
(Actually in iree project I encountered the same [issue](https://github.com/openxla/iree/issues/11152) but solved it by simply disabling cpuinfo.)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.