Skip to content

RISC-V cpuinfo build error #4650

Open
Open
@rednoah91

Description

@rednoah91

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 but solved it by simply disabling cpuinfo.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions