Date: Mon, 27 Sep 2021 20:24:48 +0100 From: Jessica Clarke <jrtc27@freebsd.org> To: John Baldwin <jhb@FreeBSD.org> Cc: Karel Gardas <gardask@gmail.com>, current@freebsd.org Subject: Re: ELF binary type "0" not known. (while compiling buildworld on risc-v/qemu) Message-ID: <D2D75266-28B0-46ED-9368-E899EC8BF2B6@freebsd.org> In-Reply-To: <d4bd0f73-3143-b500-752c-c98b01fe4b57@FreeBSD.org> References: <af607542-0c23-3ddf-a2e0-a2096d10cc88@gmail.com> <d4bd0f73-3143-b500-752c-c98b01fe4b57@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On 27 Sep 2021, at 20:22, John Baldwin <jhb@FreeBSD.org> wrote: >=20 > 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=3Dhd -drive >> file=3DFreeBSD-14.0-CURRENT-riscv-riscv64.qcow2,if=3Dnone,id=3Dhd = -device >> virtio-net-device,netdev=3Dnet -netdev = user,id=3Dnet,hostfwd=3Dtcp::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=3D/dev/urandom,id=3Drng -device >> virtio-rng-device,rng=3Drng -nographic -append "root=3DLABEL=3Drootfs >> console=3DttyS0" >> 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? >=20 > It is a known issue with how we brand FreeBSD/riscv binaries. Jess > (cc'd) has a WIP review with a possible fix IIRC. https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D258358 and https://reviews.freebsd.org/D31323. The latter needs reworking because GCC doesn=E2=80=99t use all of our CSU files and instead provides its = own that we have no control over. The bug report documents a one-line workaround. Jess
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?D2D75266-28B0-46ED-9368-E899EC8BF2B6>