llvm-dev Digest, Vol 158, Issue 27

Copying the includes directory is not sufficient for musl as the musl build system assembles the arch specific bits directories from arch/${ARCH} and it constructs the syscalls.h headers at built time. It uses the ${ARCH} variable to meld directories together in the install target and there should be a valid config.mak or ARCH=aarch64 should be passed on the make command line.

To make the header directory install to ${SYSROOT}/usr/include you need to do something like this:

cd musl
echo ARCH=aarch64 > config.mak
echo prefix=/usr >> config.mak
make DESTDIR=${SYSROOT} install-headers

You can build and install only the static libs like this:

make DESTDIR=${SYSROOT} SHARED_LIBS= install-libs

You can build and install the dynamic and static libs like this:

make DESTDIR=${SYSROOT} install-libs