Build of libcap with musl toolchain

The build took 00h 00m 48s and was NOT successful.

The program in this build is written in the following languages, according to sloccount:

SLOCLanguage
2,698 ansic
644 sh
172 makefile
3,514 total

The process tree of the build process is here.

Several sub-process invocations were improper; see the process tree for details. Summary:

List of Errors

Log

To avoid scrolling, you may jump to the last line of the invocation of makepkg that was used to build this package.

Removed vanilla repositories from pacman.conf and added:
# [tuscan]
# Server = file:///var/cache/pacman/pkg/

CMD: pacman -Syy --noconfirm
# :: Synchronizing package databases...
# downloading tuscan.db...

There were existing files in /sysroot, using those
# /sysroot/lib
# /sysroot/share
# /sysroot/bin
# /sysroot/include
# /sysroot/libexec

CMD: sudo -u tuscan PATH=/sysroot/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin CC=clang CXX=clang++ red makepkg --noextract --syncdeps --skipinteg --skippgpcheck --skipchecksums --noconfirm --nocolor --log --noprogressbar --nocheck
# ==> Making package: libcap 2.25-1 (Wed Apr 5 00:24:26 UTC 2017)
# ==> Checking runtime dependencies...
# ==> Checking buildtime dependencies...
# ==> WARNING: Using existing $srcdir/ tree
# ==> Starting build()...
# make: Entering directory '/tmp/libcap/src/libcap-2.25'
# make -C libcap all
# make[1]: Entering directory '/tmp/libcap/src/libcap-2.25/libcap'
# => making cap_names.list.h from /usr/include/linux/capability.h
# perl -e 'while ($l=<>) { if ($l =~ /^\#define[ \t](CAP[_A-Z]+)[ \t]+([0-9]+)\s+$/) { $tok=$1; $val=$2; $tok =~ tr/A-Z/a-z/; print "{\"$tok\",$val},\n"; } }' /usr/include/linux/capability.h | fgrep -v 0x > cap_names.list.h
# sed -e 's,@prefix@,/usr,' \
# -e 's,@exec_prefix@,,' \
# -e 's,@libdir@,/lib64,' \
# -e 's,@includedir@,/usr/include,' \
# -e 's,@VERSION@,2.25,' \
# -e 's,@deps@,,' \
# libcap.pc.in >libcap.pc
# gcc -O2 -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -fPIC -I/usr/include -I/tmp/libcap/src/libcap-2.25/libcap/../libcap/include _makenames.c -o _makenames
# ./_makenames > cap_names.h
# ./_makenames: error while loading shared libraries: /usr/lib/libc.so: invalid ELF header
# make[1]: *** [Makefile:41: cap_names.h] Error 127
# make[1]: Leaving directory '/tmp/libcap/src/libcap-2.25/libcap'
# make: *** [Makefile:12: all] Error 2
# make: Leaving directory '/tmp/libcap/src/libcap-2.25'
# ==> ERROR: A failure occurred in build().
# Aborting...