Skip to the text
KDOS
Menu
kdos.dev KDOS from Scratch KDOS 0.2 · 4dd4a10 · 2026-11-30 Contents Index

161.14. picolibc-riscv64-unknown-elf-1.8.12

The C library for riscv64-unknown-elf — newlib trimmed for a microcontroller

1.8.12-1 · BSD-3-Clause AND BSD-2-Clause · 9.3 SBU · 29.4 MiB, 373 files · 41_system, 472 of 1047 · ports/core/embedded/picolibc-riscv64-unknown-elf

Homepage: https://github.com/picolibc/picolibc

Why it is in KDOS. The comment above the 4 ports from binutils-riscv64-unknown-elf to libstdcxx-riscv64-unknown-elf in script/phases/41_system/packages.d/embedded.txt:

RV32 and RV64 — the MCUs and the soft cores the FPGA flow (yosys, nextpnr) synthesises.

Depends on: meson, ninja, gcc-riscv64-unknown-elf, binutils-riscv64-unknown-elf.

Required by (1): libstdcxx-riscv64-unknown-elf.

Sources: picolibc-riscv64-unknown-elf-1.8.12.tar.xz (3.1 MiB). Every step kpkg takes applies to this port.

Install: script/chroot/exec.sh bash -c 'source script/phases/41_system/phase.env && kpkg install picolibc-riscv64-unknown-elf'

build.sh:

unset CFLAGS CXXFLAGS LDFLAGS
meson setup build \
	--cross-file scripts/cross-riscv64-unknown-elf.txt \
	--prefix=/usr/riscv64-unknown-elf \
	-Dsysroot-install=true \
	-Dtests=false \
	--buildtype=release
meson compile -C build
DESTDIR=$PKG meson install --no-rebuild -C build

Directories: /usr/riscv64-unknown-elf/include/arpa, /usr/riscv64-unknown-elf/include/bits, /usr/riscv64-unknown-elf/include/machine, /usr/riscv64-unknown-elf/include/rpc, /usr/riscv64-unknown-elf/include/ssp, /usr/riscv64-unknown-elf/include/sys, /usr/share/licenses/picolibc-riscv64-unknown-elf.