mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-17 16:10:29 +00:00
Unbloat build config
- 10.5% reduction of o//depend dependency graph - 8.8% reduction in latency of make command - Fix issue with temporary file cleanup There's a new -w option in compile.com that turns off the recent Landlock output path workaround for "good commands" which do not unlink() the output file like GNU tooling does. Our new GNU Make unveil sandboxing appears to have zero overhead in the grand scheme of things. Full builds are pretty fast since the only thing that's actually slowed us down is probably libcxx make -j16 MODE=rel RL: took 85,732,063µs wall time RL: ballooned to 323,612kb in size RL: needed 828,560,521µs cpu (11% kernel) RL: caused 39,080,670 page faults (99% memcpy) RL: 350,073 context switches (72% consensual) RL: performed 0 reads and 11,494,960 write i/o operations pledge() and unveil() no longer consider ENOSYS to be an error. These functions have also been added to Python's cosmo module. This change also removes some WIN32 APIs and System Five magnums which we're not using and it's doubtful anyone else would be too
This commit is contained in:
parent
133c693650
commit
ae5d06dc53
1423 changed files with 2213 additions and 5560 deletions
2
third_party/bzip2/bzip2recover.c
vendored
2
third_party/bzip2/bzip2recover.c
vendored
|
@ -2,8 +2,10 @@
|
|||
#include "libc/errno.h"
|
||||
#include "libc/fmt/fmt.h"
|
||||
#include "libc/log/log.h"
|
||||
#include "libc/mem/mem.h"
|
||||
#include "libc/runtime/runtime.h"
|
||||
#include "libc/stdio/stdio.h"
|
||||
#include "libc/str/str.h"
|
||||
/* clang-format off */
|
||||
|
||||
/*-----------------------------------------------------------*/
|
||||
|
|
1
third_party/bzip2/bzlib.c
vendored
1
third_party/bzip2/bzlib.c
vendored
|
@ -30,6 +30,7 @@
|
|||
*/
|
||||
|
||||
#include "libc/calls/calls.h"
|
||||
#include "libc/mem/mem.h"
|
||||
#include "third_party/bzip2/bzlib_private.inc"
|
||||
|
||||
|
||||
|
|
2
third_party/chibicc/test/test.mk
vendored
2
third_party/chibicc/test/test.mk
vendored
|
@ -72,7 +72,7 @@ o/$(MODE)/third_party/chibicc/test/%.com.dbg: \
|
|||
o/$(MODE)/third_party/chibicc/test/%.o: \
|
||||
third_party/chibicc/test/%.c \
|
||||
$(CHIBICC)
|
||||
@$(COMPILE) -AOBJECTIFY.c $(CHIBICC) $(CHIBICC_FLAGS) $(OUTPUT_OPTION) -c $<
|
||||
@$(COMPILE) -wAOBJECTIFY.c $(CHIBICC) $(CHIBICC_FLAGS) $(OUTPUT_OPTION) -c $<
|
||||
|
||||
o/$(MODE)/third_party/chibicc/test/int128_test.o: QUOTA = -M1024m
|
||||
|
||||
|
|
1
third_party/dlmalloc/dlmalloc.c
vendored
1
third_party/dlmalloc/dlmalloc.c
vendored
|
@ -13,6 +13,7 @@
|
|||
#include "libc/runtime/runtime.h"
|
||||
#include "libc/runtime/sysconf.h"
|
||||
#include "libc/stdio/stdio.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "libc/sysv/consts/map.h"
|
||||
#include "libc/sysv/consts/prot.h"
|
||||
#include "third_party/dlmalloc/dlmalloc.h"
|
||||
|
|
|
@ -122,39 +122,39 @@ THIRD_PARTY_DOUBLECONVERSION_TEST_RUNS = \
|
|||
|
||||
o/$(MODE)/third_party/double-conversion/test-strtod.runs: \
|
||||
o/$(MODE)/third_party/double-conversion/double-conversion-tester.com
|
||||
@$(COMPILE) -ACHECK -tT$@ $< test-strtod
|
||||
@$(COMPILE) -wACHECK -tT$@ $< test-strtod
|
||||
|
||||
o/$(MODE)/third_party/double-conversion/test-ieee.runs: \
|
||||
o/$(MODE)/third_party/double-conversion/double-conversion-tester.com
|
||||
@$(COMPILE) -ACHECK -tT$@ $< test-ieee
|
||||
@$(COMPILE) -wACHECK -tT$@ $< test-ieee
|
||||
|
||||
o/$(MODE)/third_party/double-conversion/test-fixed-dtoa.runs: \
|
||||
o/$(MODE)/third_party/double-conversion/double-conversion-tester.com
|
||||
@$(COMPILE) -ACHECK -tT$@ $< test-fixed-dtoa
|
||||
@$(COMPILE) -wACHECK -tT$@ $< test-fixed-dtoa
|
||||
|
||||
o/$(MODE)/third_party/double-conversion/test-fast-dtoa.runs: \
|
||||
o/$(MODE)/third_party/double-conversion/double-conversion-tester.com
|
||||
@$(COMPILE) -ACHECK -tT$@ $< test-fast-dtoa
|
||||
@$(COMPILE) -wACHECK -tT$@ $< test-fast-dtoa
|
||||
|
||||
o/$(MODE)/third_party/double-conversion/test-dtoa.runs: \
|
||||
o/$(MODE)/third_party/double-conversion/double-conversion-tester.com
|
||||
@$(COMPILE) -ACHECK -tT$@ $< test-dtoa
|
||||
@$(COMPILE) -wACHECK -tT$@ $< test-dtoa
|
||||
|
||||
o/$(MODE)/third_party/double-conversion/test-diy-fp.runs: \
|
||||
o/$(MODE)/third_party/double-conversion/double-conversion-tester.com
|
||||
@$(COMPILE) -ACHECK -tT$@ $< test-diy-fp
|
||||
@$(COMPILE) -wACHECK -tT$@ $< test-diy-fp
|
||||
|
||||
o/$(MODE)/third_party/double-conversion/test-conversions.runs: \
|
||||
o/$(MODE)/third_party/double-conversion/double-conversion-tester.com
|
||||
@$(COMPILE) -ACHECK -tT$@ $< test-conversions
|
||||
@$(COMPILE) -wACHECK -tT$@ $< test-conversions
|
||||
|
||||
o/$(MODE)/third_party/double-conversion/test-bignum-dtoa.runs: \
|
||||
o/$(MODE)/third_party/double-conversion/double-conversion-tester.com
|
||||
@$(COMPILE) -ACHECK -tT$@ $< test-bignum-dtoa
|
||||
@$(COMPILE) -wACHECK -tT$@ $< test-bignum-dtoa
|
||||
|
||||
o/$(MODE)/third_party/double-conversion/test-bignum.runs: \
|
||||
o/$(MODE)/third_party/double-conversion/double-conversion-tester.com
|
||||
@$(COMPILE) -ACHECK -tT$@ $< test-bignum
|
||||
@$(COMPILE) -wACHECK -tT$@ $< test-bignum
|
||||
|
||||
THIRD_PARTY_DOUBLECONVERSION_LIBS = $(foreach x,$(THIRD_PARTY_DOUBLECONVERSION_ARTIFACTS),$($(x)))
|
||||
THIRD_PARTY_DOUBLECONVERSION_SRCS = $(foreach x,$(THIRD_PARTY_DOUBLECONVERSION_ARTIFACTS),$($(x)_SRCS))
|
||||
|
|
1
third_party/finger/display.c
vendored
1
third_party/finger/display.c
vendored
|
@ -39,6 +39,7 @@
|
|||
#include "libc/calls/termios.h"
|
||||
#include "libc/fmt/fmt.h"
|
||||
#include "libc/stdio/stdio.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "libc/sysv/consts/fileno.h"
|
||||
#include "libc/sysv/consts/termios.h"
|
||||
#include "third_party/finger/finger.h"
|
||||
|
|
3
third_party/finger/finger.c
vendored
3
third_party/finger/finger.c
vendored
|
@ -37,10 +37,13 @@
|
|||
#include "libc/calls/struct/stat.h"
|
||||
#include "libc/calls/weirdtypes.h"
|
||||
#include "libc/fmt/fmt.h"
|
||||
#include "libc/mem/mem.h"
|
||||
#include "libc/nt/struct/msg.h"
|
||||
#include "libc/runtime/runtime.h"
|
||||
#include "libc/runtime/utmp.h"
|
||||
#include "libc/sock/sock.h"
|
||||
#include "libc/sock/struct/sockaddr.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "libc/sysv/consts/fileno.h"
|
||||
#include "libc/time/time.h"
|
||||
#include "third_party/finger/finger.h"
|
||||
|
|
2
third_party/finger/util.c
vendored
2
third_party/finger/util.c
vendored
|
@ -38,7 +38,9 @@
|
|||
#include "libc/calls/struct/stat.macros.h"
|
||||
#include "libc/errno.h"
|
||||
#include "libc/fmt/fmt.h"
|
||||
#include "libc/mem/mem.h"
|
||||
#include "libc/paths.h"
|
||||
#include "libc/runtime/runtime.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "libc/sysv/consts/o.h"
|
||||
#include "third_party/finger/finger.h"
|
||||
|
|
1
third_party/libcxx/__bsd_locale_fallbacks.h
vendored
1
third_party/libcxx/__bsd_locale_fallbacks.h
vendored
|
@ -15,6 +15,7 @@
|
|||
|
||||
#include "third_party/libcxx/stdlib.h"
|
||||
#include "libc/mem/fmt.h"
|
||||
#include "libc/unicode/unicode.h"
|
||||
#include "third_party/libcxx/memory"
|
||||
|
||||
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
|
||||
|
|
1
third_party/libcxx/cstdlib
vendored
1
third_party/libcxx/cstdlib
vendored
|
@ -11,6 +11,7 @@
|
|||
#define _LIBCPP_CSTDLIB
|
||||
|
||||
#include "third_party/libcxx/__config"
|
||||
#include "libc/str/str.h"
|
||||
#include "third_party/libcxx/stdlib.h"
|
||||
|
||||
/*
|
||||
|
|
2
third_party/lua/lauxlib.c
vendored
2
third_party/lua/lauxlib.c
vendored
|
@ -29,6 +29,8 @@
|
|||
#define LUA_LIB
|
||||
#include "libc/calls/calls.h"
|
||||
#include "libc/errno.h"
|
||||
#include "libc/mem/mem.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "third_party/lua/lauxlib.h"
|
||||
#include "third_party/lua/lprefix.h"
|
||||
#include "third_party/lua/lua.h"
|
||||
|
|
1
third_party/lua/lbaselib.c
vendored
1
third_party/lua/lbaselib.c
vendored
|
@ -27,6 +27,7 @@
|
|||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#define lbaselib_c
|
||||
#define LUA_LIB
|
||||
#include "libc/str/str.h"
|
||||
#include "third_party/lua/lauxlib.h"
|
||||
#include "third_party/lua/lprefix.h"
|
||||
#include "third_party/lua/lua.h"
|
||||
|
|
1
third_party/lua/ldblib.c
vendored
1
third_party/lua/ldblib.c
vendored
|
@ -27,6 +27,7 @@
|
|||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#define ldblib_c
|
||||
#define LUA_LIB
|
||||
#include "libc/str/str.h"
|
||||
#include "third_party/lua/lauxlib.h"
|
||||
#include "third_party/lua/lprefix.h"
|
||||
#include "third_party/lua/lua.h"
|
||||
|
|
1
third_party/lua/ldebug.c
vendored
1
third_party/lua/ldebug.c
vendored
|
@ -27,6 +27,7 @@
|
|||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#define ldebug_c
|
||||
#define LUA_CORE
|
||||
#include "libc/str/str.h"
|
||||
#include "third_party/lua/lapi.h"
|
||||
#include "third_party/lua/lcode.h"
|
||||
#include "third_party/lua/ldebug.h"
|
||||
|
|
1
third_party/lua/ldo.c
vendored
1
third_party/lua/ldo.c
vendored
|
@ -32,6 +32,7 @@
|
|||
#include "libc/runtime/gc.h"
|
||||
#include "libc/runtime/internal.h"
|
||||
#include "libc/runtime/runtime.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "third_party/lua/lapi.h"
|
||||
#include "third_party/lua/ldebug.h"
|
||||
#include "third_party/lua/ldo.h"
|
||||
|
|
1
third_party/lua/lgc.c
vendored
1
third_party/lua/lgc.c
vendored
|
@ -27,6 +27,7 @@
|
|||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#define lgc_c
|
||||
#define LUA_CORE
|
||||
#include "libc/str/str.h"
|
||||
#include "third_party/lua/ldebug.h"
|
||||
#include "third_party/lua/ldo.h"
|
||||
#include "third_party/lua/lfunc.h"
|
||||
|
|
2
third_party/lua/liolib.c
vendored
2
third_party/lua/liolib.c
vendored
|
@ -30,8 +30,10 @@
|
|||
#include "libc/calls/calls.h"
|
||||
#include "libc/calls/weirdtypes.h"
|
||||
#include "libc/errno.h"
|
||||
#include "libc/stdio/lock.h"
|
||||
#include "libc/stdio/stdio.h"
|
||||
#include "libc/stdio/temp.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "third_party/lua/lauxlib.h"
|
||||
#include "third_party/lua/lprefix.h"
|
||||
#include "third_party/lua/lua.h"
|
||||
|
|
2
third_party/lua/loadlib.c
vendored
2
third_party/lua/loadlib.c
vendored
|
@ -27,6 +27,8 @@
|
|||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#define loadlib_c
|
||||
#define LUA_LIB
|
||||
#include "libc/runtime/runtime.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "third_party/lua/lauxlib.h"
|
||||
#include "third_party/lua/lprefix.h"
|
||||
#include "third_party/lua/lua.h"
|
||||
|
|
1
third_party/lua/lobject.c
vendored
1
third_party/lua/lobject.c
vendored
|
@ -27,6 +27,7 @@
|
|||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#define lobject_c
|
||||
#define LUA_CORE
|
||||
#include "libc/str/str.h"
|
||||
#include "third_party/lua/lctype.h"
|
||||
#include "third_party/lua/ldebug.h"
|
||||
#include "third_party/lua/ldo.h"
|
||||
|
|
1
third_party/lua/loslib.c
vendored
1
third_party/lua/loslib.c
vendored
|
@ -32,6 +32,7 @@
|
|||
#include "libc/errno.h"
|
||||
#include "libc/runtime/runtime.h"
|
||||
#include "libc/stdio/temp.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "libc/sysv/consts/exit.h"
|
||||
#include "libc/time/struct/tm.h"
|
||||
#include "libc/time/time.h"
|
||||
|
|
1
third_party/lua/lparser.c
vendored
1
third_party/lua/lparser.c
vendored
|
@ -27,6 +27,7 @@
|
|||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#define lparser_c
|
||||
#define LUA_CORE
|
||||
#include "libc/str/str.h"
|
||||
#include "third_party/lua/lcode.h"
|
||||
#include "third_party/lua/ldebug.h"
|
||||
#include "third_party/lua/ldo.h"
|
||||
|
|
1
third_party/lua/lstate.c
vendored
1
third_party/lua/lstate.c
vendored
|
@ -27,6 +27,7 @@
|
|||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#define lstate_c
|
||||
#define LUA_CORE
|
||||
#include "libc/str/str.h"
|
||||
#include "libc/time/time.h"
|
||||
#include "third_party/lua/lapi.h"
|
||||
#include "third_party/lua/ldebug.h"
|
||||
|
|
1
third_party/lua/lstring.c
vendored
1
third_party/lua/lstring.c
vendored
|
@ -27,6 +27,7 @@
|
|||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#define lstring_c
|
||||
#define LUA_CORE
|
||||
#include "libc/str/str.h"
|
||||
#include "third_party/lua/ldebug.h"
|
||||
#include "third_party/lua/ldo.h"
|
||||
#include "third_party/lua/lmem.h"
|
||||
|
|
1
third_party/lua/lstrlib.c
vendored
1
third_party/lua/lstrlib.c
vendored
|
@ -28,6 +28,7 @@
|
|||
#define lstrlib_c
|
||||
#define LUA_LIB
|
||||
#include "libc/math.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "third_party/lua/cosmo.h"
|
||||
#include "third_party/lua/lauxlib.h"
|
||||
#include "third_party/lua/lprefix.h"
|
||||
|
|
1
third_party/lua/ltablib.c
vendored
1
third_party/lua/ltablib.c
vendored
|
@ -28,6 +28,7 @@
|
|||
#define ltablib_c
|
||||
#define LUA_LIB
|
||||
#include "libc/calls/weirdtypes.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "libc/time/time.h"
|
||||
#include "third_party/lua/lauxlib.h"
|
||||
#include "third_party/lua/lprefix.h"
|
||||
|
|
2
third_party/lua/luac.main.c
vendored
2
third_party/lua/luac.main.c
vendored
|
@ -30,6 +30,8 @@
|
|||
#include "libc/calls/calls.h"
|
||||
#include "libc/calls/struct/sigaction.h"
|
||||
#include "libc/errno.h"
|
||||
#include "libc/runtime/runtime.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "libc/sysv/consts/exit.h"
|
||||
#include "third_party/lua/lauxlib.h"
|
||||
#include "third_party/lua/ldebug.h"
|
||||
|
|
1
third_party/lua/luaconf.h
vendored
1
third_party/lua/luaconf.h
vendored
|
@ -4,6 +4,7 @@
|
|||
#include "libc/dce.h"
|
||||
#include "libc/fmt/fmt.h"
|
||||
#include "libc/limits.h"
|
||||
#include "libc/unicode/unicode.h"
|
||||
#include "third_party/gdtoa/gdtoa.h"
|
||||
|
||||
#define LUA_USE_POSIX
|
||||
|
|
2
third_party/lua/luaencodeurl.c
vendored
2
third_party/lua/luaencodeurl.c
vendored
|
@ -16,6 +16,8 @@
|
|||
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
|
||||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/mem/mem.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "libc/x/x.h"
|
||||
#include "net/http/url.h"
|
||||
#include "third_party/lua/cosmo.h"
|
||||
|
|
1
third_party/lua/luaprintstack.c
vendored
1
third_party/lua/luaprintstack.c
vendored
|
@ -16,6 +16,7 @@
|
|||
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
|
||||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/mem/mem.h"
|
||||
#include "libc/stdio/stdio.h"
|
||||
#include "third_party/lua/cosmo.h"
|
||||
#include "third_party/lua/lua.h"
|
||||
|
|
1
third_party/lua/luapushheader.c
vendored
1
third_party/lua/luapushheader.c
vendored
|
@ -16,6 +16,7 @@
|
|||
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
|
||||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/mem/mem.h"
|
||||
#include "net/http/http.h"
|
||||
#include "third_party/lua/cosmo.h"
|
||||
#include "third_party/lua/lauxlib.h"
|
||||
|
|
1
third_party/lua/luapushheaders.c
vendored
1
third_party/lua/luapushheaders.c
vendored
|
@ -16,6 +16,7 @@
|
|||
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
|
||||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/mem/mem.h"
|
||||
#include "net/http/escape.h"
|
||||
#include "net/http/http.h"
|
||||
#include "third_party/lua/cosmo.h"
|
||||
|
|
1
third_party/lua/lundump.c
vendored
1
third_party/lua/lundump.c
vendored
|
@ -7,6 +7,7 @@
|
|||
#define lundump_c
|
||||
#define LUA_CORE
|
||||
|
||||
#include "libc/str/str.h"
|
||||
#include "third_party/lua/ldebug.h"
|
||||
#include "third_party/lua/ldo.h"
|
||||
#include "third_party/lua/lfunc.h"
|
||||
|
|
1
third_party/lua/lvm.c
vendored
1
third_party/lua/lvm.c
vendored
|
@ -27,6 +27,7 @@
|
|||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#define lvm_c
|
||||
#define LUA_CORE
|
||||
#include "libc/str/str.h"
|
||||
#include "third_party/lua/ldebug.h"
|
||||
#include "third_party/lua/ldo.h"
|
||||
#include "third_party/lua/lfunc.h"
|
||||
|
|
1
third_party/lua/lzio.c
vendored
1
third_party/lua/lzio.c
vendored
|
@ -27,6 +27,7 @@
|
|||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#define lzio_c
|
||||
#define LUA_CORE
|
||||
#include "libc/str/str.h"
|
||||
#include "third_party/lua/llimits.h"
|
||||
#include "third_party/lua/lmem.h"
|
||||
#include "third_party/lua/lprefix.h"
|
||||
|
|
2
third_party/make/error.c
vendored
2
third_party/make/error.c
vendored
|
@ -25,6 +25,8 @@
|
|||
#include "libc/stdio/stdio.h"
|
||||
#include "libc/fmt/fmt.h"
|
||||
#include "libc/fmt/fmt.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "libc/runtime/runtime.h"
|
||||
#include "third_party/make/stdio.h"
|
||||
|
||||
#if !_LIBC && ENABLE_NLS
|
||||
|
|
19
third_party/make/hash.c
vendored
19
third_party/make/hash.c
vendored
|
@ -414,24 +414,6 @@ jhash(unsigned const char *k, int length)
|
|||
|
||||
#define UINTSZ sizeof (unsigned int)
|
||||
|
||||
#ifdef WORDS_BIGENDIAN
|
||||
/* The ifs are ordered from the first byte in memory to the last. */
|
||||
#define sum_up_to_nul(r, p, plen, flag) \
|
||||
do { \
|
||||
unsigned int val = 0; \
|
||||
size_t pn = (plen); \
|
||||
size_t n = pn < UINTSZ ? pn : UINTSZ; \
|
||||
memcpy (&val, (p), n); \
|
||||
if ((val & 0xFF000000) == 0) \
|
||||
flag = 1; \
|
||||
else if ((val & 0xFF0000) == 0) \
|
||||
r += val & ~0xFFFF, flag = 1; \
|
||||
else if ((val & 0xFF00) == 0) \
|
||||
r += val & ~0xFF, flag = 1; \
|
||||
else \
|
||||
r += val, flag = (val & 0xFF) == 0; \
|
||||
} while (0)
|
||||
#else
|
||||
/* First detect the presence of zeroes. If there is none, we can
|
||||
sum the 4 bytes directly. Otherwise, the ifs are ordered as in the
|
||||
big endian case, from the first byte in memory to the last. */
|
||||
|
@ -454,7 +436,6 @@ jhash(unsigned const char *k, int length)
|
|||
r += val; \
|
||||
} \
|
||||
} while (0)
|
||||
#endif
|
||||
|
||||
unsigned int
|
||||
jhash_string(unsigned const char *k)
|
||||
|
|
3
third_party/make/make.mk
vendored
3
third_party/make/make.mk
vendored
|
@ -74,8 +74,6 @@ THIRD_PARTY_MAKE_SRCS_LIB = \
|
|||
third_party/make/xmalloc.c
|
||||
|
||||
THIRD_PARTY_MAKE_SRCS_BASE = \
|
||||
third_party/make/ar.c \
|
||||
third_party/make/arscan.c \
|
||||
third_party/make/commands.c \
|
||||
third_party/make/default.c \
|
||||
third_party/make/dir.c \
|
||||
|
@ -164,6 +162,7 @@ o/$(MODE)/third_party/make/hash.o: \
|
|||
|
||||
$(THIRD_PARTY_MAKE_OBJS): \
|
||||
OVERRIDE_CFLAGS += \
|
||||
-DNO_ARCHIVES \
|
||||
-DSTACK_FRAME_UNLIMITED \
|
||||
-DHAVE_CONFIG_H \
|
||||
-DINCLUDEDIR=\".\" \
|
||||
|
|
2
third_party/maxmind/maxminddb.c
vendored
2
third_party/maxmind/maxminddb.c
vendored
|
@ -26,8 +26,10 @@
|
|||
#include "libc/inttypes.h"
|
||||
#include "libc/limits.h"
|
||||
#include "libc/mem/mem.h"
|
||||
#include "libc/runtime/runtime.h"
|
||||
#include "libc/sock/struct/sockaddr6.h"
|
||||
#include "libc/stdio/stdio.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "libc/sysv/consts/af.h"
|
||||
#include "libc/sysv/consts/map.h"
|
||||
#include "libc/sysv/consts/o.h"
|
||||
|
|
1
third_party/mbedtls/aes.c
vendored
1
third_party/mbedtls/aes.c
vendored
|
@ -17,6 +17,7 @@
|
|||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/bits/bits.h"
|
||||
#include "libc/nexgen32e/x86feature.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "third_party/mbedtls/aes.h"
|
||||
#include "third_party/mbedtls/aesni.h"
|
||||
#include "third_party/mbedtls/common.h"
|
||||
|
|
1
third_party/mbedtls/asn1.h
vendored
1
third_party/mbedtls/asn1.h
vendored
|
@ -1,5 +1,6 @@
|
|||
#ifndef MBEDTLS_ASN1_H
|
||||
#define MBEDTLS_ASN1_H
|
||||
#include "libc/str/str.h"
|
||||
#include "third_party/mbedtls/bignum.h"
|
||||
#include "third_party/mbedtls/config.h"
|
||||
/* clang-format off */
|
||||
|
|
1
third_party/mbedtls/asn1parse.c
vendored
1
third_party/mbedtls/asn1parse.c
vendored
|
@ -15,6 +15,7 @@
|
|||
│ See the License for the specific language governing permissions and │
|
||||
│ limitations under the License. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/str/str.h"
|
||||
#include "third_party/mbedtls/asn1.h"
|
||||
#include "third_party/mbedtls/bignum.h"
|
||||
#include "third_party/mbedtls/common.h"
|
||||
|
|
1
third_party/mbedtls/asn1write.c
vendored
1
third_party/mbedtls/asn1write.c
vendored
|
@ -15,6 +15,7 @@
|
|||
│ See the License for the specific language governing permissions and │
|
||||
│ limitations under the License. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/str/str.h"
|
||||
#include "third_party/mbedtls/asn1write.h"
|
||||
#include "third_party/mbedtls/common.h"
|
||||
#include "third_party/mbedtls/error.h"
|
||||
|
|
1
third_party/mbedtls/base64.c
vendored
1
third_party/mbedtls/base64.c
vendored
|
@ -15,6 +15,7 @@
|
|||
│ See the License for the specific language governing permissions and │
|
||||
│ limitations under the License. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/str/str.h"
|
||||
#include "third_party/mbedtls/base64.h"
|
||||
#include "third_party/mbedtls/common.h"
|
||||
#include "third_party/mbedtls/platform.h"
|
||||
|
|
1
third_party/mbedtls/bignum.c
vendored
1
third_party/mbedtls/bignum.c
vendored
|
@ -26,6 +26,7 @@
|
|||
#include "libc/nexgen32e/nexgen32e.h"
|
||||
#include "libc/nexgen32e/x86feature.h"
|
||||
#include "libc/runtime/runtime.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "third_party/mbedtls/bignum.h"
|
||||
#include "third_party/mbedtls/bignum_internal.h"
|
||||
#include "third_party/mbedtls/chk.h"
|
||||
|
|
1
third_party/mbedtls/ccm.c
vendored
1
third_party/mbedtls/ccm.c
vendored
|
@ -15,6 +15,7 @@
|
|||
│ See the License for the specific language governing permissions and │
|
||||
│ limitations under the License. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/str/str.h"
|
||||
#include "third_party/mbedtls/ccm.h"
|
||||
#include "third_party/mbedtls/common.h"
|
||||
#include "third_party/mbedtls/error.h"
|
||||
|
|
1
third_party/mbedtls/chacha20.c
vendored
1
third_party/mbedtls/chacha20.c
vendored
|
@ -17,6 +17,7 @@
|
|||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/bits/bits.h"
|
||||
#include "libc/stdio/stdio.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "third_party/mbedtls/chacha20.h"
|
||||
#include "third_party/mbedtls/common.h"
|
||||
#include "third_party/mbedtls/error.h"
|
||||
|
|
1
third_party/mbedtls/chachapoly.c
vendored
1
third_party/mbedtls/chachapoly.c
vendored
|
@ -15,6 +15,7 @@
|
|||
│ See the License for the specific language governing permissions and │
|
||||
│ limitations under the License. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/str/str.h"
|
||||
#include "third_party/mbedtls/chachapoly.h"
|
||||
#include "third_party/mbedtls/chk.h"
|
||||
#include "third_party/mbedtls/common.h"
|
||||
|
|
1
third_party/mbedtls/cipher.c
vendored
1
third_party/mbedtls/cipher.c
vendored
|
@ -15,6 +15,7 @@
|
|||
│ See the License for the specific language governing permissions and │
|
||||
│ limitations under the License. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/str/str.h"
|
||||
#include "third_party/mbedtls/ccm.h"
|
||||
#include "third_party/mbedtls/chacha20.h"
|
||||
#include "third_party/mbedtls/chachapoly.h"
|
||||
|
|
1
third_party/mbedtls/debug.c
vendored
1
third_party/mbedtls/debug.c
vendored
|
@ -15,6 +15,7 @@
|
|||
│ See the License for the specific language governing permissions and │
|
||||
│ limitations under the License. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/str/str.h"
|
||||
#include "third_party/mbedtls/common.h"
|
||||
#include "third_party/mbedtls/debug.h"
|
||||
#include "third_party/mbedtls/error.h"
|
||||
|
|
1
third_party/mbedtls/dhm.c
vendored
1
third_party/mbedtls/dhm.c
vendored
|
@ -16,6 +16,7 @@
|
|||
│ limitations under the License. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/calls/calls.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "third_party/mbedtls/asn1.h"
|
||||
#include "third_party/mbedtls/bignum.h"
|
||||
#include "third_party/mbedtls/common.h"
|
||||
|
|
1
third_party/mbedtls/ecdh_everest.c
vendored
1
third_party/mbedtls/ecdh_everest.c
vendored
|
@ -15,6 +15,7 @@
|
|||
│ See the License for the specific language governing permissions and │
|
||||
│ limitations under the License. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/str/str.h"
|
||||
#include "third_party/mbedtls/ecdh_everest.h"
|
||||
#include "third_party/mbedtls/everest.h"
|
||||
#if defined(MBEDTLS_ECDH_C) && defined(MBEDTLS_ECDH_VARIANT_EVEREST_ENABLED)
|
||||
|
|
1
third_party/mbedtls/ecdsa.c
vendored
1
third_party/mbedtls/ecdsa.c
vendored
|
@ -15,6 +15,7 @@
|
|||
│ See the License for the specific language governing permissions and │
|
||||
│ limitations under the License. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/str/str.h"
|
||||
#include "third_party/mbedtls/asn1write.h"
|
||||
#include "third_party/mbedtls/common.h"
|
||||
#include "third_party/mbedtls/ecdsa.h"
|
||||
|
|
1
third_party/mbedtls/ecp.c
vendored
1
third_party/mbedtls/ecp.c
vendored
|
@ -20,6 +20,7 @@
|
|||
#include "libc/log/log.h"
|
||||
#include "libc/runtime/runtime.h"
|
||||
#include "libc/stdio/stdio.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "third_party/mbedtls/bignum.h"
|
||||
#include "third_party/mbedtls/bignum_internal.h"
|
||||
#include "third_party/mbedtls/common.h"
|
||||
|
|
1
third_party/mbedtls/ecp256.c
vendored
1
third_party/mbedtls/ecp256.c
vendored
|
@ -21,6 +21,7 @@
|
|||
#include "libc/nexgen32e/x86feature.h"
|
||||
#include "libc/runtime/gc.internal.h"
|
||||
#include "libc/runtime/runtime.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "third_party/mbedtls/bignum_internal.h"
|
||||
#include "third_party/mbedtls/ecp.h"
|
||||
#include "third_party/mbedtls/ecp_internal.h"
|
||||
|
|
1
third_party/mbedtls/ecp384.c
vendored
1
third_party/mbedtls/ecp384.c
vendored
|
@ -22,6 +22,7 @@
|
|||
#include "libc/nexgen32e/x86feature.h"
|
||||
#include "libc/runtime/gc.internal.h"
|
||||
#include "libc/runtime/runtime.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "third_party/mbedtls/bignum_internal.h"
|
||||
#include "third_party/mbedtls/ecp.h"
|
||||
#include "third_party/mbedtls/ecp_internal.h"
|
||||
|
|
1
third_party/mbedtls/ecp_curves.c
vendored
1
third_party/mbedtls/ecp_curves.c
vendored
|
@ -15,6 +15,7 @@
|
|||
│ See the License for the specific language governing permissions and │
|
||||
│ limitations under the License. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/str/str.h"
|
||||
#include "third_party/mbedtls/common.h"
|
||||
#include "third_party/mbedtls/ecp.h"
|
||||
#include "third_party/mbedtls/error.h"
|
||||
|
|
1
third_party/mbedtls/entropy.c
vendored
1
third_party/mbedtls/entropy.c
vendored
|
@ -17,6 +17,7 @@
|
|||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/calls/calls.h"
|
||||
#include "libc/stdio/stdio.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "third_party/mbedtls/common.h"
|
||||
#include "third_party/mbedtls/entropy.h"
|
||||
#include "third_party/mbedtls/entropy_poll.h"
|
||||
|
|
1
third_party/mbedtls/error.c
vendored
1
third_party/mbedtls/error.c
vendored
|
@ -16,6 +16,7 @@
|
|||
│ limitations under the License. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/fmt/fmt.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "third_party/mbedtls/aes.h"
|
||||
#include "third_party/mbedtls/asn1.h"
|
||||
#include "third_party/mbedtls/base64.h"
|
||||
|
|
1
third_party/mbedtls/md.c
vendored
1
third_party/mbedtls/md.c
vendored
|
@ -18,6 +18,7 @@
|
|||
#include "libc/mem/mem.h"
|
||||
#include "libc/stdio/stdio.h"
|
||||
#include "libc/str/blake2.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "third_party/mbedtls/common.h"
|
||||
#include "third_party/mbedtls/error.h"
|
||||
#include "third_party/mbedtls/md.h"
|
||||
|
|
1
third_party/mbedtls/md5.c
vendored
1
third_party/mbedtls/md5.c
vendored
|
@ -16,6 +16,7 @@
|
|||
│ limitations under the License. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/bits/bits.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "third_party/mbedtls/common.h"
|
||||
#include "third_party/mbedtls/error.h"
|
||||
#include "third_party/mbedtls/md.h"
|
||||
|
|
1
third_party/mbedtls/nist_kw.c
vendored
1
third_party/mbedtls/nist_kw.c
vendored
|
@ -15,6 +15,7 @@
|
|||
│ See the License for the specific language governing permissions and │
|
||||
│ limitations under the License. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/str/str.h"
|
||||
#include "third_party/mbedtls/common.h"
|
||||
#include "third_party/mbedtls/endian.h"
|
||||
#include "third_party/mbedtls/error.h"
|
||||
|
|
1
third_party/mbedtls/oid.c
vendored
1
third_party/mbedtls/oid.c
vendored
|
@ -16,6 +16,7 @@
|
|||
│ limitations under the License. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/fmt/fmt.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "third_party/mbedtls/common.h"
|
||||
#include "third_party/mbedtls/error.h"
|
||||
#include "third_party/mbedtls/oid.h"
|
||||
|
|
1
third_party/mbedtls/param.c
vendored
1
third_party/mbedtls/param.c
vendored
|
@ -20,6 +20,7 @@
|
|||
#include "libc/fmt/itoa.h"
|
||||
#include "libc/mem/mem.h"
|
||||
#include "libc/runtime/runtime.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "third_party/mbedtls/platform.h"
|
||||
|
||||
void mbedtls_param_failed(const char *msg, const char *file, int line) {
|
||||
|
|
1
third_party/mbedtls/pem.c
vendored
1
third_party/mbedtls/pem.c
vendored
|
@ -16,6 +16,7 @@
|
|||
│ limitations under the License. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/mem/mem.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "third_party/mbedtls/aes.h"
|
||||
#include "third_party/mbedtls/base64.h"
|
||||
#include "third_party/mbedtls/chk.h"
|
||||
|
|
1
third_party/mbedtls/pk_wrap.c
vendored
1
third_party/mbedtls/pk_wrap.c
vendored
|
@ -15,6 +15,7 @@
|
|||
│ See the License for the specific language governing permissions and │
|
||||
│ limitations under the License. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/str/str.h"
|
||||
#include "third_party/mbedtls/asn1.h"
|
||||
#include "third_party/mbedtls/asn1write.h"
|
||||
#include "third_party/mbedtls/common.h"
|
||||
|
|
1
third_party/mbedtls/test/everest_test.c
vendored
1
third_party/mbedtls/test/everest_test.c
vendored
|
@ -18,6 +18,7 @@
|
|||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/rand/rand.h"
|
||||
#include "libc/stdio/stdio.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "libc/testlib/ezbench.h"
|
||||
#include "libc/testlib/testlib.h"
|
||||
#include "third_party/mbedtls/config.h"
|
||||
|
|
2
third_party/mbedtls/test/test.mk
vendored
2
third_party/mbedtls/test/test.mk
vendored
|
@ -137,7 +137,7 @@ o/$(MODE)/third_party/mbedtls/test/%.com: o/$(MODE)/third_party/mbedtls/test/%.c
|
|||
@$(COMPILE) -AOBJCOPY -T$@ $(OBJCOPY) -S -O binary $< $@
|
||||
|
||||
o/$(MODE)/third_party/mbedtls/test/%.com.runs: o/$(MODE)/third_party/mbedtls/test/%.com
|
||||
@$(COMPILE) -ACHECK -tT$@ $< $(TESTARGS)
|
||||
@$(COMPILE) -wACHECK -tT$@ $< $(TESTARGS)
|
||||
|
||||
$(THIRD_PARTY_MBEDTLS_TEST_OBJS): \
|
||||
OVERRIDE_CFLAGS += \
|
||||
|
|
1
third_party/python/Include/pydebug.h
vendored
1
third_party/python/Include/pydebug.h
vendored
|
@ -3,6 +3,7 @@
|
|||
#define Py_PYDEBUG_H
|
||||
COSMOPOLITAN_C_START_
|
||||
/* clang-format off */
|
||||
#include "libc/runtime/runtime.h"
|
||||
|
||||
/* These global variable are defined in pylifecycle.c */
|
||||
/* XXX (ncoghlan): move these declarations to pylifecycle.h? */
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
#include "libc/errno.h"
|
||||
#include "libc/fmt/fmt.h"
|
||||
#include "libc/unicode/locale.h"
|
||||
#include "libc/unicode/unicode.h"
|
||||
#include "third_party/python/Modules/_decimal/libmpdec/bits.h"
|
||||
#include "third_party/python/Modules/_decimal/libmpdec/constants.h"
|
||||
#include "third_party/python/Modules/_decimal/libmpdec/io.h"
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
│ OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, │
|
||||
│ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/mem/mem.h"
|
||||
#include "third_party/python/Modules/_decimal/libmpdec/mpalloc.h"
|
||||
#include "third_party/python/Modules/_decimal/libmpdec/mpdecimal.h"
|
||||
#include "third_party/python/Modules/_decimal/libmpdec/typearith.h"
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
#include "libc/fmt/conv.h"
|
||||
#include "libc/inttypes.h"
|
||||
#include "libc/limits.h"
|
||||
#include "libc/runtime/runtime.h"
|
||||
#include "libc/stdio/stdio.h"
|
||||
#include "third_party/python/pyconfig.h"
|
||||
COSMOPOLITAN_C_START_
|
||||
|
|
1
third_party/python/Modules/_localemodule.c
vendored
1
third_party/python/Modules/_localemodule.c
vendored
|
@ -7,6 +7,7 @@
|
|||
#define PY_SSIZE_T_CLEAN
|
||||
#include "libc/unicode/langinfo.h"
|
||||
#include "libc/unicode/locale.h"
|
||||
#include "libc/unicode/unicode.h"
|
||||
#include "third_party/python/Include/dictobject.h"
|
||||
#include "third_party/python/Include/fileutils.h"
|
||||
#include "third_party/python/Include/import.h"
|
||||
|
|
1
third_party/python/Modules/_testcapimodule.c
vendored
1
third_party/python/Modules/_testcapimodule.c
vendored
|
@ -12,6 +12,7 @@
|
|||
#include "libc/fmt/fmt.h"
|
||||
#include "libc/limits.h"
|
||||
#include "libc/math.h"
|
||||
#include "libc/mem/mem.h"
|
||||
#include "libc/sysv/consts/sig.h"
|
||||
#include "libc/time/time.h"
|
||||
#include "third_party/python/Include/abstract.h"
|
||||
|
|
1
third_party/python/Modules/_tracemalloc.c
vendored
1
third_party/python/Modules/_tracemalloc.c
vendored
|
@ -6,6 +6,7 @@
|
|||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/errno.h"
|
||||
#include "libc/fmt/conv.h"
|
||||
#include "libc/mem/mem.h"
|
||||
#include "third_party/python/Include/boolobject.h"
|
||||
#include "third_party/python/Include/dictobject.h"
|
||||
#include "third_party/python/Include/fileutils.h"
|
||||
|
|
1
third_party/python/Modules/expat/xmlparse.c
vendored
1
third_party/python/Modules/expat/xmlparse.c
vendored
|
@ -3,6 +3,7 @@
|
|||
#include "libc/calls/struct/timeval.h"
|
||||
#include "libc/errno.h"
|
||||
#include "libc/limits.h"
|
||||
#include "libc/mem/mem.h"
|
||||
#include "libc/nexgen32e/rdtsc.h"
|
||||
#include "libc/nexgen32e/x86feature.h"
|
||||
#include "libc/rand/rand.h"
|
||||
|
|
1
third_party/python/Modules/resource.c
vendored
1
third_party/python/Modules/resource.c
vendored
|
@ -9,6 +9,7 @@
|
|||
#include "libc/calls/struct/rusage.h"
|
||||
#include "libc/calls/weirdtypes.h"
|
||||
#include "libc/errno.h"
|
||||
#include "libc/runtime/runtime.h"
|
||||
#include "libc/sysv/consts/rlim.h"
|
||||
#include "libc/sysv/consts/rlimit.h"
|
||||
#include "libc/sysv/consts/rusage.h"
|
||||
|
|
1
third_party/python/Objects/fileobject.c
vendored
1
third_party/python/Objects/fileobject.c
vendored
|
@ -7,6 +7,7 @@
|
|||
#define PY_SSIZE_T_CLEAN
|
||||
#include "libc/calls/calls.h"
|
||||
#include "libc/errno.h"
|
||||
#include "libc/stdio/lock.h"
|
||||
#include "third_party/python/Include/abstract.h"
|
||||
#include "third_party/python/Include/boolobject.h"
|
||||
#include "third_party/python/Include/bytesobject.h"
|
||||
|
|
1
third_party/python/Objects/obmalloc.c
vendored
1
third_party/python/Objects/obmalloc.c
vendored
|
@ -10,6 +10,7 @@
|
|||
#include "libc/dce.h"
|
||||
#include "libc/fmt/fmt.h"
|
||||
#include "libc/intrin/asan.internal.h"
|
||||
#include "libc/mem/mem.h"
|
||||
#include "libc/runtime/runtime.h"
|
||||
#include "libc/sysv/consts/map.h"
|
||||
#include "libc/sysv/consts/prot.h"
|
||||
|
|
1
third_party/python/Parser/acceler.c
vendored
1
third_party/python/Parser/acceler.c
vendored
|
@ -4,6 +4,7 @@
|
|||
│ Python 3 │
|
||||
│ https://docs.python.org/3/license.html │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/runtime/runtime.h"
|
||||
#include "third_party/python/Include/grammar.h"
|
||||
#include "third_party/python/Include/node.h"
|
||||
#include "third_party/python/Include/objimpl.h"
|
||||
|
|
1
third_party/python/Parser/grammar.c
vendored
1
third_party/python/Parser/grammar.c
vendored
|
@ -4,6 +4,7 @@
|
|||
│ Python 3 │
|
||||
│ https://docs.python.org/3/license.html │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/mem/mem.h"
|
||||
#include "third_party/python/Include/grammar.h"
|
||||
#include "third_party/python/Include/objimpl.h"
|
||||
#include "third_party/python/Include/pgenheaders.h"
|
||||
|
|
58
third_party/python/Python/cosmomodule.c
vendored
58
third_party/python/Python/cosmomodule.c
vendored
|
@ -19,7 +19,9 @@
|
|||
#define PY_SSIZE_T_CLEAN
|
||||
#include "dsp/scale/cdecimate2xuint8x8.h"
|
||||
#include "libc/bits/popcnt.h"
|
||||
#include "libc/calls/calls.h"
|
||||
#include "libc/dce.h"
|
||||
#include "libc/errno.h"
|
||||
#include "libc/macros.internal.h"
|
||||
#include "libc/math.h"
|
||||
#include "libc/mem/mem.h"
|
||||
|
@ -27,6 +29,7 @@
|
|||
#include "libc/nexgen32e/rdtsc.h"
|
||||
#include "libc/nexgen32e/rdtscp.h"
|
||||
#include "libc/runtime/runtime.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "third_party/python/Include/abstract.h"
|
||||
#include "third_party/python/Include/import.h"
|
||||
#include "third_party/python/Include/longobject.h"
|
||||
|
@ -187,6 +190,59 @@ cosmo_popcount(PyObject *self, PyObject *args)
|
|||
return PyLong_FromSize_t(_countbits(p, n));
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(pledge_doc,
|
||||
"pledge($module, promises, execpromises)\n\
|
||||
--\n\n\
|
||||
Permits syscall operations, e.g.\n\
|
||||
\n\
|
||||
>>> cosmo.pledge('stdio rpath tty', None)\n\
|
||||
\n\
|
||||
This function implements the OpenBSD pledge() API for\n\
|
||||
OpenBSD and Linux, where we use SECCOMP BPF. Read the\n\
|
||||
Cosmopolitan Libc documentation to learn more.");
|
||||
|
||||
static PyObject *
|
||||
cosmo_pledge(PyObject *self, PyObject *args)
|
||||
{
|
||||
int e = errno;
|
||||
const char *x, *y;
|
||||
if (!PyArg_ParseTuple(args, "sz:pledge", &x, &y)) return 0;
|
||||
if (!pledge(x, y)) {
|
||||
Py_RETURN_NONE;
|
||||
} else {
|
||||
PyErr_SetString(PyExc_SystemError, strerror(errno));
|
||||
errno = e;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(unveil_doc,
|
||||
"unveil($module, path, permissions)\n\
|
||||
--\n\n\
|
||||
Permits filesystem operations, e.g.\n\
|
||||
\n\
|
||||
>>> cosmo.unveil('.', 'rwcx')\n\
|
||||
>>> cosmo.unveil(None, None)\n\
|
||||
\n\
|
||||
This function implements the OpenBSD unveil() API for\n\
|
||||
OpenBSD and Linux where we use Landlock LSM. Read the\n\
|
||||
Cosmopolitan Libc documentation to learn more.");
|
||||
|
||||
static PyObject *
|
||||
cosmo_unveil(PyObject *self, PyObject *args)
|
||||
{
|
||||
int e = errno;
|
||||
const char *x, *y;
|
||||
if (!PyArg_ParseTuple(args, "zz:unveil", &x, &y)) return 0;
|
||||
if (!unveil(x, y)) {
|
||||
Py_RETURN_NONE;
|
||||
} else {
|
||||
PyErr_SetString(PyExc_SystemError, strerror(errno));
|
||||
errno = e;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(exit1_doc,
|
||||
"exit1($module)\n\
|
||||
--\n\n\
|
||||
|
@ -269,6 +325,8 @@ static PyMethodDef cosmo_methods[] = {
|
|||
{"exit1", cosmo_exit1, METH_NOARGS, exit1_doc},
|
||||
{"rdtsc", cosmo_rdtsc, METH_NOARGS, rdtsc_doc},
|
||||
{"crc32c", cosmo_crc32c, METH_VARARGS, crc32c_doc},
|
||||
{"pledge", cosmo_pledge, METH_VARARGS, pledge_doc},
|
||||
{"unveil", cosmo_unveil, METH_VARARGS, unveil_doc},
|
||||
{"syscount", cosmo_syscount, METH_NOARGS, syscount_doc},
|
||||
{"popcount", cosmo_popcount, METH_VARARGS, popcount_doc},
|
||||
{"decimate", cosmo_decimate, METH_VARARGS, decimate_doc},
|
||||
|
|
1
third_party/python/Python/dtoa.c
vendored
1
third_party/python/Python/dtoa.c
vendored
|
@ -7,6 +7,7 @@
|
|||
#include "libc/assert.h"
|
||||
#include "libc/errno.h"
|
||||
#include "libc/math.h"
|
||||
#include "libc/runtime/runtime.h"
|
||||
#include "third_party/python/Include/pymem.h"
|
||||
#include "third_party/python/Include/pyport.h"
|
||||
/* clang-format off */
|
||||
|
|
1
third_party/python/Python/errors.c
vendored
1
third_party/python/Python/errors.c
vendored
|
@ -5,6 +5,7 @@
|
|||
│ https://docs.python.org/3/license.html │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/errno.h"
|
||||
#include "libc/mem/mem.h"
|
||||
#include "libc/nt/enum/formatmessageflags.h"
|
||||
#include "libc/nt/enum/lang.h"
|
||||
#include "libc/nt/memory.h"
|
||||
|
|
1
third_party/python/Python/fileutils.c
vendored
1
third_party/python/Python/fileutils.c
vendored
|
@ -15,6 +15,7 @@
|
|||
#include "libc/sysv/consts/fio.h"
|
||||
#include "libc/sysv/consts/o.h"
|
||||
#include "libc/unicode/locale.h"
|
||||
#include "libc/unicode/unicode.h"
|
||||
#include "third_party/python/Include/bytesobject.h"
|
||||
#include "third_party/python/Include/ceval.h"
|
||||
#include "third_party/python/Include/fileutils.h"
|
||||
|
|
5
third_party/python/Python/import.c
vendored
5
third_party/python/Python/import.c
vendored
|
@ -11,14 +11,15 @@
|
|||
#include "libc/calls/struct/stat.macros.h"
|
||||
#include "libc/fmt/conv.h"
|
||||
#include "libc/macros.internal.h"
|
||||
#include "libc/mem/mem.h"
|
||||
#include "libc/runtime/gc.h"
|
||||
#include "libc/x/x.h"
|
||||
#include "libc/sysv/consts/o.h"
|
||||
#include "libc/sysv/consts/s.h"
|
||||
#include "libc/x/x.h"
|
||||
#include "third_party/python/Include/Python-ast.h"
|
||||
#include "third_party/python/Include/abstract.h"
|
||||
#include "third_party/python/Include/boolobject.h"
|
||||
#include "third_party/python/Include/bltinmodule.h"
|
||||
#include "third_party/python/Include/boolobject.h"
|
||||
#include "third_party/python/Include/ceval.h"
|
||||
#include "third_party/python/Include/code.h"
|
||||
#include "third_party/python/Include/dictobject.h"
|
||||
|
|
1
third_party/python/freeze.c
vendored
1
third_party/python/freeze.c
vendored
|
@ -5,6 +5,7 @@
|
|||
│ https://docs.python.org/3/license.html │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/assert.h"
|
||||
#include "libc/mem/mem.h"
|
||||
#include "third_party/python/Include/bytesobject.h"
|
||||
#include "third_party/python/Include/compile.h"
|
||||
#include "third_party/python/Include/fileutils.h"
|
||||
|
|
1
third_party/python/launch.c
vendored
1
third_party/python/launch.c
vendored
|
@ -9,6 +9,7 @@
|
|||
#include "libc/intrin/kprintf.h"
|
||||
#include "libc/log/libfatal.internal.h"
|
||||
#include "libc/log/log.h"
|
||||
#include "libc/mem/mem.h"
|
||||
#include "libc/runtime/runtime.h"
|
||||
#include "libc/testlib/testlib.h"
|
||||
#include "libc/x/x.h"
|
||||
|
|
750
third_party/python/python.mk
vendored
750
third_party/python/python.mk
vendored
File diff suppressed because it is too large
Load diff
1
third_party/quickjs/VERSION
vendored
1
third_party/quickjs/VERSION
vendored
|
@ -1 +0,0 @@
|
|||
2021-03-27
|
1
third_party/quickjs/array.c
vendored
1
third_party/quickjs/array.c
vendored
|
@ -22,6 +22,7 @@
|
|||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
#include "libc/str/str.h"
|
||||
#include "third_party/quickjs/internal.h"
|
||||
|
||||
asm(".ident\t\"\\n\\n\
|
||||
|
|
2
third_party/quickjs/atof.c
vendored
2
third_party/quickjs/atof.c
vendored
|
@ -23,6 +23,8 @@
|
|||
* THE SOFTWARE.
|
||||
*/
|
||||
#include "libc/assert.h"
|
||||
#include "libc/runtime/runtime.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "third_party/gdtoa/gdtoa.h"
|
||||
#include "third_party/quickjs/internal.h"
|
||||
|
||||
|
|
1
third_party/quickjs/atom.c
vendored
1
third_party/quickjs/atom.c
vendored
|
@ -24,6 +24,7 @@
|
|||
*/
|
||||
#include "libc/assert.h"
|
||||
#include "libc/fmt/fmt.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "third_party/quickjs/internal.h"
|
||||
#include "third_party/quickjs/libregexp.h"
|
||||
#include "third_party/quickjs/quickjs.h"
|
||||
|
|
2
third_party/quickjs/bigdecimal.c
vendored
2
third_party/quickjs/bigdecimal.c
vendored
|
@ -22,6 +22,8 @@
|
|||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
#include "libc/runtime/runtime.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "third_party/quickjs/internal.h"
|
||||
|
||||
asm(".ident\t\"\\n\\n\
|
||||
|
|
1
third_party/quickjs/bigint.c
vendored
1
third_party/quickjs/bigint.c
vendored
|
@ -23,6 +23,7 @@
|
|||
* THE SOFTWARE.
|
||||
*/
|
||||
#include "libc/assert.h"
|
||||
#include "libc/runtime/runtime.h"
|
||||
#include "third_party/quickjs/internal.h"
|
||||
|
||||
asm(".ident\t\"\\n\\n\
|
||||
|
|
2
third_party/quickjs/byte.c
vendored
2
third_party/quickjs/byte.c
vendored
|
@ -23,6 +23,8 @@
|
|||
* THE SOFTWARE.
|
||||
*/
|
||||
#include "libc/assert.h"
|
||||
#include "libc/runtime/runtime.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "third_party/quickjs/internal.h"
|
||||
#include "third_party/quickjs/leb128.h"
|
||||
#include "third_party/quickjs/libregexp.h"
|
||||
|
|
2
third_party/quickjs/dbuf.c
vendored
2
third_party/quickjs/dbuf.c
vendored
|
@ -23,6 +23,8 @@
|
|||
* THE SOFTWARE.
|
||||
*/
|
||||
#include "libc/fmt/fmt.h"
|
||||
#include "libc/mem/mem.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "third_party/quickjs/internal.h"
|
||||
#include "third_party/quickjs/libregexp.h"
|
||||
#include "third_party/quickjs/quickjs.h"
|
||||
|
|
1
third_party/quickjs/float.c
vendored
1
third_party/quickjs/float.c
vendored
|
@ -22,6 +22,7 @@
|
|||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
#include "libc/runtime/runtime.h"
|
||||
#include "third_party/quickjs/internal.h"
|
||||
|
||||
asm(".ident\t\"\\n\\n\
|
||||
|
|
1
third_party/quickjs/gc.c
vendored
1
third_party/quickjs/gc.c
vendored
|
@ -23,6 +23,7 @@
|
|||
* THE SOFTWARE.
|
||||
*/
|
||||
#include "libc/assert.h"
|
||||
#include "libc/runtime/runtime.h"
|
||||
#include "third_party/quickjs/internal.h"
|
||||
|
||||
asm(".ident\t\"\\n\\n\
|
||||
|
|
1
third_party/quickjs/gen.c
vendored
1
third_party/quickjs/gen.c
vendored
|
@ -23,6 +23,7 @@
|
|||
* THE SOFTWARE.
|
||||
*/
|
||||
#include "libc/assert.h"
|
||||
#include "libc/runtime/runtime.h"
|
||||
#include "third_party/quickjs/internal.h"
|
||||
|
||||
asm(".ident\t\"\\n\\n\
|
||||
|
|
1
third_party/quickjs/json.c
vendored
1
third_party/quickjs/json.c
vendored
|
@ -24,6 +24,7 @@
|
|||
*/
|
||||
#include "libc/assert.h"
|
||||
#include "libc/fmt/fmt.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "third_party/quickjs/internal.h"
|
||||
#include "third_party/quickjs/libregexp.h"
|
||||
#include "third_party/quickjs/quickjs.h"
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue