From nobody Mon Sep 27 19:24:48 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 0B29417DE4B1 for ; Mon, 27 Sep 2021 19:24:57 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HJCJS6QPwz4cbW for ; Mon, 27 Sep 2021 19:24:56 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: by mail-wm1-f52.google.com with SMTP id 136-20020a1c048e000000b0030d05169e9bso1553755wme.4 for ; Mon, 27 Sep 2021 12:24:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=WNJTNE7UD/cLSAp0LzO8sGgt7LHVlrZc8o2nHA+AV/0=; b=FAViQLV9a5FGsC92XW+QV3i0UQmGOtiLvZCsGEM1oXM7aw8xUk0u551/vbpTS/MtBF RMlFX2MTkrxs/mx0VIS3PPTNPdts8yO39I4mYBW8cKlUwqVAi3bb801HRA64udhqdAj9 fXkaalD8Fglc6wasbRPZ1qkL8Ff+wI377wCIP5XIZroGU6ID2hx2ln30CqVo52On3qi7 br65RLBIe8PpEHLj7MLLJbhUotckaRhwS4pzgwfD5kJMEDvHc7GSp8HSy2g+wRXn2M9x qMxalcG9F1x8zPi5amjWdxIHrkhU3hdoEdbfB/ovXIQuZNS5VdRRHtpuZe2wpvKn/Kpx F3ow== X-Gm-Message-State: AOAM5300P1rhJiILafjwqR4GTfhUPCikYNkmBRm4aPHURXtPn4Vy0YLL IZ8NhMNBiMvDi+oTPvntYhJ+XQ== X-Google-Smtp-Source: ABdhPJynaRVg5TsLXhNMEBaZ2b7rRFebxQl47wZA9K0BLkTZ+RNa3PxnDbodjY6cnjtPo0vFEiK0Jw== X-Received: by 2002:a1c:3586:: with SMTP id c128mr799197wma.78.1632770690018; Mon, 27 Sep 2021 12:24:50 -0700 (PDT) Received: from smtpclient.apple (global-5-143.nat-2.net.cam.ac.uk. [131.111.5.143]) by smtp.gmail.com with ESMTPSA id b7sm21347950wrm.9.2021.09.27.12.24.49 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 27 Sep 2021 12:24:49 -0700 (PDT) Content-Type: text/plain; charset=utf-8 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 (Mac OS X Mail 14.0 \(3654.120.0.1.13\)) Subject: Re: ELF binary type "0" not known. (while compiling buildworld on risc-v/qemu) From: Jessica Clarke In-Reply-To: Date: Mon, 27 Sep 2021 20:24:48 +0100 Cc: Karel Gardas , current@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: To: John Baldwin X-Mailer: Apple Mail (2.3654.120.0.1.13) X-Rspamd-Queue-Id: 4HJCJS6QPwz4cbW X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N On 27 Sep 2021, at 20:22, John Baldwin 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