[lowrisc-dev] building lowRISC binaries with current riscv-gnu-toolchain?

Karsten Merker merker at debian.org
Tue Oct 16 22:11:26 BST 2018

On Tue, Oct 16, 2018 at 03:59:29PM -0400, Gabriel L. Somlo wrote:

> I'm trying to bring together a reasonably current hardware+software
> riscv environment, and lowRISC (on nexys4-ddr) appeared to be the most
> likely candidate :)
> So I managed to replicate the entire from-source build process for
> "lowrisc-chip-ethernet-v05", including the bitstream (with Vivado),
> and riscv-tools (riscv-fesvr, riscv-isa-sim, riscv-gnu-toolchain,
> busybox, the kernel, and the bbl bootloader).
> I also managed to build poky, but as it turns out I can leave that
> out, and still get a minimal busybox-in-initramfs working, bootable
> system.
> So far, so good.
> I would, however, like to move toward upgrading this system to more
> modern/recent/upstream components.
> Busybox is easy, I can build 1.28.3 (currently the latest) with the
> included toolchain, and things are still OK.
> This is where I got stuck, though:
> I can't build a more recent kernel (e.g. 4.19-rc8) with the included
> toolchain.
> So I grabbed the sources for https://github.com/riscv/riscv-gnu-toolchain
> and built it for multilib, including "rv64imafd-lp64" which I believe
> "should" work on the lowRISC implementation of the ISA.
> However, if I try building a statically linked busybox binary with the
> new/upstream toolchain, I'm getting either a signal-7 bus error or a
> signal-4 illegal opcode error from the existing (working) lowRISC
> kernel.

According to https://www.lowrisc.org/docs/ethernet-v0.5/, LowRISC
v0.5 implements only priv-1.9.1, but the upstream kernel requires
priv 1.10 or newer, so running an upstream kernel on a LowRISC
v0.5 isn't possible.  To make things even worse, upstream glibc
in turn AFAIK requires an upstream kernel (3.15 or newer) and
doesn't build cleanly against older (priv-1.9.1-supporting)
kernels.  AFAIK LowRISC v0.6 is planned to support priv 1.10 and
thereby should work with upstream Linux and glibc.

Gem. Par. 28 Abs. 4 Bundesdatenschutzgesetz widerspreche ich der Nutzung
sowie der Weitergabe meiner personenbezogenen Daten für Zwecke der
Werbung sowie der Markt- oder Meinungsforschung.

More information about the lowrisc-dev mailing list