Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 27 Sep 2021 12:22:09 -0700
From:      John Baldwin <jhb@FreeBSD.org>
To:        Karel Gardas <gardask@gmail.com>
Cc:        current@freebsd.org, Jessica Clarke <jrtc27@freebsd.org>
Subject:   Re: ELF binary type "0" not known. (while compiling buildworld on risc-v/qemu)
Message-ID:  <d4bd0f73-3143-b500-752c-c98b01fe4b57@FreeBSD.org>
In-Reply-To: <af607542-0c23-3ddf-a2e0-a2096d10cc88@gmail.com>
References:  <af607542-0c23-3ddf-a2e0-a2096d10cc88@gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 9/27/21 7:40 AM, Karel Gardas wrote:
> 
> Hello,
> 
> I'm playing with compiling freebsd 13 (releng/13.0 2 days ago) and
> current (git HEAD as of today) on qemu-5.1.0/qemu-6.1.0 on risv64
> platform. The emulator invocation is:
> 
> qemu-system-riscv64 -machine virt -smp 8 -m 16G -nographic -device
> virtio-blk-device,drive=hd -drive
> file=FreeBSD-14.0-CURRENT-riscv-riscv64.qcow2,if=none,id=hd -device
> virtio-net-device,netdev=net -netdev user,id=net,hostfwd=tcp::2233-:22
> -bios /usr/lib/riscv64-linux-gnu/opensbi/generic/fw_jump.elf -kernel
> /usr/lib/u-boot/qemu-riscv64_smode/uboot.elf -object
> rng-random,filename=/dev/urandom,id=rng -device
> virtio-rng-device,rng=rng -nographic -append "root=LABEL=rootfs
> console=ttyS0"
> 
> and the host is Ubuntu 20.04.x LTS. Both qemu 5.1.0 and qemu 6.1.0 are
> compiled from, source, but both OpenSBI and u-boot for risc-v are Ubuntu
> packages provided (to accompany ubuntu provided qemu 4.2.1)
> 
> My issue while compiling both 13 and current is that compilation after
> some time fails with:
> 
> root@freebsd:/usr/src # time make -j8 buildworld > /tmp/build-j8-2.txt
> ELF binary type "0" not known.
> 17784.134u 21388.907s 1:50:13.83 592.2% 30721+572k 10+2177io 0pf+0w
> 
> I'm curious if this is a know issue either in Qemu or in FreeBSD for
> risc-v or if I'm doing anything wrong here?

It is a known issue with how we brand FreeBSD/riscv binaries.  Jess
(cc'd) has a WIP review with a possible fix IIRC.

-- 
John Baldwin



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?d4bd0f73-3143-b500-752c-c98b01fe4b57>