The command " $STATS && ( LANG=C arm-none-eabi-size armsrc/obj/[hl]f_*.o |grep -v "filename" >> standalones_stats.txt )" is always false when $STATS is false (by default). So the exit code of the script is "1" and the build in Kali fails.