Improve build system

- Reduce full build latency from ~20s to ~18s
- Bring back silent mode if `make V=0` is passed
- Demodernize utimes() polyfill so it works RHEL5
- Delete some old shell scripts that are no longer needed
- Truncate long lines when outputting builds to Emacs buffers
This commit is contained in:
Justine Tunney 2021-02-19 22:20:38 -08:00
parent c797f139bb
commit b740cca642
39 changed files with 440 additions and 916 deletions

View file

@ -17,12 +17,33 @@
PERFORMANCE OF THIS SOFTWARE.
*/
#include "libc/calls/internal.h"
#include "libc/errno.h"
#include "libc/sysv/consts/at.h"
#include "libc/time/time.h"
#define __NR_utimensat_linux 0x118 /*RHEL5:CVE-2010-3301*/
int sys_utimensat(int dirfd, const char *path, const struct timespec ts[2],
int flags) {
int rc, olderr;
struct timeval tv[2];
if (!IsXnu()) {
return __sys_utimensat(dirfd, path, ts, flags);
olderr = errno;
rc = __sys_utimensat(dirfd, path, ts, flags);
if (((rc == -1 && errno == ENOSYS) || rc == __NR_utimensat_linux) &&
dirfd == AT_FDCWD && !flags) {
errno = olderr;
if (ts) {
tv[0].tv_sec = ts[0].tv_sec;
tv[0].tv_usec = ts[0].tv_nsec / 1000;
tv[1].tv_sec = ts[1].tv_sec;
tv[1].tv_usec = ts[1].tv_nsec / 1000;
rc = sys_utimes(path, tv);
} else {
rc = sys_utimes(path, NULL);
}
}
return rc;
} else {
return sys_utimensat_xnu(dirfd, path, ts, flags);
}