From nobody Mon Sep 27 19:22:09 2021 X-Original-To: current@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 9C70317DD9A5 for ; Mon, 27 Sep 2021 19:22:11 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HJCFH48Q6z4bWc; Mon, 27 Sep 2021 19:22:11 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro.local (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 1CEAD56D7; Mon, 27 Sep 2021 19:22:11 +0000 (UTC) (envelope-from jhb@FreeBSD.org) To: Karel Gardas References: Cc: current@freebsd.org, Jessica Clarke From: John Baldwin Subject: Re: ELF binary type "0" not known. (while compiling buildworld on risc-v/qemu) Message-ID: Date: Mon, 27 Sep 2021 12:22:09 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@freebsd.org MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-ThisMailContainsUnwantedMimeParts: N 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