Build of keyutils with musl toolchain

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

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

SLOCLanguage
3,044 sh
2,946 ansic
209 makefile
6,199 total

The process tree of the build process is here.

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: keyutils 1.5.9-1 (Wed Apr 5 01:09:40 UTC 2017)
# ==> Checking runtime dependencies...
# ==> Checking buildtime dependencies...
# ==> WARNING: Using existing $srcdir/ tree
# ==> Starting build()...
# grep: /etc/rpm/macros.dist: No such file or directory
# clang -I. -DPKGBUILD="\"2017-04-05\"" -DPKGVERSION="\"keyutils-1.5.9\"" -DAPIVERSION="\"libkeyutils-1.5\"" -fPIC -o keyutils.os -c keyutils.c
# clang -I. -o keyctl.o -c keyctl.c
# clang -I. -o request-key.o -c request-key.c
# clang -I. -o key.dns_resolver.o -c key.dns_resolver.c
# keyutils.c:21:10: fatal error: 'asm/unistd.h' file not found
# #include
# ^
# keyctl.c:21:10: fatal error: 'asm/unistd.h' file not found
# #include
# ^
# 1 error generated.
# key.dns_resolver.c:374:21: error: use of undeclared identifier 'UINT_MAX'
# unsigned int ttl = UINT_MAX, rr_ttl;
# ^
# make: *** [Makefile:133: keyutils.os] Error 1
# make: *** Waiting for unfinished jobs....
# key.dns_resolver.c:456:22: error: use of undeclared identifier 'ULONG_MAX'
# unsigned long ttl = ULONG_MAX;
# ^
# 2 errors generated.
# make: *** [Makefile:141: key.dns_resolver.o] Error 1
# 1 error generated.
# make: *** [Makefile:141: keyctl.o] Error 1
# ==> ERROR: A failure occurred in build().
# Aborting...