mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-03-15 05:16:30 +00:00
Fix Landlock Make so it can read pattern rule vars
It turned out that specifying all SRCS and INCS as dependencies on the pattern rules for all headers, caused `make` memory usage to skyrocket from 40mb ot 160mb. This change also reduces the build graph another 4%.
This commit is contained in:
parent
62ca1b0902
commit
ead3fc2b31
53 changed files with 105 additions and 93 deletions
11
Makefile
11
Makefile
|
@ -377,17 +377,6 @@ $(SRCS): \
|
|||
libc/integral/lp64arg.inc \
|
||||
libc/integral/lp64.inc
|
||||
|
||||
o/%.h.ok: %.h $(HDRS) $(INCS)
|
||||
@$(COMPILE) -ACHECK.h $(COMPILE.c) -xc -g0 -o $@ $<
|
||||
o/$(MODE)/%.h.ok: %.h $(HDRS) $(INCS)
|
||||
@$(COMPILE) -ACHECK.h $(COMPILE.c) -xc -g0 -o $@ $<
|
||||
o/$(MODE)/%.hh.ok: %.hh $(HDRS) $(INCS)
|
||||
@$(COMPILE) -ACHECK.h $(COMPILE.cxx) -xc++ -g0 -o $@ $<
|
||||
o/%.okk: % $(HDRS) $(INCS)
|
||||
@$(COMPILE) -ACHECK.h $(COMPILE.cxx) -xc++ -g0 -o $@ $<
|
||||
o/$(MODE)/%.okk: % $(HDRS) $(INCS)
|
||||
@$(COMPILE) -ACHECK.h $(COMPILE.cxx) -xc++ -g0 -o $@ $<
|
||||
|
||||
# UNSPECIFIED PREREQUISITES TUTORIAL
|
||||
#
|
||||
# A build rule must exist for all files that make needs to consider in
|
||||
|
|
|
@ -99,3 +99,27 @@ o/$(MODE)/%.lua.runs: %.lua o/$(MODE)/tool/net/redbean.com
|
|||
o/$(MODE)/%: o/$(MODE)/%.com o/$(MODE)/tool/build/cp.com o/$(MODE)/tool/build/assimilate.com
|
||||
@$(COMPILE) -wACP -T$@ o/$(MODE)/tool/build/cp.com $< $@
|
||||
@$(COMPILE) -wAASSIMILATE -T$@ o/$(MODE)/tool/build/assimilate.com $@
|
||||
|
||||
################################################################################
|
||||
# strict header checking
|
||||
# these rules are unsandboxed since they're kind of a sandboxing test themselves
|
||||
|
||||
o/%.h.ok: .UNSANDBOXED = 1
|
||||
o/%.h.ok: %.h
|
||||
@$(COMPILE) -ACHECK.h $(COMPILE.c) -xc -g0 -o $@ $<
|
||||
|
||||
o/$(MODE)/%.h.ok: .UNSANDBOXED = 1
|
||||
o/$(MODE)/%.h.ok: %.h
|
||||
@$(COMPILE) -ACHECK.h $(COMPILE.c) -xc -g0 -o $@ $<
|
||||
|
||||
o/$(MODE)/%.hh.ok: .UNSANDBOXED = 1
|
||||
o/$(MODE)/%.hh.ok: %.hh
|
||||
@$(COMPILE) -ACHECK.h $(COMPILE.cxx) -xc++ -g0 -o $@ $<
|
||||
|
||||
o/%.okk: .UNSANDBOXED = 1
|
||||
o/%.okk: %
|
||||
@$(COMPILE) -ACHECK.h $(COMPILE.cxx) -xc++ -g0 -o $@ $<
|
||||
|
||||
o/$(MODE)/%.okk: .UNSANDBOXED = 1
|
||||
o/$(MODE)/%.okk: %
|
||||
@$(COMPILE) -ACHECK.h $(COMPILE.cxx) -xc++ -g0 -o $@ $<
|
||||
|
|
|
@ -192,6 +192,7 @@ int unlink(const char *);
|
|||
int unlink_s(const char **);
|
||||
int unlinkat(int, const char *, int);
|
||||
int unveil(const char *, const char *);
|
||||
int usleep(unsigned);
|
||||
int vfork(void) returnstwice;
|
||||
int wait(int *);
|
||||
int waitpid(int, int *, int);
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
#include "libc/calls/struct/termios.h"
|
||||
#include "libc/calls/struct/winsize.h"
|
||||
#include "libc/calls/syscall_support-nt.internal.h"
|
||||
#include "libc/errno.h"
|
||||
#include "libc/intrin/spinlock.h"
|
||||
#include "libc/intrin/weaken.h"
|
||||
#include "libc/log/log.h"
|
||||
|
|
|
@ -16,11 +16,11 @@
|
|||
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
|
||||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/calls/calls.h"
|
||||
#include "libc/calls/syscall-sysv.internal.h"
|
||||
#include "libc/calls/termios.h"
|
||||
#include "libc/dce.h"
|
||||
#include "libc/sysv/consts/termios.h"
|
||||
#include "libc/time/time.h"
|
||||
|
||||
int tcsendbreak(int fd, int len) {
|
||||
if (!IsBsd()) {
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/dce.h"
|
||||
#include "libc/errno.h"
|
||||
#include "libc/intrin/promises.internal.h"
|
||||
#include "libc/log/libfatal.internal.h"
|
||||
#include "libc/log/log.h"
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
#define COSMOPOLITAN_LIBC_LOG_GDB_H_
|
||||
#include "libc/calls/calls.h"
|
||||
#include "libc/calls/wait4.h"
|
||||
#include "libc/dce.h"
|
||||
#include "libc/sysv/consts/nr.h"
|
||||
#include "libc/sysv/consts/w.h"
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
|
||||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/dce.h"
|
||||
#include "libc/fmt/itoa.h"
|
||||
#include "libc/log/log.h"
|
||||
#include "libc/str/str.h"
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_LOG_INTERNAL_H_
|
||||
#define COSMOPOLITAN_LIBC_LOG_INTERNAL_H_
|
||||
#include "libc/calls/struct/sigaction.h"
|
||||
#include "libc/calls/struct/siginfo.h"
|
||||
#include "libc/calls/struct/termios.h"
|
||||
#include "libc/calls/ucontext.h"
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
|
|
@ -1,19 +1,14 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_LOG_LOG_H_
|
||||
#define COSMOPOLITAN_LIBC_LOG_LOG_H_
|
||||
#include "libc/intrin/likely.h"
|
||||
#include "libc/intrin/weaken.h"
|
||||
#include "libc/calls/struct/rusage.h"
|
||||
#include "libc/calls/struct/sigset.h"
|
||||
#include "libc/calls/struct/winsize.h"
|
||||
#include "libc/dce.h"
|
||||
#include "libc/errno.h"
|
||||
#include "libc/intrin/likely.h"
|
||||
#include "libc/nexgen32e/stackframe.h"
|
||||
#include "libc/runtime/internal.h"
|
||||
#include "libc/runtime/runtime.h"
|
||||
#include "libc/stdio/stdio.h"
|
||||
/*───────────────────────────────────────────────────────────────────────────│─╗
|
||||
│ cosmopolitan § liblog ─╬─│┼
|
||||
╚────────────────────────────────────────────────────────────────────────────│*/
|
||||
|
||||
#define kLogFatal 0
|
||||
#define kLogError 1
|
||||
|
@ -65,9 +60,6 @@ void CheckForMemoryLeaks(void);
|
|||
|
||||
#define showcrashreports() ShowCrashReports()
|
||||
|
||||
/*───────────────────────────────────────────────────────────────────────────│─╗
|
||||
│ cosmopolitan § liblog » logging ─╬─│┼
|
||||
╚────────────────────────────────────────────────────────────────────────────│*/
|
||||
#ifndef __STRICT_ANSI__
|
||||
|
||||
extern unsigned __log_level; /* log level for runtime check */
|
||||
|
@ -194,10 +186,6 @@ extern unsigned __log_level; /* log level for runtime check */
|
|||
} \
|
||||
} while (0)
|
||||
|
||||
/*───────────────────────────────────────────────────────────────────────────│─╗
|
||||
│ cosmopolitan § liblog » on error resume next ─╬─│┼
|
||||
╚────────────────────────────────────────────────────────────────────────────│*/
|
||||
|
||||
#define LOGIFNEG1(FORM) \
|
||||
({ \
|
||||
int e = errno; \
|
||||
|
@ -224,10 +212,6 @@ extern unsigned __log_level; /* log level for runtime check */
|
|||
Ax; \
|
||||
})
|
||||
|
||||
/*───────────────────────────────────────────────────────────────────────────│─╗
|
||||
│ cosmopolitan § liblog » implementation details ─╬─│┼
|
||||
╚────────────────────────────────────────────────────────────────────────────│*/
|
||||
|
||||
void __logerrno(const char *, int, const char *) relegated;
|
||||
|
||||
#define ARGS unsigned, const char *, int, FILE *, const char *
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
#include "libc/calls/calls.h"
|
||||
#include "libc/calls/struct/sigaction.h"
|
||||
#include "libc/calls/struct/sigaltstack.h"
|
||||
#include "libc/errno.h"
|
||||
#include "libc/log/internal.h"
|
||||
#include "libc/log/log.h"
|
||||
#include "libc/macros.internal.h"
|
||||
|
|
|
@ -29,7 +29,6 @@ extern unsigned char _tls_content[];
|
|||
void _init(void) hidden;
|
||||
void __enable_tls(void);
|
||||
void __enable_threads(void) hidden;
|
||||
void __restorewintty(void) hidden;
|
||||
void *__cxa_finalize(void *) hidden;
|
||||
void cosmo(int, char **, char **, long (*)[2]) hidden wontreturn;
|
||||
void __stack_chk_fail(void) wontreturn relegated;
|
||||
|
|
|
@ -125,6 +125,7 @@ void __print_maps(void);
|
|||
void __warn_if_powersave(void);
|
||||
const char *__describe_os(void);
|
||||
bool IsDynamicExecutable(const char *);
|
||||
void __restorewintty(void);
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
|
|
|
@ -16,9 +16,10 @@
|
|||
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
|
||||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/intrin/bits.h"
|
||||
#include "libc/calls/calls.h"
|
||||
#include "libc/calls/struct/sigaction.h"
|
||||
#include "libc/errno.h"
|
||||
#include "libc/intrin/bits.h"
|
||||
#include "libc/intrin/kprintf.h"
|
||||
#include "libc/log/backtrace.internal.h"
|
||||
#include "libc/log/internal.h"
|
||||
|
@ -29,6 +30,7 @@
|
|||
#include "libc/runtime/runtime.h"
|
||||
#include "libc/stdio/stdio.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "libc/sysv/consts/sig.h"
|
||||
#include "libc/testlib/testlib.h"
|
||||
#include "third_party/dlmalloc/dlmalloc.h"
|
||||
|
||||
|
|
|
@ -16,9 +16,6 @@
|
|||
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
|
||||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/intrin/bits.h"
|
||||
#include "libc/intrin/safemacros.internal.h"
|
||||
#include "libc/intrin/weaken.h"
|
||||
#include "libc/calls/calls.h"
|
||||
#include "libc/calls/strace.internal.h"
|
||||
#include "libc/calls/struct/rlimit.h"
|
||||
|
@ -26,8 +23,12 @@
|
|||
#include "libc/calls/struct/sigset.h"
|
||||
#include "libc/calls/syscall-sysv.internal.h"
|
||||
#include "libc/dce.h"
|
||||
#include "libc/errno.h"
|
||||
#include "libc/intrin/asan.internal.h"
|
||||
#include "libc/intrin/bits.h"
|
||||
#include "libc/intrin/kprintf.h"
|
||||
#include "libc/intrin/safemacros.internal.h"
|
||||
#include "libc/intrin/weaken.h"
|
||||
#include "libc/log/check.h"
|
||||
#include "libc/log/color.internal.h"
|
||||
#include "libc/log/libfatal.internal.h"
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#include "libc/fmt/fmt.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "libc/time/struct/tm.h"
|
||||
#include "libc/time/time.h"
|
||||
#include "libc/time/tz.internal.h"
|
||||
#include "third_party/python/Include/object.h"
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#include "libc/calls/weirdtypes.h"
|
||||
#include "libc/time/struct/tm.h"
|
||||
#include "libc/time/time.h"
|
||||
|
||||
char *ctime(const time_t *timep) {
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
#include "libc/runtime/gc.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "libc/sysv/consts/o.h"
|
||||
#include "libc/time/struct/tm.h"
|
||||
#include "libc/time/time.h"
|
||||
#include "libc/time/tz.internal.h"
|
||||
#include "libc/time/tzfile.internal.h"
|
||||
|
|
|
@ -17,19 +17,21 @@ struct tm {
|
|||
const char *tm_zone;
|
||||
};
|
||||
|
||||
struct tm *gmtime_r(const int64_t *, struct tm *);
|
||||
struct tm *localtime_r(const int64_t *, struct tm *);
|
||||
int64_t timegm(struct tm *);
|
||||
int64_t mktime(struct tm *);
|
||||
int64_t timelocal(struct tm *);
|
||||
int64_t timeoff(struct tm *, long);
|
||||
char *strptime(const char *, const char *, struct tm *);
|
||||
size_t strftime(char *, size_t, const char *, const struct tm *)
|
||||
strftimeesque(3);
|
||||
char *asctime(const struct tm *);
|
||||
char *asctime_r(const struct tm *, char[hasatleast 64]);
|
||||
char *iso8601(char[hasatleast 20], struct tm *);
|
||||
char *strptime(const char *, const char *, struct tm *);
|
||||
int64_t mktime(struct tm *);
|
||||
int64_t timegm(struct tm *);
|
||||
int64_t timelocal(struct tm *);
|
||||
int64_t timeoff(struct tm *, long);
|
||||
size_t strftime(char *, size_t, const char *, const struct tm *)
|
||||
strftimeesque(3);
|
||||
size_t wcsftime(wchar_t *, size_t, const wchar_t *, const struct tm *);
|
||||
struct tm *gmtime(const int64_t *);
|
||||
struct tm *gmtime_r(const int64_t *, struct tm *);
|
||||
struct tm *localtime(const int64_t *);
|
||||
struct tm *localtime_r(const int64_t *, struct tm *);
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
|
|
|
@ -8,6 +8,8 @@ struct utimbuf {
|
|||
int64_t modtime; /* modified time */
|
||||
};
|
||||
|
||||
int utime(const char *, const struct utimbuf *);
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_LIBC_TIME_STRUCT_UTIMBUF_H_ */
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_TIME_TIME_H_
|
||||
#define COSMOPOLITAN_LIBC_TIME_TIME_H_
|
||||
#include "libc/time/struct/tm.h"
|
||||
#include "libc/time/struct/utimbuf.h"
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
|
@ -20,8 +18,6 @@ char *ctime(const int64_t *);
|
|||
char *ctime_r(const int64_t *, char[hasatleast 64]);
|
||||
double difftime(int64_t, int64_t) dontthrow pureconst;
|
||||
extern long double (*nowl)(void);
|
||||
int usleep(uint32_t);
|
||||
int utime(const char *, const struct utimbuf *);
|
||||
int64_t clock(void);
|
||||
int64_t posix2time(int64_t) pureconst;
|
||||
int64_t time(int64_t *);
|
||||
|
@ -29,8 +25,6 @@ int64_t time2posix(int64_t) pureconst;
|
|||
long double ConvertTicksToNanos(uint64_t);
|
||||
long double dsleep(long double);
|
||||
long double dtime(int);
|
||||
struct tm *gmtime(const int64_t *);
|
||||
struct tm *localtime(const int64_t *);
|
||||
unsigned alarm(unsigned);
|
||||
unsigned sleep(unsigned);
|
||||
void RefreshTime(void);
|
||||
|
|
|
@ -16,12 +16,12 @@
|
|||
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
|
||||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/intrin/bits.h"
|
||||
#include "libc/intrin/safemacros.internal.h"
|
||||
#include "libc/calls/calls.h"
|
||||
#include "libc/calls/struct/stat.h"
|
||||
#include "libc/errno.h"
|
||||
#include "libc/intrin/bits.h"
|
||||
#include "libc/intrin/lockcmpxchg.h"
|
||||
#include "libc/intrin/safemacros.internal.h"
|
||||
#include "libc/log/check.h"
|
||||
#include "libc/log/log.h"
|
||||
#include "libc/macros.internal.h"
|
||||
|
@ -31,6 +31,7 @@
|
|||
#include "libc/sysv/consts/map.h"
|
||||
#include "libc/sysv/consts/o.h"
|
||||
#include "libc/sysv/consts/prot.h"
|
||||
#include "libc/time/time.h"
|
||||
#include "net/https/sslcache.h"
|
||||
#include "third_party/mbedtls/ssl.h"
|
||||
#include "third_party/mbedtls/x509_crt.h"
|
||||
|
|
|
@ -28,9 +28,9 @@
|
|||
#include "libc/intrin/wait0.internal.h"
|
||||
#include "libc/macros.internal.h"
|
||||
#include "libc/nexgen32e/threaded.h"
|
||||
#include "libc/stdio/rand.h"
|
||||
#include "libc/runtime/internal.h"
|
||||
#include "libc/runtime/stack.h"
|
||||
#include "libc/stdio/rand.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "libc/sysv/consts/clone.h"
|
||||
#include "libc/sysv/consts/itimer.h"
|
||||
|
@ -43,6 +43,7 @@
|
|||
#include "libc/testlib/hyperion.h"
|
||||
#include "libc/testlib/testlib.h"
|
||||
#include "libc/thread/spawn.h"
|
||||
#include "libc/time/struct/tm.h"
|
||||
#include "libc/time/time.h"
|
||||
|
||||
STATIC_YOINK("zip_uri_support");
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
#include "libc/limits.h"
|
||||
#include "libc/log/log.h"
|
||||
#include "libc/mem/mem.h"
|
||||
#include "libc/runtime/internal.h"
|
||||
#include "libc/runtime/symbols.internal.h"
|
||||
#include "libc/stdio/stdio.h"
|
||||
#include "libc/str/str.h"
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
#include "libc/limits.h"
|
||||
#include "libc/runtime/runtime.h"
|
||||
#include "libc/testlib/testlib.h"
|
||||
#include "libc/time/struct/tm.h"
|
||||
#include "libc/time/time.h"
|
||||
|
||||
textstartup static void strftime_test_init(void) {
|
||||
|
|
1
third_party/finger/lprint.c
vendored
1
third_party/finger/lprint.c
vendored
|
@ -41,6 +41,7 @@
|
|||
#include "libc/str/str.h"
|
||||
#include "libc/sysv/consts/o.h"
|
||||
#include "libc/sysv/consts/s.h"
|
||||
#include "libc/time/struct/tm.h"
|
||||
#include "libc/time/time.h"
|
||||
#include "third_party/finger/finger.h"
|
||||
// clang-format off
|
||||
|
|
1
third_party/finger/sprint.c
vendored
1
third_party/finger/sprint.c
vendored
|
@ -37,6 +37,7 @@
|
|||
#include "libc/mem/mem.h"
|
||||
#include "libc/runtime/runtime.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "libc/time/struct/tm.h"
|
||||
#include "libc/time/time.h"
|
||||
#include "third_party/finger/finger.h"
|
||||
// clang-format off
|
||||
|
|
12
third_party/make/job.c
vendored
12
third_party/make/job.c
vendored
|
@ -1773,7 +1773,11 @@ child_execute_job (struct childbase *child, int good_stdin, char **argv)
|
|||
(STRING_SIZE_TUPLE(".UNSANDBOXED"))) &&
|
||||
(!c || !Vartoi (lookup_variable_in_set
|
||||
(STRING_SIZE_TUPLE(".UNSANDBOXED"),
|
||||
c->file->variables->set))));
|
||||
c->file->variables->set))) &&
|
||||
(!c || !c->file->pat_variables ||
|
||||
!Vartoi (lookup_variable_in_set
|
||||
(STRING_SIZE_TUPLE(".UNSANDBOXED"),
|
||||
c->file->pat_variables->set))));
|
||||
|
||||
/* resolve command into executable path */
|
||||
if (!g_strict || !sandboxed)
|
||||
|
@ -1919,6 +1923,12 @@ child_execute_job (struct childbase *child, int good_stdin, char **argv)
|
|||
(lookup_variable_in_set
|
||||
(STRING_SIZE_TUPLE (".UNVEIL"),
|
||||
c->file->variables->set)));
|
||||
if (c->file->pat_variables)
|
||||
RETURN_ON_ERROR
|
||||
(UnveilVariable
|
||||
(lookup_variable_in_set
|
||||
(STRING_SIZE_TUPLE (".UNVEIL"),
|
||||
c->file->pat_variables->set)));
|
||||
|
||||
/* commit sandbox */
|
||||
RETURN_ON_ERROR (Unveil (0, 0));
|
||||
|
|
1
third_party/mbedtls/bignum_internal.h
vendored
1
third_party/mbedtls/bignum_internal.h
vendored
|
@ -1,6 +1,5 @@
|
|||
#ifndef COSMOPOLITAN_THIRD_PARTY_MBEDTLS_BIGNUM_INTERNAL_H_
|
||||
#define COSMOPOLITAN_THIRD_PARTY_MBEDTLS_BIGNUM_INTERNAL_H_
|
||||
#include "third_party/mbedtls/bignum.h"
|
||||
#include "third_party/mbedtls/platform.h"
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
|
2
third_party/mbedtls/chachapoly.h
vendored
2
third_party/mbedtls/chachapoly.h
vendored
|
@ -33,8 +33,6 @@ typedef struct mbedtls_chachapoly_context
|
|||
}
|
||||
mbedtls_chachapoly_context;
|
||||
|
||||
#else /* !MBEDTLS_CHACHAPOLY_ALT */
|
||||
/* #include "third_party/mbedtls/chachapoly_alt.h" */
|
||||
#endif /* !MBEDTLS_CHACHAPOLY_ALT */
|
||||
|
||||
/**
|
||||
|
|
9
third_party/mbedtls/config.h
vendored
9
third_party/mbedtls/config.h
vendored
|
@ -1,12 +1,5 @@
|
|||
#ifndef MBEDTLS_CONFIG_H_
|
||||
#define MBEDTLS_CONFIG_H_
|
||||
#include "libc/dce.h"
|
||||
|
||||
/* /\* uncomment for testing old cpu code paths *\/ */
|
||||
/* #include "libc/nexgen32e/x86feature.h" */
|
||||
/* #undef X86_HAVE */
|
||||
/* #define X86_HAVE(x) 0 */
|
||||
/* #undef __x86_64__ */
|
||||
|
||||
/* protocols */
|
||||
#define MBEDTLS_SSL_PROTO_TLS1_2
|
||||
|
@ -146,7 +139,7 @@
|
|||
#define MBEDTLS_ZLIB_SUPPORT
|
||||
#endif
|
||||
|
||||
#if IsModeDbg()
|
||||
#ifdef MODE_DBG
|
||||
#define MBEDTLS_CHECK_PARAMS
|
||||
#endif
|
||||
|
||||
|
|
2
third_party/mbedtls/dhm.h
vendored
2
third_party/mbedtls/dhm.h
vendored
|
@ -47,8 +47,6 @@ typedef struct mbedtls_dhm_context
|
|||
}
|
||||
mbedtls_dhm_context;
|
||||
|
||||
#else /* MBEDTLS_DHM_ALT */
|
||||
/* #include "third_party/mbedtls/dhm_alt.h" */
|
||||
#endif /* MBEDTLS_DHM_ALT */
|
||||
|
||||
/**
|
||||
|
|
3
third_party/mbedtls/ecp.h
vendored
3
third_party/mbedtls/ecp.h
vendored
|
@ -1,6 +1,5 @@
|
|||
#ifndef COSMOPOLITAN_THIRD_PARTY_MBEDTLS_ECP_H_
|
||||
#define COSMOPOLITAN_THIRD_PARTY_MBEDTLS_ECP_H_
|
||||
#include "libc/log/backtrace.internal.h"
|
||||
#include "third_party/mbedtls/bignum.h"
|
||||
#include "third_party/mbedtls/config.h"
|
||||
COSMOPOLITAN_C_START_
|
||||
|
@ -233,8 +232,6 @@ mbedtls_ecp_group;
|
|||
|
||||
/* \} name SECTION: Module settings */
|
||||
|
||||
#else /* MBEDTLS_ECP_ALT */
|
||||
/* #include "third_party/mbedtls/ecp_alt.h" */
|
||||
#endif /* MBEDTLS_ECP_ALT */
|
||||
|
||||
#if defined(MBEDTLS_ECP_RESTARTABLE)
|
||||
|
|
2
third_party/mbedtls/nist_kw.h
vendored
2
third_party/mbedtls/nist_kw.h
vendored
|
@ -29,8 +29,6 @@ typedef struct {
|
|||
mbedtls_cipher_context_t cipher_ctx; /*!< The cipher context used. */
|
||||
} mbedtls_nist_kw_context;
|
||||
|
||||
#else /* MBEDTLS_NIST_key wrapping_ALT */
|
||||
/* #include "third_party/mbedtls/nist_kw_alt.h" */
|
||||
#endif /* MBEDTLS_NIST_KW_ALT */
|
||||
|
||||
/**
|
||||
|
|
6
third_party/mbedtls/platform.h
vendored
6
third_party/mbedtls/platform.h
vendored
|
@ -1,13 +1,11 @@
|
|||
#ifndef COSMOPOLITAN_THIRD_PARTY_MBEDTLS_PLATFORM_H_
|
||||
#define COSMOPOLITAN_THIRD_PARTY_MBEDTLS_PLATFORM_H_
|
||||
#include "libc/assert.h"
|
||||
#include "libc/intrin/likely.h"
|
||||
#include "libc/calls/weirdtypes.h"
|
||||
#include "libc/fmt/fmt.h"
|
||||
#include "libc/intrin/likely.h"
|
||||
#include "libc/mem/mem.h"
|
||||
#include "libc/runtime/runtime.h"
|
||||
#include "libc/stdio/stdio.h"
|
||||
#include "libc/time/time.h"
|
||||
#include "third_party/mbedtls/config.h"
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
|
@ -19,7 +17,7 @@ COSMOPOLITAN_C_START_
|
|||
#define mbedtls_snprintf snprintf
|
||||
#define mbedtls_vsnprintf vsnprintf
|
||||
#define mbedtls_exit exit
|
||||
#define mbedtls_time_t time_t
|
||||
#define mbedtls_time_t int64_t
|
||||
#define mbedtls_time time
|
||||
#define mbedtls_platform_gmtime_r gmtime_r
|
||||
|
||||
|
|
2
third_party/mbedtls/poly1305.h
vendored
2
third_party/mbedtls/poly1305.h
vendored
|
@ -29,8 +29,6 @@ typedef struct mbedtls_poly1305_context
|
|||
}
|
||||
mbedtls_poly1305_context;
|
||||
|
||||
#else /* MBEDTLS_POLY1305_ALT */
|
||||
/* #include "third_party/mbedtls/poly1305_alt.h" */
|
||||
#endif /* MBEDTLS_POLY1305_ALT */
|
||||
|
||||
/**
|
||||
|
|
1
third_party/mbedtls/profile.h
vendored
1
third_party/mbedtls/profile.h
vendored
|
@ -4,7 +4,6 @@
|
|||
#include "libc/log/log.h"
|
||||
#include "libc/nexgen32e/bench.h"
|
||||
#include "libc/nexgen32e/rdtsc.h"
|
||||
#include "libc/time/time.h"
|
||||
#if 1
|
||||
|
||||
#define START() \
|
||||
|
|
1
third_party/mbedtls/ssl_cache.c
vendored
1
third_party/mbedtls/ssl_cache.c
vendored
|
@ -16,6 +16,7 @@
|
|||
│ limitations under the License. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/log/log.h"
|
||||
#include "libc/time/time.h"
|
||||
#include "third_party/mbedtls/common.h"
|
||||
#include "third_party/mbedtls/platform.h"
|
||||
#include "third_party/mbedtls/ssl_cache.h"
|
||||
|
|
1
third_party/mbedtls/ssl_cli.c
vendored
1
third_party/mbedtls/ssl_cli.c
vendored
|
@ -15,6 +15,7 @@
|
|||
│ See the License for the specific language governing permissions and │
|
||||
│ limitations under the License. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/time/time.h"
|
||||
#include "third_party/mbedtls/common.h"
|
||||
#include "third_party/mbedtls/debug.h"
|
||||
#include "third_party/mbedtls/error.h"
|
||||
|
|
1
third_party/mbedtls/ssl_srv.c
vendored
1
third_party/mbedtls/ssl_srv.c
vendored
|
@ -18,6 +18,7 @@
|
|||
#include "libc/log/log.h"
|
||||
#include "libc/macros.internal.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "libc/time/time.h"
|
||||
#include "third_party/mbedtls/common.h"
|
||||
#include "third_party/mbedtls/debug.h"
|
||||
#include "third_party/mbedtls/ecp.h"
|
||||
|
|
1
third_party/mbedtls/ssl_ticket.c
vendored
1
third_party/mbedtls/ssl_ticket.c
vendored
|
@ -15,6 +15,7 @@
|
|||
│ See the License for the specific language governing permissions and │
|
||||
│ limitations under the License. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/time/time.h"
|
||||
#include "third_party/mbedtls/common.h"
|
||||
#include "third_party/mbedtls/error.h"
|
||||
#include "third_party/mbedtls/platform.h"
|
||||
|
|
2
third_party/mbedtls/ssl_tls.c
vendored
2
third_party/mbedtls/ssl_tls.c
vendored
|
@ -6142,7 +6142,7 @@ static int ssl_session_load( mbedtls_ssl_session *session,
|
|||
start = Read64be(p);
|
||||
p += 8;
|
||||
|
||||
session->start = (time_t) start;
|
||||
session->start = (int64_t) start;
|
||||
#endif /* MBEDTLS_HAVE_TIME */
|
||||
|
||||
/*
|
||||
|
|
1
third_party/mbedtls/test/everest_unravaged.c
vendored
1
third_party/mbedtls/test/everest_unravaged.c
vendored
|
@ -1,5 +1,6 @@
|
|||
#include "libc/intrin/bits.h"
|
||||
#include "libc/limits.h"
|
||||
#include "libc/time/time.h"
|
||||
#include "third_party/mbedtls/asn1.h"
|
||||
#include "third_party/mbedtls/bignum.h"
|
||||
#include "third_party/mbedtls/common.h"
|
||||
|
|
7
third_party/mbedtls/test/lib.c
vendored
7
third_party/mbedtls/test/lib.c
vendored
|
@ -15,13 +15,13 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
#include "libc/assert.h"
|
||||
#include "libc/intrin/bits.h"
|
||||
#include "libc/intrin/safemacros.internal.h"
|
||||
#include "libc/calls/calls.h"
|
||||
#include "libc/dce.h"
|
||||
#include "libc/fmt/conv.h"
|
||||
#include "libc/fmt/fmt.h"
|
||||
#include "libc/intrin/bits.h"
|
||||
#include "libc/intrin/kprintf.h"
|
||||
#include "libc/intrin/safemacros.internal.h"
|
||||
#include "libc/log/backtrace.internal.h"
|
||||
#include "libc/log/check.h"
|
||||
#include "libc/log/libfatal.internal.h"
|
||||
|
@ -29,15 +29,16 @@
|
|||
#include "libc/mem/mem.h"
|
||||
#include "libc/nexgen32e/vendor.internal.h"
|
||||
#include "libc/nt/runtime.h"
|
||||
#include "libc/stdio/rand.h"
|
||||
#include "libc/runtime/internal.h"
|
||||
#include "libc/runtime/runtime.h"
|
||||
#include "libc/runtime/symbols.internal.h"
|
||||
#include "libc/stdio/append.internal.h"
|
||||
#include "libc/stdio/rand.h"
|
||||
#include "libc/stdio/stdio.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "libc/sysv/consts/exit.h"
|
||||
#include "libc/sysv/consts/nr.h"
|
||||
#include "libc/time/time.h"
|
||||
#include "libc/x/x.h"
|
||||
#include "third_party/mbedtls/config.h"
|
||||
#include "third_party/mbedtls/endian.h"
|
||||
|
|
1
third_party/mbedtls/test/test_suite_ssl.c
vendored
1
third_party/mbedtls/test/test_suite_ssl.c
vendored
|
@ -19,6 +19,7 @@
|
|||
#include "third_party/mbedtls/ssl_invasive.h"
|
||||
#include "libc/testlib/testlib.h"
|
||||
#include "libc/log/log.h"
|
||||
#include "libc/time/time.h"
|
||||
#include "libc/stdio/rand.h"
|
||||
#include "libc/intrin/safemacros.internal.h"
|
||||
#include "third_party/mbedtls/test/test.inc"
|
||||
|
|
1
third_party/mbedtls/x509.c
vendored
1
third_party/mbedtls/x509.c
vendored
|
@ -19,6 +19,7 @@
|
|||
#include "libc/mem/mem.h"
|
||||
#include "libc/stdio/stdio.h"
|
||||
#include "libc/time/struct/tm.h"
|
||||
#include "libc/time/time.h"
|
||||
#include "third_party/mbedtls/asn1.h"
|
||||
#include "third_party/mbedtls/certs.h"
|
||||
#include "third_party/mbedtls/common.h"
|
||||
|
|
1
third_party/unzip/unix.c
vendored
1
third_party/unzip/unix.c
vendored
|
@ -33,6 +33,7 @@
|
|||
#include "libc/log/log.h"
|
||||
#include "libc/time/time.h"
|
||||
#include "third_party/unzip/unzip.h"
|
||||
#include "libc/time/struct/utimbuf.h"
|
||||
#include "third_party/unzip/globals.h"
|
||||
|
||||
#ifdef USE_ICONV_MAPPING
|
||||
|
|
1
third_party/zip/unix.c
vendored
1
third_party/zip/unix.c
vendored
|
@ -7,6 +7,7 @@
|
|||
#include "libc/calls/struct/stat.macros.h"
|
||||
#include "libc/calls/calls.h"
|
||||
#include "third_party/zip/osdep.h"
|
||||
#include "libc/time/struct/utimbuf.h"
|
||||
#include "libc/sysv/consts/dt.h"
|
||||
|
||||
/*
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
#include "libc/calls/termios.h"
|
||||
#include "libc/calls/ucontext.h"
|
||||
#include "libc/dce.h"
|
||||
#include "libc/errno.h"
|
||||
#include "libc/fmt/bing.internal.h"
|
||||
#include "libc/fmt/conv.h"
|
||||
#include "libc/fmt/fmt.h"
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
|
||||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/intrin/safemacros.internal.h"
|
||||
#include "libc/calls/calls.h"
|
||||
#include "libc/calls/struct/stat.h"
|
||||
#include "libc/dce.h"
|
||||
|
@ -25,7 +24,9 @@
|
|||
#include "libc/elf/struct/rela.h"
|
||||
#include "libc/elf/struct/shdr.h"
|
||||
#include "libc/elf/struct/sym.h"
|
||||
#include "libc/errno.h"
|
||||
#include "libc/fmt/itoa.h"
|
||||
#include "libc/intrin/safemacros.internal.h"
|
||||
#include "libc/log/check.h"
|
||||
#include "libc/log/log.h"
|
||||
#include "libc/runtime/runtime.h"
|
||||
|
|
|
@ -76,6 +76,7 @@
|
|||
#include "libc/sysv/consts/w.h"
|
||||
#include "libc/sysv/errfuns.h"
|
||||
#include "libc/time/struct/timezone.h"
|
||||
#include "libc/time/struct/utimbuf.h"
|
||||
#include "libc/time/time.h"
|
||||
#include "libc/x/x.h"
|
||||
#include "third_party/mbedtls/endian.h"
|
||||
|
|
|
@ -23,7 +23,6 @@
|
|||
#include "libc/calls/struct/flock.h"
|
||||
#include "libc/calls/struct/iovec.h"
|
||||
#include "libc/calls/struct/rusage.h"
|
||||
#include "libc/calls/struct/seccomp.h"
|
||||
#include "libc/calls/struct/sigaction.h"
|
||||
#include "libc/calls/struct/stat.h"
|
||||
#include "libc/calls/struct/termios.h"
|
||||
|
@ -57,6 +56,7 @@
|
|||
#include "libc/runtime/gc.h"
|
||||
#include "libc/runtime/gc.internal.h"
|
||||
#include "libc/runtime/internal.h"
|
||||
#include "libc/runtime/memtrack.internal.h"
|
||||
#include "libc/runtime/runtime.h"
|
||||
#include "libc/runtime/stack.h"
|
||||
#include "libc/sock/goodsocket.internal.h"
|
||||
|
|
|
@ -5,17 +5,17 @@ import re
|
|||
import sys
|
||||
|
||||
def GetDeps(path):
|
||||
deps = set()
|
||||
def Dive(path, depth):
|
||||
if path in deps:
|
||||
def Dive(path, depth, visited):
|
||||
sys.stdout.write('%s%s' % ('\t' * depth, path))
|
||||
if path in visited:
|
||||
sys.stdout.write(' cycle\n')
|
||||
return
|
||||
deps.add(path)
|
||||
sys.stdout.write('%s%s\n' % ('\t' * depth, path))
|
||||
sys.stdout.write('\n')
|
||||
with open(path) as f:
|
||||
code = f.read()
|
||||
for dep in re.findall(r'[.#]include "([^"]+)"', code):
|
||||
Dive(dep, depth + 1)
|
||||
Dive(path, 0)
|
||||
Dive(dep, depth + 1, visited + [path])
|
||||
Dive(path, 0, [])
|
||||
sys.stdout.write('\n')
|
||||
|
||||
for arg in sys.argv[1:]:
|
||||
|
|
Loading…
Add table
Reference in a new issue