Busybox makes heavy usage of Linux kernel headers, which have a tendency to clash with userspace. in order to make it build almost "out of the box", some patches (1, 2, 3, 4, 5) are needed for the kernel headers so that they respect musl's userspace headers in the same way as glibc's. for convenience, Sabotage Linux has a kernel-headers repository based on Linux 3.12.6 headers for all arches supported by musl, where those patches are already applied.
note that these headers are "forwards and backwards-compatible"; you only need newer headers if you need a feature that was added to Linux after 3.12, which cannot be accessed using libc headers.
To compile Busybox 1.22.1's allyesconfig
, the following config changes are
needed to support musl:
# CONFIG_EXTRA_COMPAT is not set
# CONFIG_SELINUX is not set
# CONFIG_FEATURE_HAVE_RPC is not set
# CONFIG_WERROR is not set
# CONFIG_FEATURE_SYSTEMD is not set
# CONFIG_FEATURE_VI_REGEX_SEARCH is not set
# CONFIG_PAM is not set
# CONFIG_FEATURE_INETD_RPC is not set
# CONFIG_SELINUXENABLED is not set
# CONFIG_FEATURE_MOUNT_NFS is not set
Additionally this patch for ifplugd is required, if this applet is desired.