# TLDR
`docker run -it sorear/fedora-riscv-wip`
Inspect and run the resulting configuration command, then start the
container again
```
[root@f149d30f7627 /]# rpm -i
/var/tmp/RPMS/riscv64/binutils-2.27-3.fc25.riscv64.rpm
[root@f149d30f7627 /]# objdump -d /bin/objdump | head
/bin/objdump: file format elf64-littleriscv
Disassembly of section .plt:
00000000000274f0 <__vsnprintf_chk@plt-0x20>:
274f0: 00042397 auipc t2,0x42
274f4: 41c30333 sub t1,t1,t3
274f8: b103be03 ld t3,-1264(t2) # 69000
<warn@@Base+0xa4d8>
```
# CHANGES
* Most significantly, the new version is now based on the "stage4"
images just announced by Richard W.M. Jones. That means:
* Everything in the container except the startup script and the
qemu binary is managed by RPM
* All of the packages except gcc and kernel-headers are built by
the normal rpmbuild mechanism from something close to the official
Fedora sources
* For quite a few of the packages they are built from _exactly_
the official Fedora sources
* qemu-riscv64 is updated, fixing several bugs I've encountered
* I added a small amd64 startup binary to the image which detects
binfmt_misc problems and tells you what to do about them, so now you
can just run the image _first_ and go from there.
* There are a small number of functional regressions associated with
stage4. These will be addressed by the porting effort.
* Vim is no longer available (use nano, or just share a folder and
edit outside the container)
* iconv mostly doesn't work
* the /bin/cc symlink is missing and you may need to manually add it
# README
This is the RISC-V Fedora userland from Richard W.M. Jones et al,
repackaged for Docker with the QEMU user emulator fork developed by
Alex Suykov.
* About RISC-V:
https://riscv.org/
* Fedora coordinaton page:
https://fedoraproject.org/wiki/Architectures/RISC-V
* QEMU fork:
https://github.com/arsv/riscv-qemu
* Build script for this image:
https://github.com/sorear/fedora-riscv-useremu
To set up a RISC-V userland testing environment, use:
docker run -it sorear/fedora-riscv-wip
You will need binfmt_misc configured in order to actually use this;
the container checks this, and will print instructions (or if run with
--privileged it can do the configuration itself; don't do this if you
care about the host integrity, because that turns off the sandbox).
That image includes a large set of compiled RPMs suitable for basic
development. You can instead download a much smaller image,
`sorear/fedora-riscv-wip:minimal`, (109 MB versus 667 MB), and
download RPMs as needed from the [coordination site][RPMS]. Once we
have dnf working on RISC-V this will probably become the preferred
option.
[RPMS]:
https://fedorapeople.org/groups/risc-v/RPMS
---
The dev environment must be installed from RPMs using the rpm or tdnf
command, for instance:
tdnf --releasever 25 install libffi-devel libtool-ltdl-devel m4
The files are installed in /var/tmp/RPMS, or can be downloaded with
curl; the kernel-headers package is necessary for most tasks but is
not in either image and can be fetched at:
https://fedorapeople.org/groups/risc-v/SRPMS/kernel-headers-4.1.26-1.fc25.src.rpm
A list of package that you probably want to install before trying to
compile anything is in the autobuilder:
https://github.com/rwmjones/fedora-riscv-autobuild/blob/4b78ecf5/autobuild.ml#L174
After installing those, kernel-headers, m4, libtool-ltdl-devel, and
libffi-devel, and replacing iconv with a link to /bin/true, I was able
to rebuild the source package gforth-0.7.3-3.fc24.src.rpm as a test.