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:
Justine Tunney 2022-08-13 17:20:50 -07:00
parent 62ca1b0902
commit ead3fc2b31
53 changed files with 105 additions and 93 deletions

View file

@ -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_

View file

@ -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 */
/**

View file

@ -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

View file

@ -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 */
/**

View file

@ -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)

View file

@ -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 */
/**

View file

@ -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

View file

@ -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 */
/**

View file

@ -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() \

View file

@ -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"

View file

@ -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"

View file

@ -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"

View file

@ -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"

View file

@ -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 */
/*

View file

@ -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"

View file

@ -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"

View file

@ -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"

View file

@ -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"