Build of luajit with musl toolchain

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

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

SLOCLanguage
59,696 ansic
548 makefile
60,244 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: luajit 2.0.4-2 (Tue Apr 4 23:52:42 UTC 2017)
# ==> Checking runtime dependencies...
# ==> Checking buildtime dependencies...
# ==> WARNING: Using existing $srcdir/ tree
# ==> Starting build()...
# Building LuaJIT 2.0.4
# make -C src amalg
# make[1]: Entering directory '/tmp/luajit/src/LuaJIT-2.0.4/src'
# +--------------------------------------------------------------------------+
# | WARNING: Compiling the amalgamation needs a lot of virtual memory |
# | (around 300 MB with GCC 4.x)! If you don't have enough physical memory |
# | your machine will start swapping to disk and the compile will not finish |
# | within a reasonable amount of time. |
# | So either compile on a bigger machine or use the non-amalgamated build. |
# +--------------------------------------------------------------------------+
# make all "LJCORE_O=ljamalg.o"
# make[2]: Entering directory '/tmp/luajit/src/LuaJIT-2.0.4/src'
# HOSTCC host/minilua.o
# HOSTCC host/buildvm_asm.o
# HOSTCC host/buildvm_peobj.o
# HOSTCC host/buildvm_lib.o
# HOSTCC host/buildvm_fold.o
# CC luajit.o
# HOSTLINK host/minilua
# DYNASM host/buildvm_arch.h
# host/minilua: error while loading shared libraries: /usr/lib/libc.so: invalid ELF header
# make[2]: *** [Makefile:604: host/buildvm_arch.h] Error 127
# make[2]: Leaving directory '/tmp/luajit/src/LuaJIT-2.0.4/src'
# make[1]: *** [Makefile:573: amalg] Error 2
# make[1]: Leaving directory '/tmp/luajit/src/LuaJIT-2.0.4/src'
# make: *** [Makefile:144: amalg] Error 2
# ==> ERROR: A failure occurred in build().
# Aborting...