[kvm-unit-tests] riscv build failure
Andrew Jones
andrew.jones at linux.dev
Thu Sep 4 15:17:45 PDT 2025
On Thu, Sep 04, 2025 at 08:57:54AM +0930, Joel Stanley wrote:
> I'm building kvm-unit-tests as part of buildroot and hitting a build
> failure. It looks like there's a missing dependency on
> riscv/sbi-asm.S, as building that manually fixes the issue. Triggering
> buildroot again (several times) doesn't resolve the issue so it
> doesn't look like a race condition.
>
> I can't reproduce with a normal cross compile on my machine. Buildroot
> uses make -C, in case that makes a difference.
>
> The build steps look like this:
>
> bzcat /localdev/jms/buildroot/dl/kvm-unit-tests/kvm-unit-tests-v2025-06-05.tar.bz2
> | /localdev/jms/buildroot/output-riscv-rvv/host/bin/tar
> --strip-components=1 -C
> /localdev/jms/buildroot/output-riscv-rvv/build/kvm-unit-tests-2025-06-05
> -xf -
> cd /localdev/jms/buildroot/output-riscv-rvv/build/kvm-unit-tests-2025-06-05
> && ./configure --disable-werror --arch="riscv64" --processor=""
> --endian="little"
> --cross-prefix="/localdev/jms/buildroot/output-riscv-rvv/host/bin/riscv64-buildroot-linux-gnu-"
> GIT_DIR=. PATH="/localdev/jms/buildroot/output-riscv-rvv/host/bin:/localdev/jms/buildroot/output-riscv-rvv/host/sbin:/home/jms/.local/bin:/home/jms/bin:/home/jms/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin"
> /usr/bin/make -j385 -C
> /localdev/jms/buildroot/output-riscv-rvv/build/kvm-unit-tests-2025-06-05
> standalone
I applied similar steps but couldn't reproduce this. It also looks like we
have a dependency because configuring with '--cc=/path/to/mygcc', where
mygcc is
#!/bin/bash
for x in $@; do
if [[ $x =~ sbi-asm ]] && ! [[ $x =~ sbi-asm-offsets ]]; then
sleep 5
break
fi
done
/path/to/riscv64-linux-gnu-gcc $@
stalls the build 5 seconds when compiling sbi-asm.S but doesn't reproduce
the issue. That said, running make with -d shows that riscv/sbi-asm.o is
an implicit prerequisite, although so are other files. I'm using
GNU Make 4.4.1. Which version are you using?
Also, while the steps above shouldn't cause problems, they are a bit odd
* '--endian' only applies to ppc64
* -j385 is quite large and specific. Typicall -j$(nproc) is recommended.
* No need for '-C "$PWD"'
Thanks,
drew
More information about the kvm-riscv
mailing list