void-cross-and-musl

Installation
SKILL.md

Void Linux Cross-Compilation & musl libc Debugging (xbps-src)

Void Linux officially builds packages across x86_64, i686, aarch64, and armv7l on both glibc and musl. Every void-packages template must cross-compile cleanly unless there is an upstream blocker documented via nocross="...".

1. Host vs Target Dependency Separation

The #1 cause of cross-build failures in xbps-src is putting a build-host executable in makedepends or a target library in hostmakedepends:

Variable Installed Where What Belongs Here
hostmakedepends /usr (Host masterdir) Compilers, code generators, build systems (pkg-config, cmake, meson, ninja, gettext, wayland-devel for wayland-scanner, glib-devel for glib-compile-resources, cargo, go, python3-build)
makedepends /usr/<triplet> ($XBPS_CROSS_BASE) Target libraries and headers (*-devel packages linked into target ELF binaries)
checkdepends /usr (Host masterdir) Test runners (pytest, dbus, gtest-devel) only needed when -Q (XBPS_CHECK_PKGS) is active
depends Target runtime repo Non-ELF runtime dependencies (python3-*, CLI tools, dlopened .so libraries)

Dual Host + Target -devel Rule: Packages like wayland-devel, glib-devel, qt6-base-devel, and protobuf-devel ship both host code-generator binaries (wayland-scanner, glib-compile-schemas, moc, protoc) and target C/C++ headers/libraries. List them in both hostmakedepends and makedepends!

2. Selecting the Right build_helper

Installs
1
First Seen
3 days ago