Ports Status on RISC-V

Tracking build status of important/desired ports on RISC-V.

There is now an official package builder at http://beefy7.nyi.freebsd.org/ .

Packages are built for stable/13 (ports' quarterly branch) and main (ports' main branch).

The Most Notable Build Failures

Port

Status

Required For

Blocks

Notes

audio/lame

Fails to build

58

databases/mysql57-client

Fails to build

316

/usr/include/c++/v1/__config:1141:6: error: "No thread API"

java/bootstrap-openjdk8

Needs porting

554

lang/go

Needs upstreaming

510

- Sources: https://github.com/MikaelUrankar/go/tree/freebsd_riscv64 ; does not require COMPAT_FREEBSD11
- Prebuilt bootstrap: https://github.com/dmgk/go-bootstrap/releases/tag/go1.18beta2-1679-g4bdf93a078
- lang/go-devel port: https://github.com/dmgk/ports-riscv64 ; set DEFAULT_VERSIONS+=go=1.19-devel in /etc/make.conf

lang/gcc10

Fails to build

899

See PR 251403

lang/php74

Needs porting

*php*

886

lang/rust-bootstrap

Needs porting

lang/rust

347

multimedia/libx264

Fails to build

480

All Failing Builds

/!\ this list is now out-of-date:

See http://www.lonesome.com/FreeBSD/poudriere/data/logs/bulk/head-head-riscv64-default/2021-01-16_21h45m27s/build.html.

Everything that is marked blacklisted is either known to fail to build, or not built due to restricted and/or license reasons.

Common Build Failure Types

As seen by MarkLinimon 202101201:

Count

Failure

Suggested Fix

Comments

7

qemu: uncaught target signal

Often 11 (Segmentation fault), sometimes 6 (Abort trap) - core dumped

7

C compiler cannot create executables

or related "checking whether the C compiler works... no"

7

ld: error: can't create dynamic relocation R_RISCV_HI20 against symbol

6

checking thread safety of required library functions... Segmentation fault

possibly subcase of "C compiler cannot create executables" above

5

error: use of undeclared identifier 'FP_X_INV'

2

relocation R_RISCV_ALIGN requires unimplemented linker relaxation; recompile with -mno-relax

2

ldd: <xyz>.so: not a FreeBSD ELF shared object

teach ldd to parse ELF notes

possibly fixed

Cross-Building Ports

There is some support for cross-compiling ports via poudriere(8) and qemu-user-static. This method works by emulating a RISC-V userspace with QEMU, so it is faster than building within an emulated system, but slower than building natively. The QEMU userspace emulation is imperfect.

Install and start qemu-user-static first:

pkg install -y qemu-user-static
service qemu_user_static enable
service qemu_user_static start

Please refer to the FreeBSD Handbook entry about poudriere if you are unfamiliar with the tool or need to set it up.

The following command will create a new poudriere jail set up to cross-compile ports for the riscv.riscv64 target:

$ poudriere jail -c -a riscv.riscv64 -x -j 14riscv64 -m ftp -v 14.0-CURRENT -x

The -x argument instructs poudriere(8) to build native cross-toolchain. Make sure to specify it when updating the jail as well, like so:

$ poudriere jail -j 14riscv64 -u -x

riscv/ports (last edited 2023-05-16T12:45:15+0000 by OlivierCochardLabbé)